← 返回命令列表

Linux command

efibootmgr 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

List

efibootmgr -v

Add

sudo efibootmgr -c -d [/dev/sda] -p [1] -l "[\EFI\boot\bootx64.efi]" -L "[My Entry]"

Change

sudo efibootmgr -o [0002,0008,0001,001A]

Set

sudo efibootmgr -n [0002]

Delete

sudo efibootmgr -b [0008] -B

Set

sudo efibootmgr -t [10]

Set

sudo efibootmgr -b [0002] -A

说明

efibootmgr manipulates the UEFI Boot Manager by modifying EFI variables stored in NVRAM. It can create, delete, and modify boot entries, change boot order, and set the next boot device. Essential for managing dual-boot systems and UEFI boot configuration.

参数

-c, --create
Create a new boot entry.
-d, --disk _disk_
Disk containing the loader (defaults to /dev/sda).
-p, --part _part_
Partition number on the disk (defaults to 1).
-l, --loader _name_
EFI loader filename (defaults to \EFI\arch\grub.efi).
-L, --label _label_
Boot entry display label (defaults to "Linux").
-o, --bootorder _order_
Set boot order (comma-separated hex boot numbers).
-b, --bootnum _num_
Boot entry number (hex) to operate on.
-B, --delete-bootnum
Delete the entry specified by -b.
-n, --bootnext _num_
Set the boot entry to be used on next boot only. Supersedes BootOrder for one boot.
-N, --delete-bootnext
Delete the BootNext setting.
-a, --active
Set the boot entry specified by -b as active.
-A, --inactive
Set the boot entry specified by -b as inactive.
-t, --timeout _seconds_
Set the boot manager timeout in seconds.
-T, --delete-timeout
Delete the boot manager timeout variable.
-u, --unicode
Pass extra command line arguments in Unicode.
-v, --verbose
Print additional information including device paths.

FAQ

What is the efibootmgr command used for?

efibootmgr manipulates the UEFI Boot Manager by modifying EFI variables stored in NVRAM. It can create, delete, and modify boot entries, change boot order, and set the next boot device. Essential for managing dual-boot systems and UEFI boot configuration.

How do I run a basic efibootmgr example?

Run `efibootmgr -v` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --create do in efibootmgr?

Create a new boot entry.