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

Re: Support for mirroring of EFI System Partition

On Sat, Sep 05, 2015 at 07:11:44PM +0200, Francesco Poli wrote:
>Hello Debian EFI support developers,
>I would like to install Debian testing on a box with two identical
>drives in software RAID1 (mirroring) and I was planning the partition
>While doing so, I realized that this new box has UEFI (instead of BIOS)
>on the motherboard, and hence needs an ESP (EFI System Partition) in
>order to host the GRUB bootloader (correct?).


>I searched the web about how to set up ESP partitions on two separate
>drives in order to be able to boot from any of them, in case one breaks,
>and I found scarce and inconsistent information...   :-(
>With the old BIOS-based machines, one would simply install GRUB on the
>MBR of one drive and then
>  # dpkg-reconfigure grub-pc
>and select both /dev/sda and /dev/sdb as install devices.


>With the new UEFI-based machines, it seems to me that this possibility
>is not (well) supported. I read on the Debian Wiki [1] that there's
>"no support for putting the ESP on two separate disks in RAID" !

Correct. The ESP is much more complicated than an MBR and boot sector
like old-style BIOS boot. It needs to be a FAT filesystem and the
firmware needs to understand how to mount and use it. Most UEFI
implementors will expect you to be either using a single disk here, or
a firmware-supported hardware RAID device. I'm not aware of any that
might understand Linux's software RAID options for this, and would be
very surprised if any did! You *might* be able to get something
working using the fake/BIOS RAID type setups, but I've no experience
of ever getting any of those to work well under Linux. :-/

>On the other hand, another Debian Wiki page [2] states that you can
>dpkg-reconfigure grub-efi-amd64 on EFI systems and select GRUB install
>devices. However, I don't see any debconf templates for grub-efi-amd64
>in the grub2 source package debian/ directory [3]: does this mean that
>grub-efi-amd64 does not support asking the user to select install

Correct. It will always install to the ESP that you've configured, and
only one ESP is supported.

>I found a number of places [4] on the web where it is suggested to
>manually clone the ESP from one drive to the other with:
>  # dd if=/dev/sda1 of=/dev/sdb1
>But this should be repeated whenever anything changes on the ESP and I
>will sure forget doing so one day or another. There should be a trigger
>from the relevant packages (grub-efi-amd64, I suppose, and maybe other
>ones) that keeps the "slave" ESPs up-to-date w.r.t. to the "master"
>one: is there such a trigger?

It won't work *yet* - on top of this, we'll also need to add support
in various places to add more than one Boot entry, pointing at
both/all N copies of the ESP. Assuming competent firmware (hah!) this
should then work OK. This is what I referred to in


which you've already read. We'd then add code in grub/elsewhere to
manage multiple copies of the ESP as different independent FAT

>So, my question is: what's the recommended way to set up a RAID1 on a
>UEFI system and make sure the system will still boot, when any of the
>drives breaks?

For actual RAID1, I'd *try* a BIOS-RAID type setup if your hardware
does it for now. Otherwise, you could try and get the multi-ESP route
working. Patches welcome if you can make it work; I'm hoping to work
on this as a feature for Stretch, but I've not found any time to start
on it yet.

Hope this helps!

Steve McIntyre, Cambridge, UK.                                steve@einval.com
Can't keep my eyes from the circling sky,
Tongue-tied & twisted, Just an earth-bound misfit, I...

Reply to: