14

My ESP looks like this

Boot Dell fedora Microsoft

In the Boot directory, their is a boot-loader named bootx64.efi which I understand is the default boot loader that get started first. But in the fedora directory there is another boot-loader(grub2) named grubx64.efi.

What is the function of each of these boot-loaders? Which one provides the boot-menu?

  • does this have anything to do with secure boot? – user3247608 Oct 11 '14 at 2:43
  • It's related to windows 8 license. – PersianGulf Oct 11 '14 at 2:44
  • Perhaps I should have made this clearer in the question - secure boot is disabled on the machine. The question has nothing to do with windows 8. – user3247608 Oct 11 '14 at 2:49
  • When win8 and secure boot story was bold, grub and some boot loader have some files. – PersianGulf Oct 11 '14 at 3:24
15

bootx64.efi doesn't get started first. Most of the time, it doesn't get started at all.

The EFI firmware has its own "boot menu", analogous to the menu presented by GRUB but at an earlier stage in the boot process. Just as GRUB lets you choose which Linux kernel to run, the EFI boot menu lets you choose which EFI boot program to run — choices being things like GRUB itself, or the Windows bootloader. (And, like GRUB's menu, the EFI boot menu is typically not shown by default; you have to press a hotkey during startup to see it.)

The entries in the EFI boot menu are defined by configuration data that's stored in the motherboard's NVRAM (the "BIOS settings" memory). This configuration isn't stored in a file, but in Fedora you should be able to see it using the efibootmgr program. Each entry holds a human-readable name (to show in the menu) and a path to a boot program in an EFI system partition, as well as a priority number that determines which entry is booted by default when you don't press the hotkey to see the menu.

These NVRAM boot entries are (typically) created by operating system installers. When you install an OS and it places a bootloader file in the EFI system partition, it also adds an entry to the NVRAM configuration so that the new bootloader will be available in the EFI boot menu. (In many cases, it also makes that new entry the default, so that the OS you've just installed will boot on its own without you needing to open the EFI boot menu and manually choose it.)

The Boot/bootx64.efi program is a fallback for when the EFI hasn't been configured with any NVRAM boot entries that refer to other boot programs on the disk. It's important for removable media like bootable CDs and USB drives, but on a hard drive, it's generally not used. The Windows installer creates a Boot/bootx64.efi as a fail-safe; It's just a copy of Microsoft/Boot/bootmgfw.efi (at least in Windows 7; I don't know about other versions).

On my systems, I've replaced that Microsoft bootx64.efi with a copy of the EFI Shell, so that if I somehow find myself without any NVRAM boot entries and actually relying on the fallback bootloader, I get dropped to a shell where I can examine the situation and manually run one of the other boot programs instead of having the system just boot Windows automatically. (I've also added an entry for it in the GRUB menu so that I have the option to start the EFI shell even when the system is working properly.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.