Linux – Getting Grub2 to recognize a Raid 10 boot/root

grubgrub2linuxmdadmsoftware-raid

I've been trying to get my raid to boot from grub2 for about 2 days now and I don't seem to be getting closer. The problem appears to be that it doesn't recognize my raid at all. It doesn't see (md0) etc. I'm not sure Why or how to change this. I'm using mdadm, 2 device (essentially a raid1) raid10,f2, which is currently degraded.

I have tried adding the raid and mdraid modules with grub install along with others. I've tried several variation on grub-install such as grub-install --debug --no-floppy --modules="biosdisk part_msdos chain raid mdraid ext2 linux search ata normal" /dev/md0

I've been searching the net for an answer to what I haven't done but no luck. On my other drive which I plan on removing the raid is initialized and mounted fine on boot, but it's not the boot/root for that setup. My grub.cfg isn't recognized by grub since it can't read the raid partition so I'm not posting that. md0 is not listed in my /boot/grub/device.map.

Best Answer

Don't forget GRUB2 is still in a development stage, so if you want to use it... it is at your own risk.

Given the above, I think you'd be best advised to get the latest source and compile to see if that fixes any issues you may be seeing. You should be using version 1.9.6 at least, as the docs say, and make sue your raid is built using the v0.90 mdadm metadata superblock.

For example, to create a "-l 10" RAID1 device for the /boot file system, with "-n 4" disks and "-x 0" spares:

mdadm --create -e 0.90 -n 4 -x 0 -l 1 /dev/md2 /dev/sda2 /dev/sdb2 [/dev/sdc2 /dev/sdd2 ...]

And in testing with mdadm v3.2.3, grub 1.99-21ubuntu3, only the boot file system needed metadata 0.90, not the root. And raid10 didn't work after a disk was removed, so example is raid1 above. (another question related to raid10 here)