Change Linux Boot with efibootmgr

Minimalist graphics with blue background and white Linux and terminal icons.

Introduction

Customizing Linux boot with efibootmgr is essential for those who want to manage system startup on machines with UEFI firmware in an advanced way. This command-line tool allows you to view, create, modify, or delete EFI boot entries directly from the terminal, without the need to access the BIOS or firmware setup. Whether you want to set a default operating system or rearrange the boot order, efibootmgr gives you complete control over the bootloader.

Install efibootmgr

  • Debian/Ubuntu/Linux Mint
    sudo apt install efibootmgr
  • Fedora, CentOS, RedHat
    sudo dnf install efibootmgr

View Boot element

  1. Open Terminal and type this command
    sudo efibootmgr
  2. You’ll see something like this:
Output of the ‘efibootmgr’ command on Ubuntu, showing the EFI boot entries configured on a computer.

Change Boot order

  1. Open Terminal and type this command
    sudo efibootmgr
  2. Copy the BootOrder string, for example:
    0000,0002,0021,001D,001E,001F,0020,0022,0023,0024,0025,0026
  3. Type the following command followed by the modified boot order (for example, reversing 0000 and 0002)
    sudo efibootmgr -o 0002,0000,0021,001D,001E,001F,0020,0022,0023,0024,0025,0026

Delete Boot element

  1. Open Terminal and type the following command, entering the boot number (for example, 0002)
    sudo efibootmgr -b <bootnum> -B

By Giacomo

System Administrator. Founder and writer.