Bug#962506: grub: grub-install puts wrong partition to `load.cfg`

Paul Menzel pmenzel at molgen.mpg.de
Mon Jun 8 23:52:13 BST 2020


Dear Debian folks,


Am 09.06.20 um 00:40 schrieb Paul Menzel:
> Package: grub-efi
> Version: 2.04-8
> Severity: normal

> The x86 Dell system with UEFI firmware has the partitions below, where 
> the first one is the ESP (and /boot), and the second one is encrypted 
> with LUKS.
> 
>      $ lsblk -o NAME,UUID,LABEL,PTTYPE
>      NAME                UUID                                 LABEL PTTYPE
>      nvme0n1                                                        gpt
>      ├─nvme0n1p1         D34D-47A3                            ESP   gpt
>      └─nvme0n1p2         b88be798-13e3-4884-9748-bf7a23f0ae87       gpt
>        └─nvme0n1p2_crypt c9342a55-b747-4442-b2f4-bc03eb7a51cf
> 
> With Debian Sid/unstable, the wrong partition UUID is put into `load.cfg`.
> 
>      $ sudo grub-install -v
>      […]
>      grub-install: info: grub-mkimage --directory 
> '/usr/lib/grub/x86_64-efi' --prefix '/boot/grub' --output 
> '/boot/grub/x86_64-efi/core.efi'  --dtb '' --format 'x86_64-efi' 
> --compression 'auto'  --config '/boot/grub/x86_64-efi/load.cfg' 'ext2' 
> 'search_fs_uuid'
>      […]
>      $ more /boot/grub/x86_64-efi/load.cfg
>      search.fs_uuid c9342a55-b747-4442-b2f4-bc03eb7a51cf root
>      set prefix=($root)'/boot/grub'
> 
> GRUB then says, it can’t find c9342a55-b747-4442-b2f4-bc03eb7a51cf
>   and drops into rescue mode. For whatever reason, the partitions are 
> not detected, and GRUB only sees `(hd0)`. Of course, no modules can be 
> loaded, and I am unable to check what modules are loaded.a
> 
> `grub-install --boot-directory=/boot --efi-directory /boot/efi` doesn’t 
> make a difference either.

     $ sudo strings /boot/efi/EFI/debian/grubx64.efi | grep gpt
     $ sudo strings /boot/efi/EFI/debian/grubx64.efi | grep -C 3 c93
     .module_license
     .bss
     .modname
     search.fs_uuid c9342a55-b747-4442-b2f4-bc03eb7a51cf root
     set prefix=($root)'/boot/grub'
     /boot/grub

> Interestingly, starting a live system, like Grml (daily), chroot’ing 
> into the system `/mnt` (with `/dev/nvme0n1p1` mounted under 
> `/mnt/boot/`), running `grub-install --efi-directory /boot/efi` creates 
> a working image.

     $ sudo strings /boot/efi/EFI/debian-backup/grubx64.efi | grep gpt
     partmap/gpt.c
     part_gpt
     grub_gpt_partition_map_iterate
     (,gpt1)/grub

> Please find the verbose output attached.

That was for the non-working case with the installed Debian Sid/unstable.


Kind regards,

Paul



More information about the Pkg-grub-devel mailing list