[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1001714: update 1



Hi Detlev,

On Thu, Dec 16, 2021 at 09:05:07AM +0100, detlev schmidtke wrote:
> I read in the Debian Wiki
> (https://wiki.debian.org/UEFI#RAID_for_the_EFI_System_Partition): 
> 
> "But for software RAID systems there is currently no support for
> putting the ESP on two separate disks in RAID."
> 
> I interpret that as "it cannot work", so, the Debian Installer should
> refuse to install EFI on a Software RAID with an appropriate message,
> instead of running into this error.

It's a bit more complicated than that.

By default, md uses version 1.2 superblock which lives near the start
of the device. Software with no concept of md RAID will read a
member device and see an MD superblock at the start instead of the
filesystem format they expect. So, this will not work and I would
tend to agree that the installer should not allow a device with such
a superblock to be used as an ESP.

Metadata versions 0.9 and 1.0 can instead be used; these have the
data near the end of the device. As a consequence, the beginning of
RAID-1 member devices are indistinguishable from the below
filesystem being directly on the device. This trick was used to get
grub to boot RAID-1 before it had support for md RAID: grub couldn't
tell that it wasn't just reading a normal filesystem.

An MD RAID-1 array with superblock version 0.9 or 1.0 will very
likely work as an ESP and many people do this. The installer should
probably not prohibit it.

This strategy can still fail. It relies upon nothing except the OS
itself writing to that member device. I have not seen it but some
people say that there are firmwares and bootloaders that will write
to the ESP. Since they would not be aware of md, they would change
one member device and not another. When you booted with such a setup
MD would complain and not assemble the array. You'd have to choose
which member device "won" and have the other overwrite it.

Due to that, some people instead have multiple ESPs and come up with
elaborate schemes to sync them in user space.

That was the state of things when I last asked on debian-user in
November 2020:

    https://lists.debian.org/debian-user/2020/11/msg00455.html

Here's a script I use to sync ESPs:

    https://gist.github.com/grifferz/f262591f59e4f8c199a8b0619bc6a667

But again, I don't think it's a good idea to ban ESP on MD array as
this is a working configuration for many.

Cheers,
Andy


Reply to: