RAID goodness

All this time, knowing full well the complete lack of backups (and even having lost data in the past), I’ve been dancing with the devil, in the form of no redundancy on my main storage box. It had hundreds of GB of data on it, and if any one drive failed, there goes all the data on it. Well, no more. Today, the ice has gotten thicker:


md0 : active raid5 hdd1[3] hdc1[2] hdb1[1] hda1[0] 732587712 blocks level 5, 32k chunk, algorithm 2 [4/4] [UUUU]
/dev/mapper/storage-storage 699G 84M 699G 1% /mnt

And the disk space had doubled. :)

Of course, the road to RAID 5 goodness was not all smooth. My nice, new hard disks arrived, and I put them all into the box, and powered up, and it ran great… for about 2 seconds. Dead power supply. “What!?” I said to myself, “A 350 Watt PS can’t power 5 hard drives in a dual CPU box?” Well, apparently not, so the next day I went and ordered a new Antec 430 Watt PS for pickup at CompUSA.

During that night, however, some moron managed to cut my DSL line 2000 ft. from my house. I went ahead and ordered the PS anyway (from work, of course), completely forgetting that my mail server was behind my (now useless) DLS line, and I therefore couldn’t get the confirmation email necessary to pick up the PS. One call to LBDSL and a few line tests later, I learned the line was cut, and that SBC had 24 hours to fix it.

Fast forward to yesterday, ~3 PM, my DSL comes back up. Yay! Next step, wait for may backed up mail to arrive, go and pick up my PS, go home and perform surgery on my beloved dulie, and it comes to life! Joy of joys. Then, it gets to the point of loading grub, and hangs. Shit.

I vaguely remembered that, when I last used the scsi disk in that box as a system drive, I couldn’t get it to boot from grub, but I had to use an IDE drive to bootstrap grub. Hmmm… Okay, let’s try re-installing grub on the SCSI drive, and see if I can make it work now. Oops, how do I boot? I have 4 IDE drives, so no room for a CD. Well, no problem, I’ll plug in the CD in place of one of the hard drives. Quick boot later, I’m at the prompt for the Gentoo live CD kicking myself for forgetting that the live CD doesn’t include the Advansys driver! A bit hard to re-install grub on the scsi drive with no driver for the scsi controller…

<sigh> Okay, I’ll boot off the previous system drive (IDE) and install grub from that. Swap in the old IDE drive, boot, go into the BIOS and change to boot order so it boots from that drive. All the way into Gentoo, run the grub shell, “find /boot/grub/grub.conf”. Hmm… It’s on (hd3,0). That doesn’t seem right, it should be on (hd4,0). Oh well, install grub and shut down and remove hard drives and reboot. No go, grub can’t find (hd3,0). Of course, because (hd3) is the 4th IDE drive, and is currently unpartitioned. WTF? Re-configure with the old system drive and reboot. Back in the BIOS, I suddenly notice it’s only seeing 3 IDE drives. WTF? Oh, the new drives are all jumpered cable select. I bet the old system drive is jumpered master. Yep, it is, I’ll just change it to cable sele… WTF? The drive doesn’t have cable select?!?!?!? What kind of shoddy drive doesn’t even have cable select?

<sigh> Re-jumpering any of the new drives would be a pain, because they’re all screwed into the case. I know, I’ll use a CD drive, those slide out easily. No, wait. Grub doesn’t count CD drives when enumerating, so I’ll end up with (hd3) again rather than (hd4). Well, I have another drive lying here, I’ll jumper that slave and use it. Fast forward, I’m all booted up, install grub on (hd0) pointing at (hd4,0), shutdown, re-connect all the new drives, reboot, and I’m up! Yay!

Build the raid (really easy), check /proc/mdstat, and it’s running! Only 300 minutes until it’s coherent! (/me wonders why it takes to long to make an empty array coherent, but whatever). This morning, I make my filesystem and start copying from the old file server, and all is good. Phew!

So, now I’m RAIDed, and have a little more peace of mind. And, if you read this whole thing, you must be a glutton for punishment. :)

One Response to “RAID goodness”

  1. $ cat /proc/mdstat
    Personalities : [raid1] [raid5]
    md1 : active raid1 hdg2[2] hde2[1] hda2[0]
    987904 blocks [3/3] [UUU]

    md2 : active raid5 hdg3[2] hde3[1] hda3[0]
    388596096 blocks level 5, 64k chunk, algorithm 2 [3/3] [UUU]

    md0 : active raid1 hdg1[2] hde1[1] hda1[0]
    72192 blocks [3/3] [UUU]

    unused devices:

    md0 is /boot, md1 is /, md2 is an LVM2 PV:
    PV Name /dev/md2
    PV Size 370.59 GB / not usable 0

    3*200GB IDE disks, all on a separate IDE controller (main board got a HTP RAID controller, which I disabled so it behaves like a “normal” IDE controller)

    Pretty cool stuff to work with :-) And the software RAID is incredibly fast, without using the CPU too much, even on fairly high IO.

Discussion Area - Leave a Comment