One of the reasons I started this blog is to write about problems I’ve solved that I can’t find answers to already on the web. Today, let’s talk about moving your linux install to linux software raid (md raid / mdadm). This post assumes you are running Ubuntu Linux 8.04, but any Debian-based distro from the past two years, or most other distros, will have similar commands.
We start with an install on a single 80 GB SATA drive, partitioned as follows:
/dev/sda1 as /, 10GB, ext3, bootable
/dev/sda2 as swap, 1GB
/dev/sda3 as /home, 69GB, ext3
We want to add a second 80GB SATA drive and move the entire install to use RAID1 between the two drives. So the final configuration will appear:
/dev/md0 as /, 10GB, ext3
/dev/md1 as swap, 1GB
/dev/md2 as /home, 69GB, ext3
Where the raid arrays are:
md0 : active raid1 sda1[0] sdb1[1]
md1 : active raid1 sda2[0] sdb2[1]
md2 : active raid1 sda3[0] sdb3[1]
Here there be dragons. As always, back up your data first. If you don’t know how to use rsync, now is an excellent time to learn.
Read the rest of this entry »