GRUB2 does not appear after BIOS update under windows

Hi all, a strange thing happenened with my Lenovo laptop.

I have Windows10 and Fedora 37 in dual boot, all working fine for months in both systems. Recently, Lenovo VANTAGE software proposed a BIOS update of the machine. I was in Windows10 at the time, and allowed the update. It downloaded, rebooted, updated the BIOS version and rebooted again.

However, it booted straight into Windows, bypassing the GRUB interface.

So I checked the BIOS settings wondeing if the boot order misaligned, but no, there were the two options: NVME disk, Windows Boot Manager. NVME disk was the first one.

Then I decided to boot into fedora installation via a live usb using Super Grub2 Disk. I selected the fedora boot item, and it booted into GRUB2! From there I could select the Fedora version or Windows Boot Manager. I selected Fedora and it booted fine.

From there, I tried to use the official documentation to remove and reinstall grub2, creating a new grub2 config. It worked fine, but it did not solve my problem. GRUB2 was still not appearing. Then I tried to use efibootmgr but it fact it did not find the Fedora OS. the -c flag byitself did not work, it said can’t find boot entry…

Then I find some examples on the web of a more complete efibootmgr command, like:

$ sudo efibootmgr --create --disk=/dev/sda --part=1 --label="fedora" --loader='EFI\fedora\shimx64.efi'

found in this article, but I am unsure of how to use it and IF i have to use it. From what I understand it will create a boot option in the BIOS menu.

Anyway, my GRUB2 config seems correct as it detectes all the systems, Windows included, however it does not appear. The Fedora Documentation said that reinstalling grub should trigger the efibootmgr to do its thing but it is not working.

If you are lucky, you just need to change the boot order. The article you referred to also addresses this.

I had a similar problem several times with an old Sony Vaio laptop after applying some heavy Windows 10 updates. It was just updates, not a Windows install or reinstall. I also had the same problem with a new Lenovo Legion also with Windows 10.

In both cases I managed to recover the Grub loader from Windows without needing to reinstall Grub or booting from an USB. I used the bcdedit Windows command executed in a Windows DOS box with administrator privilege.

The first thing to do is to list the items in the EFI partition with the following command:

    bcdedit /enum all /v

If one of the listed entries is similar to the next one then the Grub2 entry is still in the EFI partition and it is possible to reactivate it:

        Identifier              {adc6d0cf-b4f8-11eb-bb14-806e6f6e6963}
        device                  partition=\Device\HarddiskVolume4
        path                    \EFI\fedora\shimx64.efi
        description             Fedora

In the Vaio laptop then the two following commands recover the previous state

  bcdedit /set {bootmgr} path \EFI\fedora\shimx64.efi
  bcdedit /set {bootmgr} description Fedora

This worked in the VAIO but it didn’t work in the Lenovo Legion. However the following command made the trick:

  bcdedit /displayorder {adc6d0cf-b4f8-11eb-bb14-806e6f6e6963} /addfirst

Maybe a similar solution may help you.

@vekruse I tried that but the boot order did not help. The fedora boot option disappeared after BIOS update.

@karkon I tried bcdedit and it did not help as I could not find the Fedora boot option.

Eventually the answer was indeed in the article I stated, but I was overwhelmed by tons of options that efibootmgr has.

The soluzion was to write:

$ sudo efibootmgr --create --disk=/dev/nvme0n1p1 --part=1 --label="fedora" --loader='EFI\fedora\shimx64.efi'

I did that within my fedora system I entered thanks to SuperGrub live iso. But it can be done also chrooting using a fedora live-usb.


UPDATE: sometimes efibootmgr is not able to create a boot entry. It happened that another BIOS update broke dual-booting, hence I had to proceed as described in the first post.

However, the command $ sudo efibootmgr --create --disk=/dev/nvme0n1p1 --part=1 --label="fedora" --loader='EFI\fedora\shimx64.efi'
returned a stuck terminal, like frozen, it does not complete, I only see:

So i created the boot entry from within Windows using : bcdedit /set {bootmgr} path \EFI\fedora\shimx64.efi in Windows.

The option to --disk should be the disk unit name, thus /dev/nvme0n1.

Ok I will try later, is it the same if it is a brtfs volume or a lvm ?

UEFI doesn’t care about that These volumes lives in the partitions of the disk unit, and UEFI just need to know which disk unit to look at and which partition on that disk unit contains the ESP (aka efi file system).

1 Like

Thank you! Indeed now the command succeded and also the strange characters on boot are no longer present.