Grub entry disappear from BIOS after updates

Hi all,
I’ve a problem with my tumbleweed installation. I’ve installed it on my second ssd with a separate uefi partition from windows (as I’ve done multiple times with other Linux distro), but after installing I’d to manually create the boot entry for grub and everytime grub or the kernel get’s updated the entry get deleted and I’ve to create it manually again. It doesn’t seems normal to me. It is possible to fix it?

Right at the top of “grub.cfg” there is a line:

# DO NOT EDIT THIS FILE

If you want to customize “grub.cfg”, then use one of the files in “/etc/grub.d”. Normally you would use “40_custom” or “41_custom” for this. I put my changes in “40_custom”.

Whenever the system regenerates “grub.cfg” in automatically incorporates my changes.

41_custom just adds conde to include file custom.cfg from /boot/grub2 during boot. You do not “put your changes” into 41_custom, you create file /boot/grub2/custom.cfg.

1 Like

And, if you wish your custom.cfg stanzas to precede those you see at boot menu that Grub has auto-generated, you copy the content of 41_custom to some file that sorts before 10_linux and after 05*. Mine are 07_custom. For a cleaner, more svelte resulting grub.cfg, you also empty 41_custom to keep your custom.cfg entries from being duplicated at both ends of the menu. If you simply delete 41_custom, it will reappear when grub2 is updated or reinstalled.

@nrickert @arvidjaar @mrmazda probably I’ve explained myself incorrectly; I’m not trying to customize grub entries, after grub updates and also after first install when rebooting the system start directly in windows. If I enter in the bios the boot menu only shows windows bootloader and I’ve to add grub manually. Now, this has to be a problem with the opensuse installation because on arch, fedora, etc it doesn’t happens. In those OSes the entry in the bios is automatically created on install and doesn’t disappear after update.

Any help?

So your topic title should have been something like
Grub entry disappears from BIOS after updates.

I don’t see a way to change the title tho

Did it for you.

1 Like

It’s hard to guess with so little information.

I’m assuming this is using UEFI booting. The only thing in openSUSE that I can think of, is the “Update NVRAM entry” option. By default, that is checked. But if you unchecked it, then the BIOS would not know about your openSUSE install.

There are some older UEFI systems where the BIOS deletes NVRAM entries. But if this is a Windows 11 system, I assume that’s not the issue.

I’ve seen this before. Once you’re booted to tumbleweed.
Open Yast2-boot loader then run it and save it. Just be sure that all that you want to be is ok then reboot and see if it stays.
That fixed it for me before.

Sadly doesn’t work, now every time I reboot i get sent straight into Windows and the openSUSE bios entry disappear.

How exactly have you been “manually creat[ing] the boot entry for grub”?

Things to try:

1-Does TW boot if you disconnect the Windows disk?

2-Switch to using the Windows disk’s ESP for TW.

I went into the bios boot section and added a manual entry which point at grub.efi in the tumbleweed disk.

Disconnecting the windows disk is impractical because is a laptop, I would prefer to not do that if possible. As for using windows ESP for tumbleweed I would also prefer not because windows updates tend to ■■■■ it up.

I don’t understand why only on TW doesn’t work tho, is always grub2 and I don’t think openSUSE modify it in any way.

It seems to me this is rather uncommon among UEFI users. If and when Windows changes the priority, it’s simple enough to fix. Certainly your currently experienced behavior is unwelcome.

I suggest using efibootmgr to create your new entry instead of from within the BIOS itself, and show us lsblk -f input/output, plus before and after input/output from efibootmgr -v.

It may be your BIOS is defective WRT creating entries within it directly. Is a BIOS update available?

BootCurrent: 0002
Timeout: 2 seconds
BootOrder: 0002,0001
Boot0000* openSUSE	HD(1,GPT,86521b65-59cb-452d-9d97-63f107e0d8ec,0x800,0x100000)/File(\EFI\opensuse\grubx64.efi)
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 65 1b 52 86 cb 59 2d 45 9d 97 63 f1 07 e0 d8 ec 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
Boot0001* Windows Boot Manager	HD(1,GPT,57031fe8-d145-4175-a56c-ccef6826764a,0x800,0xfa000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)57494e444f5753000100000088000000780000004200430044004f0042004a004500430054003d007b00390064006500610038003600320063002d0035006300640064002d0034006500370030002d0061006300630031002d006600330032006200330034003400640034003700390035007d0000006f000100000010000000040000007fff0400
      dp: 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 a0 0f 00 00 00 00 00 e8 1f 03 57 45 d1 75 41 a5 6c cc ef 68 26 76 4a 02 02 / 04 04 46 00 5c 00 45 00 46 00 49 00 5c 00 4d 00 69 00 63 00 72 00 6f 00 73 00 6f 00 66 00 74 00 5c 00 42 00 6f 00 6f 00 74 00 5c 00 62 00 6f 00 6f 00 74 00 6d 00 67 00 66 00 77 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00
    data: 57 49 4e 44 4f 57 53 00 01 00 00 00 88 00 00 00 78 00 00 00 42 00 43 00 44 00 4f 00 42 00 4a 00 45 00 43 00 54 00 3d 00 7b 00 39 00 64 00 65 00 61 00 38 00 36 00 32 00 63 00 2d 00 35 00 63 00 64 00 64 00 2d 00 34 00 65 00 37 00 30 00 2d 00 61 00 63 00 63 00 31 00 2d 00 66 00 33 00 32 00 62 00 33 00 34 00 34 00 64 00 34 00 37 00 39 00 35 00 7d 00 00 00 6f 00 01 00 00 00 10 00 00 00 04 00 00 00 7f ff 04 00
Boot0002* openSUSE	PciRoot(0x0)/Pci(0x17,0x0)/Sata(1,65535,0)/HD(1,GPT,86521b65-59cb-452d-9d97-63f107e0d8ec,0x800,0x100000)/File(\EFI\opensuse\grubx64.efi)
      dp: 02 01 0c 00 d0 41 03 0a 00 00 00 00 / 01 01 06 00 00 17 / 03 12 0a 00 01 00 ff ff 00 00 / 04 01 2a 00 01 00 00 00 00 08 00 00 00 00 00 00 00 00 10 00 00 00 00 00 65 1b 52 86 cb 59 2d 45 9d 97 63 f1 07 e0 d8 ec 02 02 / 04 04 38 00 5c 00 45 00 46 00 49 00 5c 00 6f 00 70 00 65 00 6e 00 73 00 75 00 73 00 65 00 5c 00 67 00 72 00 75 00 62 00 78 00 36 00 34 00 2e 00 65 00 66 00 69 00 00 00 / 7f ff 04 00

actual state, entry 000 is the one I’ve created with efibootmgr, entry 002 is the one created from bios because on reboot it send me directly on windows (and when accessed bios only windows entry where there)

before rebooting only 000 and 001 existed and 000 (openSUSE) was the one that had priority.

There is a bios update but it will disable undervolting and that’s not an option for me.

Not reading for comprehension, but there was a recent bug report on TW’s grub handling characteristics, where partitions were shuffled around and so forth, and there are some fixes posted there to try to get grub back online . . . .

https://bugzilla.suse.com/show_bug.cgi?id=1216070

Just a thought, and I may be off base. On my system, openSUSE boots from grub installed on the Linux drive. Windows boots from the Windows bootloader installed on the Windows drive (I use a non-Bitlocker drive encryption). I have my bios set to default to Windows for boot (to disguise the Linux installation)and use F8 during POST to choose what to boot from. Quite often, my Asus motherboard gets a mind of it’s own and boots directly to the Linux drive. I’m guessing this is caused by which drive initializes first. Is your system set up with only grub as the bootloader for both operating systems?

If I understood correctly what you are saying yes, I can boot also windows from grub, but I’ve the same setup as you with every OS has is own uefi partition with it’s bootloader in it.
Basically every time something touches grub, it being a system update with grub in it or I regenerate the cfg from yast I lose the BIOS entry for grub and only the one with windows remains.
I noticed that this happens also when firstly installing opensuse. After the installation is complete I get reboot straight into windows and I’ve to manually create the grub entry into the BIOS

I do not boot Windows from grub. I deselect the “probe foreign OS” under the bootloader options tab in Yast2-bootloader. I physically use a BIOS hotkey to select the boot device. My efibootmgr -v shows a Windows section, but it is not included within the grub2 for efi boot menu. My default boot device is Windows so that any unauthorized person booting my computer will be taken to the Windows disc encryption screen and not even be aware of an installed Linux system. Security paranoia on my part I suppose.

Just to verify settings, I’ll post my settings from Yast2 bootloader:
Under boot code options tab: Grub2 for EFI (not grub2), Secure boot support is checked. Trusted boot is NOT checked. Update NVRAM entry is checked. Protective MBR flag is “do not change”.
The Kernel parameter tab has only default entries.
Under the Bootloader options tab: Default Boot Section: openSUSE Tumbleweed.

If your settings match, mrmazda may be correct and this may be a BIOS bug. If you truly can’t upgrade BIOS because of the removal of an undervolt option, the other less desireable option would be to give up on UEFI for Tumbleweed and use the compatibility support of BIOS to boot Tumbleweed as non-UEFI, or legacy boot. That would mean using grub2 rather than grub2 for EFI. Out of curiosity, does your BIOS have a hotkey for selecting the boot device during POST? If you use it, does the opensuse option that you did not create show up and can you boot from it?

Sorry for.the very delayed answer. Yes I’ve an hotkey to choose from where to boot and no, the entry I didn’t create doesn’t show there neither. The real problem with bios update is also that if I upgrade and still doesn’t works I’ll be stuck without undervolt but also without the possibility to downgrade bios again because the update remove that possibility too. (Which sucks). I would really prefer to not use compatibility mode also. There is something else that could be tried? I’m willing to format everything again without any problem