2

Linux mdraid supports device RAID (as opposed to partition RAID). The new superblock versions are also smart enough to not put the meta data right at the start of a disk. Does that mean it's possible to install grub2 on the MBR and boot whole-device RAID6 using GRUB2?

And if it is possible, what distro installers allow you to do this? When you install Debian or Ubuntu, you are not offered this option. I know you can do it by hand, but an out-of-the-box solution would be better.

migrated from serverfault.com Jul 15 '13 at 7:33

This question came from our site for system and network administrators.

1

I have never tried it myself, but I think there would be some restrictions, even if Grub2 did support RAID-6 (does it?).

For Grub2 to work at all, it needs to load (at the very least) the core.img which is usually 30K in size. However, there is only 4K available with a full disk mdadm setup (using 1.2 metadata). Thus there is no space to embed the core.img.

What Grub2 attempts to do in this case is map it directly to the drive where the core.img is physically located in the filesystem. In theory this could be done even in a RAID-6 as the core.img should be located somewhere in whole (unless your chunk size is smaller than 32K, anyway). That way Grub2 would be able to load it and boot as well, however, only as long as the disk does not fail, as there is no redundancy yet at this stage.

With RAID you usually want the box to keep working (and keep booting) even when a disk fails, so this is not a satisfying solution.

So if you want it to be reliable, at the very least you'd have to partition the disks to leave enough free space for embedding the core.img. Personally I'm old-fashioned and create a small partition on each disk for a /boot in RAID-1 mode (using 0.90 or 1.0 metadata so even non-raid-aware bootloaders can read from it). It lets the box boot at least into a minimalistic initramfs environment even if the RAID degrades for whatever reason.

  • That makes sense. The thing is, I found out I had accidentally setup a server to load it's kernel from a logical volume on RAID1. I made a /boot RAID1 for booting, but I never mounted it. Without me knowing it, GRUB2 just loaded the kernel off my rootfs in RAID1(metadata 1.2)+LVM. That made me think if I could perhaps do <asked question> – Halfgaar Jul 15 '13 at 9:49
1

This appears to be not trivial. GRUB 2 is said to be able to do it, but older versions have trouble with degraded arrays, and it is unclear which versions of the Debian package fix it. The upstream bug says they assume it is fixed, but the Debian bug is not as promising.

That’s why I’d recommend sticking to a RAID-1 for /boot for now, which is what I will be doing in a minute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.