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.
it can be solved by mounting the EFI partition from a Windows system.
- Mount the efi parition using
diskpart
using elevated Command Promptlist disk
"Look for the disk, usually 0select disk 0
list partition
Look for a "Primary parition"select partition 6
partition 6 in my case, but usually 0assign 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
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)