You are not logged in.

#1 2024-06-04 02:04:08

finnblue8
Member
Registered: 2022-01-30
Posts: 24

EFISTUB UEFI entries being deleted upon reboot

Hi all:

I have a Lenovo G50-45 laptop that I use as a home server.

About a week ago I rebooted after updating and found the machine unable to boot from my EFISTUB entry. Booting an ISO and running the efibootmgr command with my kernel parameters to re-install the entry, then reboot fixes the problem every time - but it seems to come back every couple days. This behavior seems to coincide with updates to the kernel if I recall right, but I'm not convinced the kernel is the problem here.

This machine only runs Arch and has no other boot entries in it except EFISTUB for Arch and the on-board network boot/USB boot (if enabled). I've been using the same EFISTUB entry for a year and have rebooted hundreds of times without fail.

What's puzzling to me about this is that using efibootmgr to re-write the boot entry to the NVRAM fixes the issue even after powering off and pulling the AC adapter. I suspected the CMOS battery might be going bad, but UEFI is still keeping time and date correctly, and the newly-written UEFI entry survives total loss of power, which I wouldn't expect if the CMOS battery were having problems keeping NVRAM alive. Maybe it still is going bad, just at a slow rate? Hopefully not because changing the CMOS on this thing is a royal pain.

I don't have any problems at all once the initramfs is loaded. The machine can run unattended practically indefinitely unless I issue "sudo reboot" - after that somehow my boot entry is gone, repeatedly and independently after multiple cycles of updates and reboots.

Never experienced behavior like this. I've ran fsck on all partitions on this disk already to no avail.

Does anyone know what might be causing this besides a bad CMOS battery?

Thanks!

Offline

#2 2024-06-04 13:14:34

Crunchbang
Member
From: Script headers everywhere
Registered: 2024-04-25
Posts: 22

Re: EFISTUB UEFI entries being deleted upon reboot

Could be caused by a buggy EFI.   I use EFIStub on my laptop but i can only reliably set 1 EFI Menu entry.   if I set any further entries they are usually wiped out after the  next reboot.   The main entry has never went away but as a precaution I have refind installed and  set as secondary to the EFI stub

Last edited by Crunchbang (2024-06-04 13:23:07)

Offline

#3 2024-08-20 22:48:44

finnblue8
Member
Registered: 2022-01-30
Posts: 24

Re: EFISTUB UEFI entries being deleted upon reboot

Bumping this because this issue is still happening with this particular machine nearly two months later, and it's really starting to annoy me. I can't update the kernel without having a bootable USB handy to re-add the EFISTUB UEFI entry. I have three Arch machines, and this behavior only happens on this Lenovo laptop.

I've done some troubleshooting since OP - it only happens when there's a kernel update. After doing updates to non-kernel packages I'm able to reboot from command line without incident like I should be able to.

The reason reboot ends up failing is because after a kernel update UEFI attempts to boot a newly-added UEFI entry (that I never manually added) with the name of my hard disk but that doesn't contain any of my kernel parameters or paths to /root and /home. See below:

sudo efibootmgr
[sudo] password for user: 
BootCurrent: 0004
Timeout: 0 seconds
BootOrder: 0004,0000,2003,2001,2002
Boot0000* EFI HDD Device (Samsung SSD 870 QVO 1TB)	PciRoot(0x0)/Pci(0x11,0x0)/Ata(0,0,0)/HD(2,GPT,f1801feb-43ca-4e8b-8e74-0290007f6a6e,0x800,0x82000)RC
Boot0002* EFI Network 0 for IPv4 (68-F7-28-60-C2-6C) 	PciRoot(0x0)/Pci(0x2,0x4)/Pci(0x0,0x0)/MAC(68f72860c26c,0)/IPv4(0.0.0.0,0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)RC
Boot0003* EFI Network 0 for IPv6 (68-F7-28-60-C2-6C) 	PciRoot(0x0)/Pci(0x2,0x4)/Pci(0x0,0x0)/MAC(68f72860c26c,0)/IPv6([::],0,Static,[::],[::],64)RC
Boot0004* ArchLinux	HD(2,GPT,f1801feb-43ca-4e8b-8e74-0290007f6a6e,0x800,0x82000)/\vmlinuz-linux72006f006f0074003d002f006400650076002f007300640061003100200072007700200069006e0069007400720064003d005c0061006d0064002d00750063006f00640065002e0069006d006700200069006e0069007400720064003d0069006e0069007400720061006d00660073002d006c0069006e00750078002e0069006d00670020006c006f0067006c006500760065006c003d00330020007100750069006500740020006e006f007700610074006300680064006f00670020006c0073006d003d00610070007000610072006d006f0072002c006c0061006e0064006c006f0063006b002c006c006f0063006b0064006f0077006e002c00790061006d0061002c00620070006600
Boot2001* EFI USB Device	RC
Boot2002* EFI DVD/CDROM	RC
Boot2003* EFI Network	RC

In this example Boot0004 is my proper EFISTUB entry. After a kernel update Boot0002 is getting added erroneously and switches the boot order such that the new entry is first. Since it contains no filesystem paths, that entry immediately fails to boot.

It'd be a big help if anyone that knows how to stop this second entry getting added would be able to tell me how to do so.

Offline

#4 2024-08-21 05:58:12

Head_on_a_Stick
Member
From: Belsize Park
Registered: 2014-02-20
Posts: 8,245
Website

Re: EFISTUB UEFI entries being deleted upon reboot

Can you disable network booting from the firmware ("BIOS") menus?

Otherwise perhaps try the removable loader location at /EFI/Boot/bootx64.efi on the ESP, which should be booted if there are no specific NVRAM boot entries. EDIT: use a UKI or other bootloader for that (or compile your own kernel with CONFIG_CMDLINE set for your hardware).

Last edited by Head_on_a_Stick (2024-08-21 07:02:10)


"The nation-state domesticates the society in the name of capitalism and alienates the community from its natural foundations."
Democratic Confederalism, Abdullah Öcalan.

Offline

Board footer

Powered by FluxBB