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]

PARAMETERS

-c, --create
    Create a new boot entry.

-b, --bootnum <num>
    Specify boot entry number (hex).

-B, --delete-bootnum <num>
    Delete the specified boot entry.

-a, --active <num>
    Mark boot entry num as active.

-A, --inactive <num>
    Mark boot entry num as inactive.

-u, --update-bootnum <num>
    Update an existing boot entry.

-o, --bootorder <order>
    Set the boot order (comma-separated hex list).

-O, --delete-bootorder
    Delete all entries from the boot order.

-v, --verbose
    Print extra information during operation.

-q, --quiet
    Suppress non-error output.

-H, --help
    Display short help message.

-L, --label <label>
    Set boot entry label (description).

-l, --loader <path>
    Path to the boot loader EFI file.

-d, --disk <disk>
    Specify disk containing the boot loader.

-p, --part <part>
    Specify partition number for boot loader.

-w, --write-string
    Write new variables to NVRAM.

-s, --show-string
    Show current variables in NVRAM.

-S, --show-summary
    Show a summary of boot variables.

-t, --timeout <seconds>
    Set boot menu timeout in seconds.

-T, --delete-timeout
    Delete the timeout variable.

-n, --next-boot <num>
    Set next boot entry for a single boot.

-N, --delete-next-boot
    Delete the next boot variable.

-g, --gpt
    Force creation of a GPT partition entry.

-D, --bootnext-default
    Use default next boot if specified.

-i, --iface <iface>
    Specify interface for network boot.

-@, --append-args <args>
    Append arguments to the loader path.

--iso-8859-1
    Use ISO-8859-1 encoding for string variables.

--unicode
    Use Unicode encoding (default).

DESCRIPTION

efibootmgr is a command-line utility used to manage UEFI (Unified Extensible Firmware Interface) boot entries. It allows users to create, delete, reorder, and modify entries in the UEFI NVRAM (Non-Volatile Random Access Memory), which the firmware uses to determine boot order and paths. This tool is essential for systems booting via UEFI, enabling control over installed operating systems' boot options without directly interacting with the firmware setup utility. It requires root privileges and a system booted in UEFI mode, as it directly interacts with the EFI system variables exposed through the `efivarfs` filesystem. Commonly used to add new OS entries, change the default boot order, or specify one-time boot options.

CAVEATS

efibootmgr requires the system to be booted in UEFI mode, not BIOS/CSM. It also demands root privileges for any modifications. Changes are written directly to NVRAM, making them persistent; incorrect usage can lead to an unbootable system. Ensure the `efivarfs` filesystem is mounted, typically at /sys/firmware/efi/efivars, for proper operation.

EFI VARIABLES

efibootmgr interacts with EFI variables stored in NVRAM, exposed via the efivarfs filesystem (e.g., /sys/firmware/efi/efivars).

BOOT ORDER (BOOTORDER)

The BootOrder variable defines the sequence in which the firmware attempts to boot entries. It's a comma-separated list of hexadecimal boot entry numbers.

BOOT NEXT (BOOTNEXT)

The BootNext variable specifies a boot entry to be used only for the next boot, useful for single-time reboots into specific environments.

HISTORY

efibootmgr was developed to provide a native Linux command-line interface for managing UEFI boot entries. Its emergence paralleled the increasing adoption of UEFI firmware in modern computers, offering a more programmatic and scriptable alternative to firmware setup utilities or Windows-specific tools. It has become a standard utility in most Linux distributions, simplifying UEFI boot management directly from the OS.

SEE ALSO

bootctl(1), grub-install(8), fdisk(8), parted(8)

Copied to clipboard