The Linux efibootmgr command line utility is very handy when it comes to managing UEFI boot menu. This tutorial shows you how to use efibootmgr with 5 examples. It’s assumed that you have installed Linux in UEFI mode.
1 Display Current Settings
Simply run the following command. In some Linux distributions like Debian, you need to run it with
This command allows you to view the default boot entry (BootCurrent), boot order and all boot entries. Each boot entry is identified by a boot number in hex. The asterisk (*) means the boot entry is active.
You can also add
-v option to show verbose information.
You can see the EFI system partition number, the partition table type (GPT), UUID of the EFI system partition and the boot loader file.
The above screenshot shows that my EFI system partition (ESP) is on the 7th partition of my hard disk (/dev/sda7). It’s a GPT partition table.
2. Change Boot Order
First, use the
-o option with sudo.
sudo efibootmgr -o
then copy the current boot order
And append to the above command.
sudo efibootmgr -o 0013,0012,0014,0000,0001,0002,0003,000D,0011,0007,0008,0009,000A,000B,000C,000E
Let’s say you want 0012 to be the first boot entry. All you have to do is move it to the left of 0013 and press Enter.
sudo efibootmgr -o 0012,0013,0014,0000,0001,0002,0003,000D,0011,0007,0008,0009,000A,000B,000C,000E
3. Add Entry
Make sure your Linux distribution has Grub EFI version installed.
sudo apt install grub-efi
sudo dnf install grub2-efi-modules
Then mount the EFI system partition (ESP) under
/boot/ directory. In this example,
/dev/sda7 is the ESP.
sudo mount /dev/sda7 /boot/
Then install Grub boot loader to ESP.
sudo grub-install /dev/sda --target=x86_64-efi --efi-directory=/boot
x86_64-efi means we are installing for EFI firmware. Now, you should see a new entry in UEFI boot menu. Under the hood, the Grub installer first install a
.efi booloader file to
/boot/EFI/<label>/ directory. Usually it’s named grubx64.efi. Then it run the following command to add a new entry in UEFI boot menu.
efibootmgr -c -d /dev/sda -p 7 -L <label> -l \EFI\<lable>\grubx64.efi
Newly added entry will be the first in boot order.
4. Delete Boot Entry
Let’s say you have installed multiple Linux distributions on a hard disk so you have multiple boot entries just like the above screenshot. And now you deleted a Linux distro but the boot entry is still there. To remove the respective boot entry, run:
sudo efibootmgr -b <bootnum> -B
-b option specify the boot number.
-B option delete that boot number.
5. Set a Boot Entry Active or Inactive
A boot entry followed by asterisk indicates that it’s active. Otherwise it’s inactive. To set a boot entry active, run:
sudo efibootmgr -b <bootnum> -a
To set a boot entry inactive, run:
sudo efibootmgr -b <bootnum> -A
That’s it! I hope this tutorial is helped you master the Linux efibootmgr command. As always, if you found this post useful, then subscribe to our free newsletter or follow us on Google+, Twitter or like our Facebook page. Thanks for visiting!