[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Starting RAID on boot



James Thorpe writes:

Hi list,

I've configured two drives in a machine for RAID1, and once the machine is up and running I can

mdadm --assemble /dev/md0
mount /dev/md0 /mirror

No problems. My question is - how do I get it to do this automatically on boot? I've found references to /etc/init.d/mdadm, but that doesn't seem to exist on my install (FC9).

Although there are several ways to do this, I would suggest this approach:

* Add /dev/md0 to /etc/fstab.

* Run: mkinitrd /boot/initrd.new `uname -r`

* Reboot. At the grub prompt, edit the initrd command line, and replace your existing initrd image filename with initrd.new

* If you succesfully end up booting, with /dev/md0 getting mounted by default, replace your usual initrd image filename with initrd.new

This hinges on mkinitrd succesfully detecting that you're running RAID, and inserting the necessary startup voodoo into initrc.

Or, you can always edit /etc/rc.d/rc.local, and manually add your mdadm and mount commands. But that's a rather boring way to do it. The other way, you have to deal with the excitement of being one typo away from a temporarily-unbootable brick. That's much more fun, IMO.

Attachment: pgppTiR30rLUH.pgp
Description: PGP signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]