2

I'd like to put a EFI system partition on top of a MD RAID 1 + LVM setup. So the ESP would be a Logical Volume on top of the MD RAID device. I've heard mixed things about whether this is possible. Has anyone done it? And if so, what issues were there, if any?

The plan is to have a standard Debian stretch install. GRUB 2 and no other operating systems other than Debian. And possibly only the one installation.

This has been asked on AU: Can the EFI system partition be RAIDed?. But the responses were mixed and unclear.

One important aspect of this that is unclear to me is - what software needs to read the ESP? I thought it was GRUB. But some discussion I've read seems to suggest this is not the case - that the motherboard's firmware needs to read the ESP as well. I suppose that makes sense. The MB firmware would need to be able to read something on the disk, presumably GRUB initialization information, in order to get the boot process started.

But it seems that this works for some people in some cases, and not in others. So is one to conclude that some motherboards have firmware that can read data on an LVM volume on top of MD RAID?

3
  • "What software needs to read the ESP? I thought it was GRUB." How do you think GRUB itself is loaded into memory? The firmware, be it UEFI or the good old BIOS, is the only thing running from memory when the machine is powered on. Jun 19, 2017 at 8:07
  • @JohanMyréen Yes, read the rest of that paragraph. I realise that it sounds a little confused. Jun 19, 2017 at 8:52
  • I tend to stay clear of RAID for boot partitions. Sep 9, 2018 at 11:06

1 Answer 1

3

The question you linked to has an accepted answer, and I think it holds good advice.

You can do RAID1 with metadata at the end of the drive (--metadata=1.0 in mdadm), that way it would look to a normal filesystem to anything that is not aware of RAID.

However, that is for strict read-only access only. Writing to only one side of a RAID you'll get random results from the RAID layer (depending which drive it picks to read data from) and thus, consistency issues.

Might work for booting as that is usually read only.

With LVM, things get a lot more complicated. LVM has metadata at the start, any filesystems are at an offset chosen by LVM. The only way to make this work is with hacks — like, create a partition table that maps out a single LV in LVM space — or inversely create a device mapping which in turn serves as a PV for LVM, thus forcibly moving LVM metadata to the end of the drive after all.

So, with some creativity and effort, you could do a full drive RAID, full drive LVM and yet have a regular partition table appear to the non-RAID-LVM-aware. It's possible. But you'll end up with such a convoluted setup, way off standard, and the big question is, what's the point of it all?

For a software based RAID, it's quite normal for the RAID to not cover the partition table, bootloaders, and stuff. You can achieve the same effect by simply installing the boot loader to every drive.

2
  • It seems this does work for some people, in some circumstances. So what is going on there? See my expansion of the question. Jun 18, 2017 at 14:43
  • Oh, and to be clear, I'm not interested in going through gyrations with LVM/MD in order to get this to work. I'm just interested in whether this will work with a normal, vanilla LVM + MDRAID setup. Jun 18, 2017 at 14:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .