I recently loaded the setup defaults on my ThinkPad after trying to diagnose a
boot problem and this cleared the UEFI boot entries leaving me unable to boot
my installed OS. In this article, I’ll show you how to recreate a new boot
You’ll need a live OS to boot from that has
efibootmgr. You might be able to
use the Debian netinst rescue mode, but I would recommend the full
live install images. I used Tails, a Debian-based live OS focused on
privacy, because it’s what I had on hand. If you do use Tails, make to
enable the administration password at the Tails Greeter.
Whatever you choose, boot into it and get yourself to a root prompt.
Identify the device name for your system partition. In my case, my EFI System
sda1, which is always a FAT filesystem and is usually the first
partition on a disk.
root@amnesia:~# lsblk -o NAME,FSTYPE,MODEL,SIZE
I recommend mounting the EFI system partition to check you have the right disk and also to verify the path to the UEFI binary we’ll need next. Unmount when you’re done.
root@amnesia:~# mount /dev/sda1 /mnt
Now that you’ve identified the correct disk, use
efibootmgr to create a new
--disk is the disk of the system partition, not the partition
--part is the partition number, starting at 1.
--loader is the
path to the UEFI binary. You will need to use
shimx64.efi instead of
grubx64.efi if you’re using SecureBoot. You must use
backslashes as the path separator.
root@amnesia:~# efibootmgr --verbose --create --disk /dev/sda --part 1 --loader "\efi\debian\grubx64.efi" --label "Debian"
Assuming everything went OK,
efibootmgr will list all the entries (which I
trimmed here) and your new one should be at the bottom. Confirm everything
looks correct and reboot. Fingers crossed!