Ahhh, Synched.

Wow, am I glad that’s over.

In the ongoing saga of getting my new server set up, I was right at the point where I was going to switch my hard disks over to a RAID1 setup. I have two 500GB SATA disks, and probably about 200GB of data on the one of them. So I went through the process outlined in many places online:

  1. Create a number of RAID1 partitions on the empty disk, to match up what you have on the full disk. These RAID1 partitions are set up with two devices, the empty hard disk and “missing”, which tells the RAID controller that you haven’t gotten around to adding the other device yet.
  2. Copy all the data from the “normal” disk to the new RAID1 disk.
  3. Get as much of your system ready to boot under RAID as possible. This includes editing /etc/fstab, making an /etc/mdadm.conf file, and setting up lilo to boot off the RAID partition.

…except that lilo wasn’t cooperating. You see, lilo doesn’t like to install onto a degraded RAID1 array, with the versions of kernel/lilo/whatever that I have.

#$@*. Doomed.

Oh well, let’s carry on!

Next came booting the rescue OS that comes with the Linux installer and finishing up the installation. The idea is that you finish setting up the RAID1 partitions under the rescue OS so they have a chance to fully sync up before you bring the system back up. This is the first place where I thought my 200GB of data was lost (well only the few dozen megabytes I generated since my last full backup, but that still had me freaking out), because I just couldn’t get the RAID1 partitions loading.

“Oh wait, maybe I need to load some module.” Ah yes. Today’s episode, brought to you by the Linux command “modprobe raid1“. Now I can see my precious data again…

Once the RAID1 partitions were all synched up, it was a small matter of getting all the boot-related stuff taken care of. This would have been simple, except that the instructions I was following had me do something like this:

  mount /dev/md1 /mnt/raid
  mount /dev/md0 /mnt/raid/boot
  chroot /mnt/raid /bin/bash
  source /etc/profile

This was to switch the system into a state like the final running system, so that I could complete the boot setup. Only problem is, /proc, /dev, and /sys are all empy, and I kinda need those if I’m going to do any sweet-talking with my hard disks.

That was the second “#$@*. Doomed.” moment. But, thankfully, I got it figured out pretty quickly (/proc was easy, /sys was kludgey, and /dev was gross), and got my boot stuff taken care of.

And now, it all seems to work! You are reading my blog again, after all. :-)

I never want to deal with that again. If I have to, well, I’ll know how. But the reason I went through all this rigamarole in the first place was that I didn’t want to buy an extra hard disk, and in retrospect, I think I would have rather just had an extra HDD sitting around. It would be my emergency device/paperweight, or something.

Leave a Reply