Detailed Explanation of Windows Boot Manager, Bootmgfw.efi, Bootx64.efi, and bcdboot.exe
Detailed Explanation of Windows Boot Manager, Bootmgfw.efi, Bootx64.efi, and bcdboot.exe
This article is a reprint, thanks to forum user @2011hiboy from the Wuyou Startup Forum (http://bbs.wuyou.net/forum.php?mod=viewthread&tid=303679)
This article primarily explains the relationships, differences, and functions of bootmgfw.efi and bootx64.efi.
Preface:
- This tutorial is written for UEFI boot scenarios, based on machines that generally support UEFI.
- This tutorial uses Windows 8 X64 as a reference.
Brief Description of the Titles:
- Windows Boot Manager: The boot option that appears after installing a Windows system (the relevant information is stored in NVRAM). It can be deleted and created.
- Bootmgfw.efi: The boot file that boots Windows.
- Bootx64.efi: The required boot file for UEFI.
- bcdboot.exe: A command-line tool from Microsoft for repairing UEFI boot.
Two Concepts to Introduce Before We Begin:
Default Computer Boot: Regardless of whether your computer has an operating system, when UEFI boot is defined, the computer will boot via Bootx64.efi, entering various modes such as maintenance, installation, or the computer/system itself.
Here, Bootx64.efi is just a generic name. It has richer permissions and is more powerful than the Windows default. In other words, if your Windows default boot file is missing, booting with the computer’s default boot file, Bootx64.efi, can still start the computer. Using the computer’s default file allows you to boot in various environments at any time—EFI SHELL, ISO, Windows, Linux… it’s a universal solution.
Windows Default Boot: When you install an operating system on your computer, or repair the UEFI boot, the boot menu will show a “Windows Boot Manager” option. By default, this option boots the system from bootmgfw.efi. The file at this location can only be used to boot Windows. It is not a generic name and has limited permissions.
0.
For UEFI boot environments, Bootx64.efi is more versatile. Here, Bootx64.efi is a generic name, meaning any valid .efi file renamed to Bootx64.efi will be loaded and executed by the computer.
bootmgfw.efi is not a generic name; it is only suitable for booting Windows.
Of course, for UEFI booting of Windows, Bootx64.efi and bootmgfw.efi are actually the same file. Their CRC and SHA256 values are identical.
Both have the ability to boot Windows, but they reside in different locations:
efi\boot\bootx64.efi
efi\microsoft\boot\bootmgfw.efi
The impact on system boot is certainly different. Let’s verify this below…
Three Directions to Discuss: (All conclusions below have been verified by actual testing and can withstand any doubt or speculation!)
1. UEFI Boot from Optical Media [Verified]:
By analyzing the UEFI boot record (efisys.bin) of the original Microsoft image, I found that the initial boot file for the optical disc is efi\boot\bootx64.efi. Since this verification is relatively simple, I tested:
win7 x64; win8 x86; win8 x64. The boot files for these three discs were bootx64.efi, bootia32.efi, and bootx64.efi, respectively.
Conclusion: UEFI boot from optical media does not depend on the operating system. It can be considered an OS-less environment, so bootx64.efi is the default computer boot file.
2. UEFI Boot from Removable Disk Media [Verified]:
Commonly, you can see from forums that USB drives are booted via bootx64.efi.
Conclusion: UEFI boot from removable disk media does not depend on the operating system. It can be considered an OS-less environment, so bootx64.efi is the default computer boot file.
3. UEFI Boot from Local Disk Media [Verified]:
Analysis of Native ESP Partition Boot Files
I installed the Microsoft win8 x64 operating system and analyzed all files in the ESP partition. They exist as:
efi\boot\bootx64.efi
efi\microsoft\boot\bootmgfw.efi
We can’t help but wonder: Which file is actually used? Which one does the computer default boot? Which one does the system default boot?
Simple enough—let’s delete them one by one and see if the system can still boot.
- Delete bootmgfw.efi, keep bootx64.efi
Result:
Select “Boot from local hard drive” — the system can still boot.
Select “Windows Boot Manager” — boot fails.
2. Delete bootx64.efi, keep bootmgfw.efi
Result:
Select “Boot from local hard drive” — boot fails.
Select “Windows Boot Manager” — the system can still boot.
Conclusion:
bootx64.efi is the default computer boot file.
bootmgfw.efi is the Windows default boot file.
4. The Relationship Between bcdboot, “Windows Boot Manager”, “Bootmgfw.efi”, and “Bootx64.efi”
The command format for bcdboot to repair system boot: bcdboot
Example:
- bcdboot c:\windows /l zh-cn
When we execute the above command:
bcdboot.exe will repair the system boot (repairing both the default computer boot and the Windows default boot). Both bootx64.efi and bootmgfw.efi will appear in the ESP partition.
Furthermore, bootx64.efi is created by renaming bootmgfw.efi. At the same time, “Windows Boot Manager” is generated in the Boot Menu startup selection menu.
Windows Boot Manager and its associated information are stored in the NVRAM on the motherboard, not on the hard drive. Therefore, deleting Windows Boot Manager requires going to the BIOS settings area.
If we use bcdedit to view the BCD file, we can see that bootmgfw.efi is the Windows default boot file. So our conclusion is the same as the native ESP partition test.
The correct explanation of NVRAM in the UEFI specification:
NVRAM is a region in the BIOS ROM (non-volatile storage medium), typically defined as 64k bytes. In UEFI, all variables are stored here.
Conclusion:
bootx64.efi is the default computer boot file.
bootmgfw.efi is the Windows default boot file.
Finally
The main reason for writing this post is to help those who are not entirely clear about the difference between Bootx64.efi and Bootmgfw.efi, or who have a vague understanding, to clearly understand the relationship and differences between the two. Let’s avoid incorrect statements like “Bootx64.efi is just Bootmgfw.efi renamed” or “Bootx64.efi is Bootmgfw.efi.”
These incorrect statements can mislead later readers. To be precise: “Bootx64.efi can be Bootmgfw.efi, or it can be any other valid efi program.”
Additional Note:
From the verification above, we know that repairing Windows boot under UEFI can be divided into repairing the default computer boot and the Windows default boot.
The more universal approach is repairing the default computer boot. If you can manually/automatically repair the default computer boot under UEFI, then repairing the Windows default boot is also straightforward.
From the UEFI perspective, Windows is actually an efi application of the computer, encompassed by the computer. Therefore, repairing the default computer boot is the universal solution.
Of course, when you don’t know how to repair manually, bcdboot is still very useful. Under normal circumstances, it can handle the repair. As long as your system hasn’t been overly stripped down, bcdboot should be able to handle it. If you can learn to repair manually, you won’t need to worry about these issues.
(End)