After running Boot-Repair to fix things when dual booting windows 8 and Ubuntu 12.04.3, multiple entries are left in the grub menu. Three come from

menuentry "Windows UEFI bkpbootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 4659-4959
chainloader (${root})/EFI/Microsoft/Boot/bkpbootmgfw.efi

menuentry "Windows Boot UEFI loader" --users "" {
search --fs-uuid --no-floppy --set=root 4659-4959
chainloader (${root})/EFI/Boot/bkpbootx64.efi

menuentry "EFI/Lenovo/Boot/bootmgfw.efi" {
search --fs-uuid --no-floppy --set=root 4659-4959
chainloader (${root})/EFI/Lenovo/Boot/bootmgfw.efi

The second is recommended in the Boot-Repair documentation as the one to use to boot Windows 8, but equally it seems the first option does the job fine too, and the last give access to settings. Do I really need all these, or can I simply comment them out in 25_custom?

Similarly, given that the original boot entry for windows in 30_os-prober is defunct, can I just comment it out?

What is the difference between each of these efi boot loaders anyway?


The first two are probably duplicate files. I don't know about the third; it could be another duplicate or it could be something Lenovo-specific.

Background: The EFI spec says that each OS should install its boot loader in a subdirectory of the EFI directory on the ESP, as in EFI/Microsoft for Windows or EFI/ubuntu for Ubuntu. The EFI/BOOT directory is a special case: It holds a boot loader (bootmgfw.efi) that serves as a fallback in case all others fail. That's also the name that's used for boot loaders on removable media like USB flash drives. Thus, many OSes, including Windows, install two copies of their boot loaders -- once in the official directory and again as EFI/BOOT/bootx64.efi. GRUB tends to pick these both up and present them as options, because they can be different boot loaders, even though they often are not.

This is complicated by Boot Repair. Old versions of this program, and new ones if you select a certain option in the Advanced menu, back up both the EFI/Microsoft/Boot/bootmgfw.efi and the EFI/BOOT/bootx64.efi boot loaders (by renaming them with bkp placed at the start of the filename) and place copies of GRUB in their place. This is done to work around bugs in some EFIs. The problem is that this creates additional boot loader files, which can clutter menus and add to confusion when doing manual maintenance. Unless you need to use this backup-and-replace hack because of a broken EFI, I recommend that you not let Boot Repair make this change. Note, however, that this has not caused the duplication you've noted, although it has affected the filenames that GRUB has entered on its chainloader lines.

Personally, I'd remove the EFI/BOOT/bkpbootx64.efi (or EFI/BOOT/bootx64.efi) entry, since it could conceivably be changed to something else should some other tool decide to take over that spot. Hijacking the Windows boot loader is a little less likely -- although because of the EFI bug I've noted, at least two tools (Boot Repair and rEFInd's mvrefind.sh script) can do this, and others may do so in the future.

A tip: The diff command is your friend. Pass it two filenames and it will tell you if they're identical or not. No output indicates that the files are identical. You can use this to discover which .efi files on your system are identical to which other files.

  • In my ` EFI/BOOT directory is a special case: It holds a boot loader (bootmgfw.efi)` in my EFI/BOOT I seem to only see bootx64.efi (and its boot-repair backup), is this what you meant? (It would seem consistent with your later comment that "Windows, install two copies of their boot loaders -- once in the official directory and again as EFI/BOOT/bootx64.efi" ) – fpghost Dec 21 '13 at 18:11
  • Using diff I see so far that /boot/efi/efi/Microsoft/Boot/bootx64.efi ==/boot/efi/efi/Microsoft/Boot/bootmgfw.efi == /boot/efi/EFI/Boot/bootx64.efi ==/boot/efi/efi/ubuntu/shimx64.efi – fpghost Dec 21 '13 at 18:11
  • and also /boot/efi/efi/Microsoft/Boot/bkpbootmgfw.efi /boot/efi/EFI/Boot/bkpbootx64.efi – fpghost Dec 21 '13 at 18:12
  • I understand your explanation of why EFI/BOOT/bootx64.efi exists as a fallback option for win 8, but why does bootx64.efi also exist a second time as EFI/Microsoft/Boot/bootx64.efi? – fpghost Dec 21 '13 at 18:19
  • 1
    I haven't studied this in detail, but I think that Boot Repair installs a copy of GRUB as EFI/Microsoft/Boot/bootx64.efi. I don't know why they do this; to the best of my knowledge, such a copy serves no purpose, since AFAIK no EFI or other boot loader treats that file as anything special. – Rod Smith Dec 21 '13 at 18:24

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.