bcfg Deep Dive

How to use UEFI Shell bcfg to inspect, add, remove, and debug UEFI boot options from the firmware side.

2 min read
Shell & Firmware Tools cover

The OS boot entry is gone, but the disk is still readable from Shell.

You can see the EFI System Partition. You can even launch bootmgfw.efi manually. But BDS no longer lists the option.

That is a bcfg moment.

Basic commands

Shell> bcfg boot dump
Shell> bcfg boot add 0 fs0:\EFI\BOOT\BOOTX64.EFI "USB Recovery"
Shell> bcfg boot rm 0

Different Shell versions may vary slightly, so always check help bcfg on the target platform.

How bcfg relates to NVRAM

01 bcfg

User command

Reads or modifies boot entries from UEFI Shell.

02 Boot####

EFI_LOAD_OPTION

Stores attributes, description, device path, and optional data.

03 BootOrder

Boot priority list

Stores the order in which BDS tries Boot#### entries.

04 BDS

Boot Device Selection

Consumes BootOrder and Boot#### variables to choose the boot target.

bcfg and boot variables

Real world example: manually recover a boot option

Shell> map -r
Shell> fs0:
FS0:\> ls EFI\Microsoft\Boot
FS0:\> bcfg boot add 0 fs0:\EFI\Microsoft\Boot\bootmgfw.efi "Windows Boot Manager"
FS0:\> bcfg boot dump

This can recover a missing boot entry when the ESP is still intact.

But for root-cause analysis, do not stop there. Ask why the variable disappeared:

NVRAM full?
Variable store corruption?
BIOS update reset policy?
Boot option migration bug?
CMOS clear behavior?
Secure Boot / setup mode side effect?

Common pitfall: adding a path without understanding mapping

Adding a boot option with fs0: works only if the Shell converts it into a stable device path. Always verify the resulting Boot#### with dmpstore or bcfg boot dump.

Debug checklist

Before and after bcfg changes

Avoid making the debug state worse.

Found this useful?

Save it or share it with someone learning firmware, BIOS/UEFI, and embedded systems.

Nội dung liên quan

Một số bài viết, ghi chú hoặc project có liên quan đến nội dung bạn vừa đọc.

Biến note thành bài viết hoàn chỉnh

Notes là nơi ghi nhanh khái niệm.