Files
nexus/wiki/concepts/efibootmgr.md

41 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "efibootmgr"
type: concept
tags: [linux, uefi, boot, nvram]
date: 2026-04-14
aliases: [efibootmgr, efibootmgr 命令]
---
# efibootmgr
## Definition
Linux 系统下管理 UEFI NVRAM 启动项的工具,通过操作固件级启动寄存器实现启动顺序的查看、添加、删除和重排。
## Core Mechanism
- 读取当前 BootOrder`BootOrder: 0005,0000,0001,0002,0003`
- 将指定启动项编号强制写入 NVRAM 替换 BootOrder
- 持久化生效(重启后仍保持,除非固件重置)
## Key Commands
```bash
# 查看当前启动项
sudo efibootmgr
# 强制将 0005 设为首选启动项
sudo efibootmgr -o 0005,0000,0001,0002,0003
# 添加新启动项(假设 /dev/nvme0n1p1 是 EFI 分区)
sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -L "Ubuntu_Force" -l "\EFI\ubuntu\shimx64.efi"
```
## Why It Matters
HP ZBook 等工作站存在 BIOS 固执行为NVRAM 启动项注册成功(`Boot0005: Ubuntu`)但未被加入 `BootOrder`,导致开机忽略该启动项。`efibootmgr -o` 是绕过此问题的核心工具。
## Related
- [[HP ZBook]] — 受影响的硬件平台
- [[UEFI启动修复]] — 完整修复策略
- [[efibootmgr]] ← [[UEFI启动修复]] ← [[HP ZBook]]
## Sources
- [[安装ubuntu-24-04-2在hp-zbook工作站笔记本上]]