Discussion:
[gentoo-user] After Update grub does not work anymore
(too old to reply)
Alexander Puchmayr
2024-03-29 11:00:01 UTC
Permalink
Hi,

After upgrading two Lenovo Laptops (UEFI, secure boot disabled), grub does not
work anymore; instead it says "Welcome to Grub" ... And then immediately boots
into bios setup.

What did go wrong?
I did the usual things:
* emerge update world
* emerge --config gentoo-kernel
* grub-mkconfig -o /boot/grub/grub.cfg

Everything went fine without errors, but then the final reboot, only bios setup.
And these steps do not alter the efi boot loaders

Any ideas? How to get out of this?

Alex
hitachi303
2024-03-29 11:00:01 UTC
Permalink
Post by Alexander Puchmayr
Hi,
After upgrading two Lenovo Laptops (UEFI, secure boot disabled), grub does not
work anymore; instead it says "Welcome to Grub" ... And then immediately boots
into bios setup.
What did go wrong?
* emerge update world
* emerge --config gentoo-kernel
* grub-mkconfig -o /boot/grub/grub.cfg
Everything went fine without errors, but then the final reboot, only bios setup.
And these steps do not alter the efi boot loaders
Any ideas? How to get out of this?
Alex
Hi,

die you follow the announcement about grub? eselect news read

2024-02-01-grub-upgrades
Title GRUB upgrades
Author Mike Gilbert <***@gentoo.org>
Posted 2024-02-01
Revision 2

When booting with GRUB, it is important that the core image and modules
have matching versions. Usually, running grub-install is sufficient to
ensure this.

On the UEFI platform, grub-install allows the core image to be placed in
two different locations:

EFI/gentoo/grubx64.efi
This is the location used by grub-install without options.

EFI/BOOT/BOOTX64.EFI
This is the location used by grub-install --removable.

On upgrades, it is common for users to mismatch the grub-install options
they used for the current and previous versions of grub. This will cause
a stale core image to exist. For example:

/boot/efi/EFI/BOOT/BOOTX64.EFI (grub 2.06 core image)
/boot/efi/EFI/gentoo/grubx64.efi (grub 2.12 core image)
/boot/grub/x86_64-efi/*.mod (grub 2.12 modules)

Booting this system using BOOTX64.EFI image would likely fail due to a
symbol mismatch between the core image and modules. [1]

Re-runing grub-install both with and without the --removable option
should ensure a working GRUB installation.

However, this will clobber any BOOTX64.EFI image provided by other
loaders. If dual-booting using another boot loader, users must take care
not to replace BOOTX64.EFI if it is not provided by GRUB.

References:
[1] https://bugs.gentoo.org/920708
Alexander Puchmayr
2024-03-30 13:30:01 UTC
Permalink
Thanks for the hints. Indeed, I didn't read the news regarding grub.
Booting from a rescue system and running grub-install followed by a grub-
mkconfig solved the problem.

Although I do not fully understand why this happend. AFIAK, installing/
updating grub does not update files in /boot nor /boot/efi. And grub-mkconfig
only updates /boot/grub/grub.cfg. And the other files from the grub package are
inside an encrypted system disk, which grub cannot access without getting the
pass phrase. So, why do the EFI files suddenly stop working without having been
changed?

Thanks
Alex
Post by hitachi303
Post by Alexander Puchmayr
Hi,
After upgrading two Lenovo Laptops (UEFI, secure boot disabled), grub does
not work anymore; instead it says "Welcome to Grub" ... And then
immediately boots into bios setup.
What did go wrong?
* emerge update world
* emerge --config gentoo-kernel
* grub-mkconfig -o /boot/grub/grub.cfg
Everything went fine without errors, but then the final reboot, only bios
setup. And these steps do not alter the efi boot loaders
Any ideas? How to get out of this?
Alex
Hi,
die you follow the announcement about grub? eselect news read
2024-02-01-grub-upgrades
Title GRUB upgrades
Posted 2024-02-01
Revision 2
When booting with GRUB, it is important that the core image and modules
have matching versions. Usually, running grub-install is sufficient to
ensure this.
On the UEFI platform, grub-install allows the core image to be placed in
EFI/gentoo/grubx64.efi
This is the location used by grub-install without options.
EFI/BOOT/BOOTX64.EFI
This is the location used by grub-install --removable.
On upgrades, it is common for users to mismatch the grub-install options
they used for the current and previous versions of grub. This will cause
/boot/efi/EFI/BOOT/BOOTX64.EFI (grub 2.06 core image)
/boot/efi/EFI/gentoo/grubx64.efi (grub 2.12 core image)
/boot/grub/x86_64-efi/*.mod (grub 2.12 modules)
Booting this system using BOOTX64.EFI image would likely fail due to a
symbol mismatch between the core image and modules. [1]
Re-runing grub-install both with and without the --removable option
should ensure a working GRUB installation.
However, this will clobber any BOOTX64.EFI image provided by other
loaders. If dual-booting using another boot loader, users must take care
not to replace BOOTX64.EFI if it is not provided by GRUB.
[1] https://bugs.gentoo.org/920708
hitachi303
2024-03-29 11:10:01 UTC
Permalink
Post by Alexander Puchmayr
Hi,
After upgrading two Lenovo Laptops (UEFI, secure boot disabled), grub does not
work anymore; instead it says "Welcome to Grub" ... And then immediately boots
into bios setup.
What did go wrong?
* emerge update world
* emerge --config gentoo-kernel
* grub-mkconfig -o /boot/grub/grub.cfg
Everything went fine without errors, but then the final reboot, only bios setup.
And these steps do not alter the efi boot loaders
Any ideas? How to get out of this?
Alex
Hi again,

to get out of this booting a live usb or CD and chroot will most likely
be your best way to fix this. The installation handbook explains how to
chroot. Then you can start fixing the problem.

Regards
Daniel Frey
2024-03-29 17:40:01 UTC
Permalink
Post by Alexander Puchmayr
Hi,
After upgrading two Lenovo Laptops (UEFI, secure boot disabled), grub does not
work anymore; instead it says "Welcome to Grub" ... And then immediately boots
into bios setup.
What did go wrong?
* emerge update world
* emerge --config gentoo-kernel
* grub-mkconfig -o /boot/grub/grub.cfg
Everything went fine without errors, but then the final reboot, only bios setup.
And these steps do not alter the efi boot loaders
Any ideas? How to get out of this?
Alex
You'll have to boot off of a rescue disk and chroot in to fix this problem.

I had this exact problem yesterday. I hadn't upgraded grub in quite some
time and I forgot that particular machine will not boot using:

EFI/gentoo/grubx64.efi

...it silently fails to boot and removes the boot entry (efibootmgr
confirmed this.)

What happened is I forgot to run two grub install commands (I only ran
the first one):

grub-install --efi-directory=/efi
grub-install --efi-directory=/efi --removeable

This created a conundrum as only

EFI/gentoo/grubx64.efi

was updated, which my BIOS refuses to boot from.

After I chroot'ed in, I ran both commands so that both

EFI/gentoo/grubx64.efi AND
EFI/BOOT/BOOTX64.EFI

were updated to the new versions. After that my system booted normally.

(I rebooted from ssh only to have the machine not come up, when I hooked
up the monitor it said something about something missing.)

Dan
Loading...