Notes related to Extensible Firmware Interface (EFI). == Reboot into BIOS == {{{#!highlight sh numbers=off sudo systemctl reboot --firmware-setup }}} [[https://superuser.com/a/1083166/20815|Ref]] == Repair for Linux == To reinstall UEFI entries, check what's installed with `efibootmgr --verbose` which will list all boot entries, and the default. If the entry for the OS is missing (usually "debian" or "ubuntu"), the entry may need to be re-added. Rather than manipulating EFI variables, it's easiest to reinstall grub which ensures all files/etc are in the right place. If using a chroot to reinstall entries, first setup various bind mounts from outside the chroot into the chroot: {{{#!highlight sh CHROOT_ROOT=/mnt # mount --bind /dev/ $CHROOT_ROOT/dev # mount --bind /dev/pts $CHROOT_ROOT/dev/pts # OR mount --rbind /dev/ $CHROOT_ROOT/dev mount --bind /sys $CHROOT_ROOT/sys mount --bind /proc $CHROOT_ROOT/proc mount --rbind /run $CHROOT_ROOT/run modprobe efivarfs mount -o bind /sys/firmware/efi $CHROOT_ROOT/sys/firmware/efi }}} Also ensure the EFI partition is mounted at the correct location (e.g. usually `/boot/efi`). After entering the chroot, reinstall grub with: {{{#!bash grub-install --target=x86_64-efi --efi-directory=/boot/efi }}} Afterwards, double-check the boot entry shows up with `efibootmgr`. == efibootmgr == {{{#!bash # On a Debian system $ sudo efibootmgr --unicode BootCurrent: 0006 BootOrder: 0006,0004 Boot0000* Hard drive C: VenHw(d6c0639f-c705-4eb9-aa4f-5802d8823de6)� Boot0001* IBA XE Slot 0100 v2434 BBS(128,IBA XE Slot 0100 v2434,0x0)� Boot0004* Integrated NIC 1 Port 1 Partition 1 VenHw(3a191845-5f86-4e78-8fce-c4cff59f9daa) Boot0006* debian HD(1,GPT,d29fd1bb-05db-40a8-bedd-7e781d884cdc,0x800,0xf3800)/File(\EFI\debian\shimx64.efi) # On an Ubuntu system $ sudo efibootmgr --unicode BootCurrent: 0001 Timeout: 0 seconds BootOrder: 0001,2001,2002,2003 Boot0001* Kubuntu HD(1,GPT,9c2855d5-633e-4091-aa3c-40e172d0ecfc,0x1000,0x96000)/File(\EFI\kubuntu\shimx64.efi) Boot2001* EFI USB Device 䍒 Boot2002* EFI DVD/CDROM 䍒 Boot2003* EFI Network 䍒 OR Boot0006* ubuntu HD(1,GPT,2535f000-ca5e-42fa-b4fd-1a40e99a5ed5,0x1000,0x96000)/File(\EFI\ubuntu\shimx64.efi) # Delete unused boot entries $ efibootmgr --delete-bootnum --bootnum 0007 # Create new entry (preferably, use grub-install) $ efibootmgr --create --disk /dev/sda --part 1 --loader "\EFI\debian\shimx64.efi" --label "debian" }}} == Links == * [[https://maple52046.github.io/2017/11/03/Install-Ubuntu-in-UEFI-mode-with-debootstrap/|Install Ubuntu in UEFI mode with debootstrap]] ---- CategoryCheatSheet