Use Linux efibootmgr Command to Manage UEFI Boot Menu

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.

You can install the efibootmgr command line utility with the following commands.

Debian/Ubuntu/Linux Mint

sudo apt install efibootmgr

Fedora, CentOS, RedHat

sudo dnf install efibootmgr

SuSE

sudo zypper install efibootmgr

Arch Linux/Manjaro

sudo pacman -S efibootmgr

1 Displaying Current Settings

Simply run the following command. In some Linux distributions like Debian, you need to run it with sudo privilege.

efibootmgr

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 hexadecimal. The asterisk (*) means the boot entry is active.

linux efibootmgr

You can also add -v option to show verbose information.

efibootmgr -v

You can see the EFI system partition number, the partition table type (GPT), UUID of the EFI system partition and the boot loader file.

efibootmgr-show-verbose-information

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. Changing Boot Order

First, copy the current boot order. For example, my boot order is:

0013,0012,0014,0000,0001,0002,0003,000D,0011,0007,0008,0009,000A,000B,000C,000E

Then type in the following command

sudo efibootmgr -o

And append the boot order 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. Adding Boot Entry

If you have installed multiple Linux distributions on your computer, but one of the Linux distribution doesn’t have a UEFI boot entry, you can manually add it.

Boot into the Linux distro that doesn’t have UFEI boot entry.  Then make sure it has the EFI version of GRUB boot loader installed.

Debian/Ubuntu/Linux Mint

sudo apt install grub-efi

Fedora

sudo dnf install grub2-efi-modules

Then mount the EFI system partition (ESP) under /boot/efi/ directory. In this example, /dev/sda7 is the ESP.

sudo mount /dev/sda7 /boot/efi/

Then install Grub boot loader to ESP.

sudo grub-install /dev/sda --target=x86_64-efi --efi-directory=/boot/efi/

x86_64-efi means that we are going to install Grub for UEFI firmware. The default target is i386-pc, which is for traditional BIOS firmware.

Now, you should see a new entry in UEFI boot menu with the bootmgr command.  Under the hood, the Grub installer first installs a .efi booloader file to /boot/efi/EFI/<label>/ directory. Usually it’s named grubx64.efi. Then it runs the following command to add a new entry in UEFI boot menu.

efibootmgr -c -d /dev/sda -p 7 -L <label> -l \EFI\<label>\grubx64.efi

Newly added entry will be the first in boot order.

4. Deleteing 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

For example,

sudo efibootmgr -b 0014 -B

-b option specify the boot number. -B option delete that boot number.

5. Setting 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

On my other computer, Linux Mint always hides the GRUB boot menu no matter what I try. Sometimes I need to use another Linux distro such as Fedora. So I disable the Linux Mint boot entry from the UEFI boot menu. Now it uses the Fedora boot menu, which doesn’t hide Grub boot menu.

However, when you upgrade Linux Mint to a new release, the Linux Mint boot entry will be restored in the system upgrade procedure.

I can set up a systemd service file to automatically disable Linux Mint boot entry.

sudo nano /etc/systemd/system/disable-boot-entry.service

Add the following line in this file.

[Unit]
  Description=disable Linux Mint Boot Entry
  After=multi-user.target

[Service]
  Type=oneshot
  ExecStart=/bin/bash -c '/usr/bin/efibootmgr -b 0008 -A'

[Install]
  WantedBy=multi-user.target

Save and close the file. Then enable this servcie.

sudo systemctl enable disable-boot-entry.service

For more information on how to use systemd, please read the following article.

Wrapping Up

I hope this tutorial is helped you master the Linux efibootmgr command. Ever wondered if you can boot an ISO file without creating a live USB or live CD? Please read the following tutorial:

As always, if you found this post useful, then subscribe to our free newsletter or follow us on Twitter or like our Facebook page. Thanks for visiting!

Rate this tutorial
[Total: 58 Average: 4.3]

53 Responses to “Use Linux efibootmgr Command to Manage UEFI Boot Menu

  • Thom Mayor
    6 years ago

    I have used been using grub2 for several years now, but until recently only on MBR partitioned drives. I installed 5 linux distros on a VirtualBox VM all with UEFI on GPT partitioned drive and didn’t have too much trouble. One thing is I can’t get the EFI to boot to the grub menu directly, it always boots to the EFI shell first no matter what I try.

  • Douglas
    5 years ago

    Could you help me? I was trying to get delete an obsolete input from Ubuntu on bios through efibootmgr. I ended up deleting the bios / uefi setup from my samsung laptop and I can not recover it. I typed the command sudo efibootmgr -b 0 -B … (0 being the setup) .. any suggestions?

  • In section 4, “Delete Boot Entry,” I need some clarification. Does the -b # option refer to boot order numbering OR the ordinal numbering BELOW the boot order?

    So using your example above, if I want to delete:

    Boot0003 Lenovo Diagnostics

    The boot order # is 7, but it’s ordinal # is 3. Would I do:

    efibootmgr -b 7 -B (boot order)

    OR

    efibootmgr -b 3 -B (ordinal)

    • Xiao Guo An (Admin)
      5 years ago

      The boot number is a 4 digit hexadecimal number. In your case, you need to run

      sudo efibootmgr -b 0003 -B
  • Thanks for the reply, Xiao. My case is not so straightforward.

    efibootmgr -v output (without the extra drive info):

    BootOrder: 0007,0009,0001,000A,0000,0005
    Boot0000* Windows Boot Manager
    Boot0001* ubuntu
    Boot0005 Windows Boot Manager
    Boot0007* ubuntu
    Boot0009* ubuntu
    Boot000A* Windows Boot Manager

    And the one I want to delete is Boot000A. I’ve tried:
    efibootmgr -b 000A -B
    and
    efibootmgr -b 0006 -B
    but neither worked. Can you advise, please?

    • Xiao Guo An (Admin)
      5 years ago

      That’s odd.

      • How does one add the boot entry for Windows into grub for Arch based EFI. Currently grub has Windows entry but cannot find.

        • Xiao Guo An (Admin)
          5 years ago

          You need to update the Grub menu from your Linux OS. On Debian/Ubuntu/Linux Mint, run the following command.

          sudo update-grub

          On Arch Linux, run

          sudo grub-mkconfig -o /boot/grub/grub.cfg
      • Hi. I tried efibootmgr -B -b 0006 and it worked out flawlessly. First parameter is to delete; second refers to binary entry.

  • Dieter Pfeuffer
    4 years ago

    To 3. Adding Boot Entry:
    You have to specify the backslashes twice (to mask the backslash):
    efibootmgr -c -d /dev/sda -p 7 -L

    • Dieter Pfeuffer
      4 years ago

      correction (now quoted):

      efibootmgr -c -d /dev/sda -p 7 -L 
      • Dieter Pfeuffer
        4 years ago

        sorry, third try:

        efibootmgr -c -d /dev/sda -p 7 -L \
        • Dieter Pfeuffer
          4 years ago

          I give it up, to post the entire line correctly as a comment here. The commands above are not displayed as I wrote it, regardless my escaping tries.
          Just be aware, that you specify the backslashes twice (to mask the backslashes) when you type the the path after option -l for the efibootmgr command.

        • Morvan
          4 years ago

          Try it via Encode!

  • Hello there, just to let you know, there is a small typo in the instructions for adding an entry:

     efibootmgr -c -d /dev/sda -p 7 -L 

    it should be

  • Very nice article! I had debian installed on a atom board with 32bit efi, cloned the installation to a board with 64bit efi and used this guide – nice. Worked a flaw!

  • Lord_Sarcastic
    4 years ago

    You have no idea how you saved my life…

  • ALEXSANDER MARTINI
    4 years ago

    Thanks a lot, save my life!

  • Kewl ToyZ
    4 years ago

    I’m really having a peculiar issue with mine.
    The output of efibootmgr doesn’t match what I see in the grub version I boot from?

    BootOrder: 0002,0001,0000,0003,0011,0004,0012,0006,0009,000A
    Boot0000* Windows Boot Manager HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\Microsoft\Boot\bootmgfw.efi)WINDOWS………x…B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}…,…………….
    Boot0001* ubuntu HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\ubuntu\shimx64.efi)
    Boot0002* Nitrux HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\Nitrux\shimx64.efi)
    Boot0003* neon HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\neon\shimx64.efi)
    Boot0004* antiX19 HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\antiX19\grubx64.efi)
    Boot0006 Generic Usb Device VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
    Boot0009 CD/DVD Device VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
    Boot000A UEFI OS VenHw(99e275e7-75a0-4b37-a2e6-c5385e6c00cb)
    Boot0011* UEFI OS HD(7,GPT,33250818-c513-4c22-8b31-ff030d6403d1,0x11926800,0x47000)/File(\EFI\BOOT\BOOTX64.EFI)
    Boot0012* ubuntu HD(2,GPT,f5b046e2-4afa-48fd-b099-4b72a63b00d8,0x109000,0x32000)/File(\EFI\Ubuntu\grubx64.efi)

    I over wrote the neon partition with Zorin and Nitrux no longer displays in Grub?
    I’m curious how I edit the names of the OS on the partitions too?

    • Xiao Guoan (Admin)
      4 years ago

      You can update Grub menu with:

      sudo update-grub
  • Hi got a question. After deleting boot entries i shoud update grup right? But what if i use systemd-boot ? Which command should i use? bootctl update ?
    Thank you.

  • Hey there,
    I deleted an entry from boot option by the instruction, but after reboot the option CAME BACK!
    It seems that the extra option belongs to the previous install of the distro.

    please help me remove the option from boot menu.
    thanks.

    • Bumped into the same issue. I had to also remove the relevant folder to keep the EFI entry to come back. See https://askubuntu.com/questions/1042031/how-do-i-remove-windows-from-the-uefi-boot-menu-after-custom-installing-ubuntu/1042032#1042032

  • Hi,
    The efibootmgr showed multiple entries of an OS in my bootorder that I had stopped using. I deleted those, but they occupied the initial string of items in the list. Now, I want to renumber the remaining entries which are Grub (0009), Ubuntu (0008), and MacOs (0080) How can I renumber the bootorder?

  • JonhJack
    3 years ago

    Hi, Lets say my boot entries look like below:

    efibootmgr -v
    BootCurrent: 0001
    Timeout: 1 seconds
    BootOrder: 0001,0002
    Boot0001* UEFI OS HD(1,GPT,dd09316a-c79c-4f0d-9ce3-aa67462b9f24,0x800,0x9000)/File(\EFI\BOOT\BOOTX64.EFI)..BO
    Boot0002* UEFI: Generic Flash Disk 2.00 PciRoot(0x0)/Pci(0x15,0x0)/USB(1,0)..BO

    Now I adding new entry: efibootmgr -c -d /dev/sda -p 1 -L GRUB-CUSTOM -l /EFI/GRUB/bootx64.efi
    What if I lose power during invoke above command before data will be stored in non-volatile memory ? EFI check integrity of each variable and just this new one will be ignore ?

  • Why is efibootmgr show a drive that is no longer in my system? Boot0005* was a SSD drive that died

    user1@computer1:~$ efibootmgr -v
    ** Warning ** : Boot000a is not UEFI Spec compliant (lowercase hex in name)
    ** Warning ** : Boot000f is not UEFI Spec compliant (lowercase hex in name)
    ** Warning ** : please recreate these using efibootmgr to remove this warning.
    Timeout: 1 seconds
    BootOrder: 0000,0005,0009,000A,000F,0010
    Boot0000* ubuntu HD(1,GPT,f4e0fff5-e2ce-4375-b72e-884ce37cce29,0x800,0x100000)/File(\EFI\ubuntu\shimx64.efi)
    Boot0005* Hard Drive BBS(HD,,0x0)P0: OWC Mercury EXTREME Pro 6G.
    Boot0009* UEFI: SanDisk SDSS PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,65535,0)/HD(1,GPT,f4e0fff5-e2ce-4375-b72e-884ce37cce29,0x800,0x100000)/File(\EFI\BOOT\BOOTX64.EFI)
    Boot000a* CD/DVD Drive BBS(CDROM,,0x0)P3: TSSTcorp CDDVDW SH-S203B .
    Boot000f* UEFI: SanDisk PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/USB(2,0)/HD(3,GPT,273e49c9-e85a-43f4-a86e-47af010d77fb,0xf43,0x7a120)/File(\EFI\BOOT\BOOTX64.EFI)
    Boot0010* UEFI: SanDisk PciRoot(0x0)/Pci(0x1c,0x3)/Pci(0x0,0x0)/USB(2,0)/HD(4,GPT,f38a9e1b-5e2b-48ed-a057-c54fb572f254,0x7b063,0x3de640)/HD(1,MBR,0x6d94e5e7,0x270,0x1f00)/File(\EFI\BOOT\BOOTX64.EFI)

  • RedGreen
    3 years ago

    Worked great for helping with the re-install of grub and getting rid of the junk entries in my boot listings. When going to boot the non-default entry with a F12 boot menu choice, it is nice and tiny now, only real entries left :). Thanks for the posting.

  • Hi, this is my question;

    What happens when I stop the UEFI OS?
    Can i still enter the “BIOS” environment with F2?

    Even when there are no other systems installed?

  • Marv Woolard
    3 years ago

    I installed opensuse in a partition (p4) of a system with fedora. Opensuse created a separate boot partition. Both in fedora and suse, os-prober finds the other os but now only suse is on the boot menu. Only interrupting boot with F12 allows boot to fedora. In opensuse /boot/loader/entries file doesn’t exist. Would manually editing from within suse allow adding the fedora boot entry?

  • I no longer mess with EFI, this was something cooked up by Microsoft to make dual booting Windows with Linux not an option. I run straight up Linux, if I ever “need” windows, I have it on a separate drive here in my desk drawer. The original 500 GB drive is in there collecting dust, since I replaced it with a Samsung 2 TB SSD last year. Not that Linux needs all that wiggle room but I bought the drive for a good price.

    Thumb drives are so large now, you can pick up 256 GB for less than $40. I have often thought about cloning the old Windows OS to a stick as USB 3.0 is pretty fast now. I honestly don’t know what one would use MS Windows for beyond gaming. It is my opinion, EFI drives people away from dual booting, and straight into Linux’s open arms.

    You did an excellent write up on this subject Xiao Guoan.

    • Xiao Guoan (Admin)
      3 years ago

      In my experience, UEFI makes dual-booting Windows and Linux a lot easier and more flexible! Secure boot is the problem Microsoft created for Linux users. You can use UEFI without enabling secure boot.

      Don’t know why folks have problems with UEFI. It’s much better than the old BIOS in terms of dual booting. I think I should write a UEFI dual-booting guide to clear up the confusion 🙂

      • Jose Santos
        3 years ago

        Please do that ! 🙂
        I have an old Asus P8Z68 deluxe EFI (not UEFI compliance) that has EFI Shell option (never used) and think that Linux efibtootmgr command much easier to understand but since my Mobo isn’t UEFI de facto I am a little scary to mess with old Linux entries at boot…

  • Nor Otany
    3 years ago

    Section 3. Adding Boot Entry, says “Boot into the Linux distro that doesn’t have UEFI boot entry” (actually it says “UFEI” — that’s a typo to fix). I’ve created an Ubuntu partition, but I can’t boot it precisely because it doesn’t have UEFI boot entry. What am I missing?

    • Axel Thran
      2 years ago

      I have exactly the same question as Nor Otany: after installation of OpenSUSE 15.3 the old operation system on a different partition cannot be started. Would be nice to have a solution.

      • Hi.

        Too late for @Nor and @Axel, no doubt.
        But maybe a nudge in the right direction for others.

        (Disclaimer: I clicked to here because my fresh Debian Siduction installation won’t boot.
        I’m convinced it’s a U.E.F.I. / efibootmgr issue and so I’m grateful for pages like this.)

        But as a long-time GNU/Linux user, I can confidently share a tip or two.

        Un-bootable installations can sometimes be launched by using a live distro…
        Try booting from a USB-stick or CD or an ISO file on a multiboot Ventoy (github.com/ventoy/Ventoy) drive.

        Admittedly with a very old-fashioned text-based interface, the bootable SuperGrubDisk utility (www.supergrubdisk.org/super-grub2-disk) scans your partitions for possible existing installations and presents a list from which you select one. The selected one is then kickstart-booted by SuperGrubDisk. (Or not. The listed installations are a bit of a wall of text, not always clear which install is which, and sometimes you have to systematically try a few, rebooting between attempts.) There’s a GUI version in development too, Rescatux, but that hasn’t worked for me yet. As the Yanks say: “YMMV!”

        Nicer on the eyes, a regular Linux live-distro might be able to jump-start your non-bootable existing installation, without even fully booting the live distro, merely from its own Grub startup screen (the screen that presents options like nomodeset safe-graphics and memtest86+).

        Booting from a USB-stick with the aforementioned Debian Siduction (siduction.org/installation-media), one of the grub-menu entries near the bottom of the list will search for existing EFI installer files. (Hasn’t solved it for me, because it’s my EFI entries or files themselves which seem to be wrong.)

        More techy, there’s the strategy of setting up a chroot — literally a CH-anged ROOT environment, and that can be the environment of your un-(UEFI)-bootable existing linux on the disk. Once in that chroot environment, you can run all sorts of useful diagnostic and troubleshooting commands. Further extolling the virtues of that Debian Siduction live distro on a USB-stick, when it’s fully booted to the desktop, there’s a shortcut to launch a chroot environment. It takes care of the nitty-gritty, sets it up for you, and gives to a terminal as the all-powerful root user, but that means you need to be cautious and careful, which the on-screen warnings remind you.

        There you have it. Three possible ways @Nor and @Axel might have been able to access the unbootable. 1) From SuperGrubDisk, 2) from a Grub Menu, 3) from a chroot.

        In my case, unfortunately, I’m increasingly thinking it’s because the Debian Siduction installer (Calamares) didn’t assess the hardware/software environment properly and so went on to create wrong EFI entries. Worth mentioning, I installed from the Siduction live distro indirectly-booted using the Ventoy multiboot USB-drive, and I think that’s why my non-booting efibootmgr -v output includes the “VenHw” component, as in:

        Boot0003* siduction VenHw(66e275e7-75a0-4b37-a2e9-c5385e9c00cb)

        Amongst various different systems I can check, I’ve seen:

        VenHw(blah-blah-foo-bar)
        VenMedia(blah-blah-foo-bar)
        HD(1,GPT,blah-blah-foo-bar,0x2000,0xfa000)/File(\EFI\debian\shimx64.efi)
        PciRoot(0x0)/Pci(0x1f,0x2)/Sata(0,0,0)/HD(2,GPT,blah-blah-foo-bar,)/File(\System\Library\CoreServices\boot.efi)

        The last being a dual-boot 2011-era Mac which runs Siduction brilliantly but which will NOT boot the MacOS from the EFI/Grub menu (and that’s not the system I’m currently trying to fix).

        But that’s the back-story to why I dropped into this linuxbabe page: I’m looking for useful solid info about efibootmgr and the EFI entries, particularly the specifics of how it’s addressing the boot files, the protocols for the partitions and paths. And then, of course, how to create new ones which successfully boot my own new installation.

        I hope my journey thus far helps others. Pass it forward…

        Tschüss.

  • Thanks for this very useful article. However, I needed to add an entry and have tried the following command (with the necessary adjustments for my system)

    efibootmgr -c -d /dev/sda -p 7 -L 

    It appeared that I had to replace the backslashes in the argument to the

    -l

    switch with forward slashes in order for the entry to be valid. The backslashes seemed to simply escape the character that follow them.
    Maybe that’s how it should be – forward slashes (as the common Unix path separator)?

  • On a VM instance running Ubuntu 20.04.4 LTS SERVER, which I know is using UEFI, because:

    sudo gdisk -l /dev/sda
    GPT fdisk (gdisk) version 1.0.5
    
    Partition table scan:
      MBR: protective
      BSD: not present
      APM: not present
      GPT: present
    
    Found valid GPT with protective MBR; using GPT.
    Disk /dev/sda: 41943040 sectors, 20.0 GiB
    Model: VMware Virtual S
    Sector size (logical/physical): 512/512 bytes
    Disk identifier (GUID): F6E9D3F6-C189-4155-8914-5E0425A5C59E
    Partition table holds up to 128 entries
    Main partition table begins at sector 2 and ends at sector 33
    First usable sector is 34, last usable sector is 41943006
    Partitions will be aligned on 2048-sector boundaries
    Total free space is 4029 sectors (2.0 MiB)
    
    Number  Start (sector)    End (sector)  Size       Code  Name
       1            2048            4095   1024.0 KiB  EF02
       2            4096        41940991   20.0 GiB    8300

    After installing efibootmgr, it simply replies back with:

    efibootmgr
    EFI variables are not supported on this system.

    Is this because I’m running Ubuntu as a SERVER, or for some other reason?

    Dan, TheStarman.

    • Xiao Guoan (Admin)
      2 years ago

      Run the following command:

      sudo parted -l /dev/sda
  • I was asked to run the following command; here are the results:

    ~$ sudo parted -l /dev/sda
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sda: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags:
    
    Number  Start   End     Size    File system  Name  Flags
     1      1049kB  2097kB  1049kB                     bios_grub
     2      2097kB  21.5GB  21.5GB  ext4

    (Get the same results whether logged in directly or via SSH.)

    • Xiao Guoan (Admin)
      2 years ago

      Although your disk is using the gpt partition table, it doesn’t mean your system is booted via UEFI.

      UEFI requires your disk to have an EFI system partition (ESP).

      UEFI system partition

      Your disk doesn’t have this partition. It’s using a combination of BIOS firmware and gpt partition table. To learn more about UEFI, read the following article.
      Explaining UEFI Firmware for Linux Users

      • Thank you Xiao,

        I so should have done a hexdump of the VM disk before posting here!
        After looking at its first few sectors, it’s easy to see that it has no true EFI entries!
        In fact, it has a rather funny ASCII note where the EFI entries would normally begin. It seems to appear normal when first glancing at the 2nd sector:

        00000200  45 46 49 20 50 41 52 54  00 00 01 00 5c 00 00 00  |EFI PART....\...|
        00000210  9d 3a 07 98 00 00 00 00  01 00 00 00 00 00 00 00  |.:..............|
        00000220  ff ff 7f 02 00 00 00 00  22 00 00 00 00 00 00 00  |........".......|
        00000230  de ff 7f 02 00 00 00 00  f6 d3 e9 f6 89 c1 55 41  |..............UA|
        00000240  89 14 5e 04 25 a5 c5 9e  02 00 00 00 00 00 00 00  |..^.%...........|
        00000250  80 00 00 00 80 00 00 00  84 f6 32 fe 00 00 00 00  |..........2.....|

        But then at offset (0x400; the beginning of the 3rd 512-byte sector), I found this funny note; which others might find when running a modern Linux distro under VMWare Player:

        00000400  48 61 68 21 49 64 6f 6e  74 4e 65 65 64 45 46 49  |Hah!IdontNeedEFI|
        00000410  e4 f0 16 7f ca de 14 43  95 06 ac 22 1b 11 6a 86  |.......C..."..j.|
        00000420  00 08 00 00 00 00 00 00  ff 0f 00 00 00 00 00 00  |................|
        00000430  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        00000440  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        00000450  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        00000460  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        00000470  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
        00000480  af 3d c6 0f 83 84 72 47  8e 79 3d 69 d8 47 7d e4  |.=....rG.y=i.G}.|
        00000490  2e 34 b5 71 1f c6 e9 4f  8c 80 42 8a 60 53 49 7d  |.4.q...O..B.`SI}|
        000004a0  00 10 00 00 00 00 00 00  ff f7 7f 02 00 00 00 00  |................|

        Everything is zero bytes after that until getting to /dev/sda1 which is nothing more than the GRUB code (most of its 1049kB contents are nothing but zero bytes as well) for booting the linux server partition.

  • Hi Xiao- I was searching around for boot order info yesterday and found your article. Was wondering if you knew what would happen if the entire boot order was deleted? Someone on another website thread stated: “One thing i can tell you is that the UEFI firmware only holds so many entries. You may want to use efibootmgr and clear all the entries and then reboot. I have had this before where ghost entries being removed keep coming back.” If I delete all the boot entries and reboot, would the BIOS be able to “find” a bootable drive when it boots up and add a new entry for it, or would it be dead in the water? Thanks.

    • Xiao Guoan (Admin)
      2 years ago

      I have never deleted all boot entries with efibootmgr. I guess if you do it, your computer will take you to the EFI shell when you reboot, because EFI can’t find a boot loader.

      EFI shell is like a command-line interface for EFI. You can still manually select a boot loader by typing EFI shell commands. Once a Linux distro is booted, you can then use the grub-install utility to add a boot loader.

    • I installed a new nvme hard drive and was unable to install any operating system on it.

      Ends up the firmware on my computer was unable to handle the 5 old/invalid efibootmgr entries.

      In the process of getting it to work, I deleted he entire boot order. Here’s my story:

      First, I cleaned up the old/invalid entries displayed by

      efibootmgr -v
      efibootmgr -b 0000 -B
      efibootmgr -b 0001 -B
      efibootmgr -b 0002 -B
      efibootmgr -b 0003 -B
      efibootmgr -b 0004 -B
      

      efibootmgr indicates a failure

      no space left on device

      , but don’t let that fool you; It works; The entries are removed.

      Note the use of 4 character IDs.

      I left the entry 0005) for my live USB intact.

      Next, I deleted the entire boot order:

      efibootmgr -O
      

      Then, I rebooted and select the option to install the operating system.

      This time, when it gets to the part where it installs the bootloader, I prayed for divine intervention and it worked 🙂

  • Nice article. It’s a gem. Thanks!

  • Very helpfull thanks.
    This fixed the issue of dual booting windows and ubuntu 22.04 with grub not working.
    Just moved Ubuntu in my case was 0000 at the beginning,then all the rest,and grub menu is back..as before my Pc was just booting to windows as if grub didnt exist.

  • Zhanasyl
    12 months ago

    Cant change EFI boot order

    zhanasyl@zhanasyl-HP-ProBook-4520s:~$ efibootmgr
    BootCurrent: 0000
    Timeout: 0 seconds
    BootOrder: 0006,0000,0001,0002
    Boot0000* Notebook Hard Drive
    Boot0001* Notebook Ethernet
    Boot0002* Optical Disk Drive
    Boot0003* Notebook Ethernet
    Boot0004* Notebook Ethernet
    Boot0005* SD Card
    Boot0006* ubuntu
    Boot0007* Windows Boot Manager
    Boot000C* rEFInd
    zhanasyl@zhanasyl-HP-ProBook-4520s:~$ sudo efibootmgr -o 000C,0007,0006,0000
    Could not set BootOrder: Invalid argument

  • But how do change the ‘visual’ order ?

  • Hello, i think that i saw you visited my weblog so i came to
    “return the favor”.I am trying to find things to improve my web site!I suppose its ok to use a few of your ideas!!

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here