Bug#925591: UEFI ESP RAID 1 support for grub

Marco d'Itri md at Linux.IT
Wed Oct 9 14:18:23 BST 2019


Control: unarchive -1
Control: reopen -1

On Jun 10, Debian Bug Tracking System <owner at bugs.debian.org> wrote:

> I'm afraid what you've found is *not* a Grub bug at all. It's a
> limitation of EFI boot. Your firmware does not understand how to
> interpret Linux software RAID, so you cannot use a software RAID setup
> for the EFI System Partition (ESP). This is a known limitation, and
> there isn't any way to fix this at the moment. Sorry. :-(
This is not correct, you just need to take care of using a RAID metadata 
format positioned at the end of the partition:

root at fw-15b:~# sfdisk --dump /dev/sda | grep sda1
/dev/sda1 : start=        2048, size=      997376, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=0714EA61-70F2-431C-9249-8809B0AF0C59, name="ESP"
root at fw-15b:~# sfdisk --dump /dev/sdb | grep sdb1
/dev/sdb1 : start=        2048, size=      997376, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=7D1CC6C6-9962-6946-A640-2D843D34914F, name="ESP"
root at fw-15b:~# grep -A1 sda1 /proc/mdstat
md126 : active raid1 sdb1[1] sda1[0]
      498624 blocks super 1.0 [2/2] [UU]
root at fw-15b:~# file -s /dev/md126
/dev/md126: DOS/MBR boot sector, code offset 0x58+2, OEM-ID "mkfs.fat", sectors/cluster 8, Media descriptor 0xf8, sectors/track 4, sectors 997248 (volumes > 32 MB), FAT (32 bit), sectors/FAT 976, reserved 0x1, serial number 0x5acecdb2, unlabeled
root at fw-15b:~# efibootmgr -v | grep -i Debian
Boot0016* Debian sda	HD(1,GPT,0714ea61-70f2-431c-9249-8809b0af0c59,0x800,0xf3800)/File(\EFI\debian\grubx64.efi)
Boot0017* Debian sdb	HD(1,GPT,7d1cc6c6-9962-6946-a640-2d843d34914f,0x800,0xf3800)/File(\EFI\debian\grubx64.efi)

BIOS Information
        Vendor: HPE
        Version: U43
        Release Date: 04/04/2019

I have manually created the EFI boot entries and it works fine:

for i in b a; do efibootmgr -c -d /dev/sd$i -p 1 -L "Debian sd$i" -l \\EFI\\debian\\grubx64.efi; done

grub should be able to figure out that sda1 here is a totally normal ESP 
partition:

root at fw-15b:~#  LANG=C grub-install /dev/sda
Installing for x86_64-efi platform.
grub-install: warning: efivarfs_get_variable: open(/sys/firmware/efi/efivars/blk0-47c7b225-c42a-11d2-8e57-00a0c969723b): No such file or directory.
grub-install: warning: efi_get_variable: ops->get_variable failed: No such file or directory.
grub-install: warning: efi_va_generate_file_device_path_from_esp: could not open device for ESP: Bad address.
grub-install: warning: efi_generate_file_device_path_from_esp: could not generate File DP from ESP: Bad address.
grub-install: error: failed to register the EFI boot entry: Bad address.
[Exit 1]
root at fw-15b:~# 

-- 
ciao,
Marco
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-grub-devel/attachments/20191009/b3175274/attachment.sig>


More information about the Pkg-grub-devel mailing list