Skip to content

Instantly share code, notes, and snippets.

@JohnRTitor
Last active March 30, 2024 07:01
Show Gist options
  • Save JohnRTitor/69862ccedb4ec4c1525f06d801bfa7df to your computer and use it in GitHub Desktop.
Save JohnRTitor/69862ccedb4ec4c1525f06d801bfa7df to your computer and use it in GitHub Desktop.
Linux Boot entry missing after BIOS update

Sometimes after BIOS updates, Linux boot entry can be missing from Boot menu. This happens with BIOS updates auto clearing secure boot keys and EFI variables.

If using Ubuntu where Grub is used

it can be solved by mounting the EFI partition from a Windows system.

  • Mount the efi parition using diskpart using elevated Command Prompt
    • list disk "Look for the disk, usually 0
    • select disk 0
    • list partition Look for a "Primary parition"
    • select partition 6 partition 6 in my case, but usually 0
    • assign letter=x can be any letter except A, B, C, D, or already used ones
  • Then cd to X and run bcdedit /set '{bootmgr}' path X:\EFI\ubuntu\bootx64.efi

If using NixOS:

the above method won't work, flash a Nix ISO on a USB instead

  • Boot into the ISO
  • Run sudo mkdir /boot
  • Mount the existing EFI partition using sudo mount /dev/nvme0n1p6 /boot (partition 6 in this case)
  • Run bootctl install. it reinstalls systemd-boot and configures the EFI variables automatically

NOTE: SecureBoot is recommended to disable for this procedure. After getting it working properly, you can configure SecureBoot again.

efibootmgr tool from a linux ISO can be used as well to manually configure EFI vars. (Does not work all the time)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment