LinuxCommandLibrary

efibootmgr

Manage EFI boot entries

TLDR

List all boot options with their numbers

$ efibootmgr [[-u|--unicode]]
copy

Add UEFI Shell v2 as a boot option
$ sudo efibootmgr [[-c|--create]] [[-d|--disk]] [/dev/sda] [[-p|--part]] [1] [[-l|--loader]] "[\path\to\shell.efi]" [[-L|--label]] "[UEFI Shell]"
copy

Add Linux as a boot option
$ sudo efibootmgr [[-c|--create]] [[-d|--disk]] [/dev/sda] [[-p|--part]] [1] [[-l|--loader]] "[\vmlinuz]" [[-u|--unicode]] "[kernel_cmdline]" [[-L|--label]] "[Linux]"
copy

Change the current boot order
$ sudo efibootmgr [[-o|--bootorder]] [0002,0008,0001,001A,...]
copy

Delete a boot option
$ sudo efibootmgr [[-b|--bootnum]] [0008] [[-B|--delete-bootnum]]
copy

SYNOPSIS

efibootmgr [options] [BootNum]

PARAMETERS

-a, --active
    Mark boot entry active

-A, --inactive
    Mark boot entry inactive

-b XXX, --bootnum=XXX
    Modify BootXXX entry (defaults to $BOOTNUM)

-B, --delete-bootnum
    Delete boot entry by BootNum

-c
    Create a new boot entry

-C
    Copy an existing boot entry

-d DISK, --disk=DISK
    Target disk (e.g., /dev/sda)

-D XXX, --delete-bootnum=XXX
    Delete specific BootNum XXX

-g, --bootnext
    Deprecated: set bootnext (alias for -@)

-i XXX, --image=XXX
    Image index for copying

-l \EFI\PATH, --loader=\EFI\PATH
    Loader path (e.g., \EFI\BOOT\BOOTX64.EFI)

-L LABEL, --label=LABEL
    Boot entry label

-n
    Test mode: show command only

-N
    Dry run: simulate without changes

-o ORDER, --bootorder=ORDER
    Set BootOrder (comma-separated BootNums)

-O
    Set one-time BootOrder

-p PART, --part=PART
    EFI partition number (default 1)

-u OPTS, --unicode=OPTS
    Kernel command line options

-v
    Verbose mode

-V DESC, --desc=DESC
    Boot description

-@
    Read options from file

--no-known-flags
    Ignore unknown attributes

--version
    Show version

--help
    Show help

DESCRIPTION

efibootmgr is a powerful command-line utility for managing UEFI (EFI) boot entries on Linux systems equipped with UEFI firmware. It enables users to list, create, edit, delete, and reorder boot menu items stored as EFI variables in the firmware's NVRAM.

Primarily used by system administrators and advanced users, it interacts directly with EFI boot services via the efivars filesystem (/sys/firmware/efi/efivars), requiring root privileges. Common tasks include adding entries for GRUB, systemd-boot, or Windows Boot Manager; setting boot order; marking entries active/inactive; and specifying one-time boot options.

The tool is essential for multi-boot setups, recovery environments, and customizing firmware boot behavior without accessing the BIOS/UEFI setup menu. It supports verbose output for debugging and dry-run modes to preview changes. Distributions like Ubuntu, Fedora, and Arch Linux use it during installation or bootloader updates via scripts.

Caution is advised as incorrect usage can render the system unbootable. Always verify current entries first with efibootmgr -v and consider backing up EFI variables.

CAVEATS

Requires root and UEFI system; efivars must be mounted RW; misuse can make system unbootable—backup NVRAM first; not for BIOS/Legacy boot.

COMMON USAGE

efibootmgr -v: List entries with details.
efibootmgr --create --disk /dev/sda --part 1 --label "Ubuntu" --loader "\\EFI\\ubuntu\\shimx64.efi": Create GRUB entry.
efibootmgr -o 0000,0001: Set boot order.

REQUIREMENTS

Kernel with CONFIG_EFIVAR_FS; efibootmgr package; Secure Boot may require signed loaders.

HISTORY

Developed by Peter Jones (Red Hat) in 2006 for early UEFI support; maintained by community with contributions from Rod Smith and others; integral to Linux distros since EFI transition (~2008); latest versions enhance Secure Boot and GPT handling.

SEE ALSO

Copied to clipboard