Bug#1051271: GRUB2 2.12~rc1-7 prevent machine to boot

Agustin Martin agmartin at debian.org
Tue Sep 5 22:31:27 BST 2023


> On Tue, Sep 05, 2023 at 07:34:13PM +0200, Julian Andres Klode wrote:
> I wrote
> > If /boot/efi is not mounted I get for new versions
>
> Well that's *your problem*, sorry. Mounting /boot/efi is mandatory,
> you can't just go unmount it. By the same argument unmounting /boot
> (if a separate partition) yields an unbootable system too (eventually
> once /boot on / becomes out of sync with actual boot partition grub
> uses).

Hi, Julian, thanks for your reply.

It was my understanding that grub-install did know how to find and use
the efi partition if not mounted, seems I was wrong. But for some
reason this problem did not show up in previous version, see below.

El mar, 5 sept 2023 a las 21:40, Julian Andres Klode
(<julian.klode at canonical.com>) escribió:
> I wrote
> > $ LC_ALL=C sudo dpkg-reconfigure grub-efi-amd64
> > Installing for x86_64-efi platform.
> > grub-install: error: cannot find EFI directory.
> > Failed: grub-install --target=x86_64-efi --force-extra-removable
> > WARNING: Bootloader is not properly installed, system may not be bootable
> > Generating grub configuration file ...
> >
> > (same without --force-extra-removable). No such error with previous version.
>
> Also, that's not true. grub-install for EFI of course always
> requires /boot/efi present, always has and always will*
>
> * on Ubuntu we mount to /var/lib/grub/esp if /boot/efi is not
>   mounted (or you have multiple ESPs configured), but the script
>   isn't in Debian yet, it's a bit hacky and duplicates lots of postinst
>   sightly different :(

I am rechecking 2.06-13 in a different efi box that was installed as
efi from the beginning (previous one was not). Although /boot/efi is
not mounted, error in grub-efi-amd64 configuration does not happen
(this does not mean that installation is fully OK, just that error
does not happen and grub is bootable). I do not remember to have
changed /etc/fstab to set noauto instead of defaults in that entry,
but this happened some years ago and sincerely, cannot be sure.

$ dpkg -l 'grub*' | grep ^i
ii  grub-common           2.06-13      amd64        GRand Unified
Bootloader (common files)
ii  grub-efi-amd64        2.06-13      amd64        GRand Unified
Bootloader, version 2 (EFI-AMD64 version)
ii  grub-efi-amd64-bin    2.06-13      amd64        GRand Unified
Bootloader, version 2 (EFI-AMD64 modules)
ii  grub-efi-amd64-signed 1+2.06+13    amd64        GRand Unified
Bootloader, version 2 (amd64 UEFI signed by Debian)
ii  grub2-common          2.06-13      amd64        GRand Unified
Bootloader (common files for version 2)

$ grep /boot/efi /etc/fstab
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=5451-8D5D  /boot/efi       vfat    umask=0077,noauto      0       1

$ mount | grep -i efi
efivarfs on /sys/firmware/efi/efivars type efivarfs
(rw,nosuid,nodev,noexec,relatime)

$ LC_ALL=C sudo apt-get install --reinstall grub-efi-amd64
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/45.7 kB of archives.
After this operation, 0 B of additional disk space will be used.
Preconfiguring packages ...
(Reading database ... 546089 files and directories currently installed.)
Preparing to unpack .../grub-efi-amd64_2.06-13_amd64.deb ...
Unpacking grub-efi-amd64 (2.06-13) over (2.06-13) ...
Setting up grub-efi-amd64 (2.06-13) ...
Generating grub configuration file ...
Found background image: .background_cache.png
Found linux image: /boot/vmlinuz-6.3.0-1-amd64
Found initrd image: /boot/initrd.img-6.3.0-1-amd64
Found linux image: /boot/vmlinuz-6.1.0-9-amd64
Found initrd image: /boot/initrd.img-6.1.0-9-amd64
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create
new boot entries.
Found Windows Boot Manager on /dev/nvme0n1p1@/efi/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings ...
done
Processing triggers for shim-signed:amd64 (1.39+15.7-1) ...

Regards,

-- 
Agustin



More information about the Pkg-grub-devel mailing list