Webserver to RAID 1
I finally got around to setting up a mirrored array on my web server today and
after 2 attempts I finally got it right! Thank the gods for backups...
I used the advice from Hack #63 - "Migrate to Software RAID" in
Knoppix Hacks to get it going. It seems though that this
book is in need of an update. As time goes on more and more of the hacks are
either different for don't work at all as written. In this case, the RAID
related hacks all use raidtools2 for manipulating and created the arrays where
as the newer versions of
Knoppix only have the newer mdadm tools installed. This
wouldn't have been a big deal except that I'm not a RAID expert in Linux and
don't know enough to reconstruct the commands to do the exact same thing in
mdadm as is being done in the hack with raidtools2. I even checked on
O'reilly's Safari pages to see if that was updated and it hasn't been.
Ultimately I just grabbed an older Knoppix 3.6 CD and used that to make the
RAID.
A summary of the steps are:
- Boot Knoppix CD
- Make an
/etc/raidtab with your existing drive marked as
failed, this lets you create the array without killing your existing partition
- Create the array then copy the entire contents of your existing drive to the
new array
- Set your existing drive as no longer failed and then add it to the array,
causing the array to overwrite your existing drive with the stuff on the array
This isn't a big deal since you just copied all your stuff to the array.
- Modify lilo.conf and run lilo (covered in Hack #52 - "Repair Lilo")
- Change all the partition in the array from whatever they currently are to
type FD which is Raid Auto detect
- Reboot and hope for the best
BTW, this isn't meant to be a how to and I've left a mess of things out. I just
wanted to summaries.
So, after I went though all of this I learned that the lilo in Knoppix 3.6
wasn't happy with my system. I don't know why, but I got a screen full of
"LI99 99 99 99 99" stuff. So I booted off a more current Knoppix disc just to
discover that I forgot to recompile the kernel with MD support! Argh... I'm
an idiot. I tried for about 45 minutes to revert back to just boot off the
original drive but no matter what I did it kept looking for an /dev/md0 so I
just gave up and restored from backup, then started all over again from the
beginning.
Now I just need to figure out how to recover if one of my drives dies!