How to correctly install GRUB on a soft RAID 1?
If the two disks are /dev/sda
and /dev/sdb
, run both grub-install /dev/sda
and grub-install /dev/sdb
. Then both drives will be able to boot alone.
Make sure that your Grub configuration doesn't hard-code disks like (hd0)
, but instead searches for the boot and root filesystems' UUIDs.
I'm not aware of support in Grub to declare two disks as being in a RAID-1 array so that grub-install
would automatically write to both. This means you'll need to run grub-install
again if you replace one disk; it's one more thing to do in addition to adding new members to the RAID arrays.
I've done this on quite a few servers over the past while and found issues sometimes, usually what I do is run the following
sudo grub-install /dev/sdb
sudo update-grub /dev/sdb
The problems I've run into are usually displayed with error messages like
update-grub … update-grub failed with no such disk …
To resolve this i've run
sudo mv /boot/grub/device.map /boot/grub/device.map.old
sudo update-grub
and this seems to have resolved the issue - as a test in some cases I have removed /sdv/sda
and just used /dev/sdb
to boot from but this is not ideal and most likely not possible in most production environments!