RAID, EFI and grub-install

Help with issues regarding installation of Debian

RAID, EFI and grub-install

Postby Thomas_M » 2018-12-21 08:45

Hi everyone,

Here is my configuration :
- 1 EFI-only motherboard;
- 4 disks with each 1 EFI System partition and 1 RAID partition;
- The 4 RAID partitions are part of a RAID10 array where / is mounted.

And here is how I handle grub-install:
- I comment /boot/efi in fstab;
- Then, for each of the 4 EFI system partitions, I manually mount it on /boot/EFI, run grub-install, unmount it, and so on;
- Finally, for each of the first 3 EFI system partitions, I create an EFI entry with efibootmgr (the last EFI partition is handled by the last execution of grub-install).

My question is as follows: Is there a better way to do this ? Maybe some syntax in some configuration file to specify that grub-efi should be installed on multiple disks ?

Thanks!
Regards,
Thomas M.
Thomas_M
 
Posts: 3
Joined: 2018-12-21 08:33

Re: RAID, EFI and grub-install

Postby p.H » 2018-12-21 12:08

AFAIK there is no configuration file to handle this. I have tried to use RAID 1 on EFI partitions, with superblocks 1.0 at the end of the partitions so that the UEFI firmware can read them. But IIRC grub-install (or was it efibootmgr ?) does not like when /boot/efi is a RAID array instead of a plain partition.

However you can avoid the hassle of mounting and unmounting EFI partitions and running efibootmgr. Instead you can permanently mount the EFI partitions on /boot/efi{,1,2,3} and, for each extra invocation of grub-install,
- specify the EFI partition with --efi-directory=/boot/efi${n}
- specify the EFI boot entry label with --bootloader-id=altboot${n}

You can also ask to install a copy of GRUB in the removable media path (which does not require an EFI boot entry) with --force-extra-removable
p.H
 
Posts: 709
Joined: 2017-09-17 07:12

Re: RAID, EFI and grub-install

Postby Thomas_M » 2018-12-21 14:56

You can also ask to install a copy of GRUB in the removable media path (which does not require an EFI boot entry) with --force-extra-removable

Thanks for the tip, I did not know that! However, the idea behind multiple EFI partitions is having (at least) the same level of redundancy for the boot phase as well. You lose this with GRUB on a removable media.

AFAIK there is no configuration file to handle this

Well, that's too bad :-) It's weird though that neither grub nor any Linux distribution have thought of a way to handle this. IMHO, that would be a legit usage and a banal feature for many users.

I have tried to use RAID 1 on EFI partitions, with superblocks 1.0 at the end of the partitions so that the UEFI firmware can read them

I thought of that but it does not seem very safe: if for some reason one of the EFI partition is modified outside the context of the RAID1 array (by the EFI ?), it will be handled by the kernel as if it were corrupted. I don't know what might happen in this situation.

However you can avoid the hassle of mounting and unmounting EFI partitions and running efibootmgr. Instead you can permanently mount the EFI partitions on /boot/efi{,1,2,3} and, for each extra invocation of grub-install,
- specify the EFI partition with --efi-directory=/boot/efi${n}
- specify the EFI boot entry label with --bootloader-id=altboot${n}

Indeed, that seems to be much more practical! I will do that from now on, thanks for the idea!

Regards,
Thomas M.
Thomas_M
 
Posts: 3
Joined: 2018-12-21 08:33

Re: RAID, EFI and grub-install

Postby p.H » 2018-12-21 15:07

Thomas_M wrote:the idea behind multiple EFI partitions is having (at least) the same level of redundancy for the boot phase as well. You lose this with GRUB on a removable media.

The "removable media path" can be present on any EFI partition, not only on removable media. It is used by a UEFI firmware to find a fallback bootloader.

Thomas_M wrote: It's weird though that neither grub nor any Linux distribution have thought of a way to handle this.

It is not a GRUB nor Linux thing, it is a UEFI thing. UEFI does not handle boot redundancy.
p.H
 
Posts: 709
Joined: 2017-09-17 07:12

Re: RAID, EFI and grub-install

Postby Thomas_M » 2018-12-21 15:19

The "removable media path" can be present on any EFI partition, not only on removable media. It is used by a UEFI firmware to find a fallback bootloader.

Mmmmh... I cant' see any drawback with that. I'll give it a try, thanks!

It is not a GRUB nor Linux thing, it is a UEFI thing. UEFI does not handle boot redundancy.

True, but with no improvement in sight on that subject, both of them could choose to take matters into their own hands.
Your solution for example (/boot/efi${n}), just add a script that supersedes grub-install and execute the later for each EFI partition with the arguments you mentioned, and it may work just fine (or maybe the script needs to be a bit more complex in order to handle cases I haven't thought about but in the end, it will work).

Anyway, I'm getting lost in my own digression :-). Thanks again for your help!

Regards,
Thomas M.
Thomas_M
 
Posts: 3
Joined: 2018-12-21 08:33


Return to Installation

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable