Starting RAID on boot

Sam Varshavchik mrsam at courier-mta.com
Sat Jun 21 22:02:43 UTC 2008


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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20080621/c2efbdd9/attachment-0001.sig>


More information about the fedora-list mailing list