Installing grub on md raid boot device 2


Linux software raid or md raid can be used as a boot device. But only if that raid device is a RAID-1 or mirror.
As boot loader, grub in this case, does not know anything about software raid that is managed by kernel, it needs to be installed on both devices on that software mirror.

grub --no-floppy

Select disk and partition where Your /boot resides.
Countdown starts from zero, so /dev/sda3, if it is Your first drive, becomes hd(0,2)

root (hd0,2)
Filesystem type is ext2fs, partition type 0xfd

install grub into boot sector of that hard drive
setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/
grub/menu.lst"... succeeded
Done.

repeat that on the other hard drive, which is probably (hd1)

root (hd1,2)
setup (hd1)

and exit grub
quit

if You do not know which device is which, look at
/boot/grub/device.map
and edit it if needed.

The editing bit goes specially for cciss driver.


Leave a comment

Your email address will not be published. Required fields are marked *

2 thoughts on “Installing grub on md raid boot device

  • myself

    Doesn’t work on GPT/ software RAID. GPT doesn’t have boot flag/ 0xfd at the same time. Only 0xfe00 means system-bootable partition, and 0xfd00 means software raid partition. Can’t be both at the same time. Can’t install software raid 1 AND grub at the same time. I guess what I’m saying is, what about now? How do we do this on modern operating systems with hard drives made this decade? What now, huh?

    • owl Post author

      It does work actually. Grub does not have to know that it boots from software raid 1 device. All You have to do is to make a software mirror device and install grub on both disks in that configuration. This works only on raid 1 setups as far as I know. All talk is about linux mdraid of course. Controller assisted software raid is different. IMHO mdraid is faster / more manageable anyway.