Boot into Linux, type the following three commands in a shell, and post the output here:
ls -l `find /boot/efi -iname "*\.efi"`
ls -l `find /boot/efi -iname "*\.bkp"`
sudo parted /dev/sda print
Note that those are back-ticks (to the left of the "1" key on most keyboards) around the
The result should be a list of all the boot loaders on your ESP, including both the regular names and the renamed versions created by Boot Repair; and a list of all the partitions on your disk.
Also, what sort of computer are you using? (Brand and model.) Did it come with Windows 8 or did you install it yourself?
Unfortunately, some manufacturers are playing very annoying games with their boot loaders on pre-loaded Windows 8 computers. IMHO, blowing those installations away and starting from scratch is looking more and more like a good solution.
Edit/answer given new information:
There's nothing in your output that's weird or unexpected, so it looks as if something in Windows is "repairing" what it sees as its own "broken" boot loader. This requires some elaboration, which will help you understand what's going on:
An EFI (or UEFI, which is just EFI 2.x) implementation is supposed to check NVRAM entries to decide which boot loader (a file with a
.efi extension) to run when it boots. Some implementations are broken, though, and will only boot the
EFI/Microsoft/Boot/bootmgfw.efi boot loader. Others will boot other boot loaders, but only if they've got the name "Windows Boot Manager" or "Red Hat Enterprise Linux".
To work around this type of bug, the Ubuntu Boot Repair tool implements a fix that's at least as ugly and confusing as the bug it bypasses: It renames those two default boot loaders with
.bkp extensions, places copies of GRUB in their place, and adjusts GRUB so that it will launch the Windows boot loaders using their new names. This gets GRUB booting, but in a way that Windows doesn't understand and might try to "fix" itself. I think that this is what's happening -- when Windows boots, it's seeing that its boot loader has been overwritten by another one and so it tries to correct the problem.
I recommend you try the following:
- Check your manufacturer's Web site to see if there's a firmware update. If there is, update your firmware to the latest version, just in case there's a bug fix for this type of boot bug.
- Boot Windows and reboot to verify that when you reboot you go straight into Windows. You want to start from this point because it's more standard than the way that Boot Repair sets up.
- Boot a Linux emergency disc in EFI mode. (The Ubuntu install disc should work fine for this.)
- Install the
efibootmgr utility, if necessary. In the Ubuntu live CD, you'd do this by typing
sudo apt-get install efibootmgr.
sudo efibootmgr -c -l \\EFI\\ubuntu\\shimx64.efi -L "Windows Boot Manager" -p 2. Be careful to type this command exactly as specified, including the doubled-up backslashes as directory path separators. This should set up GRUB to launch as the default boot loader, giving it the firmware label "Windows Boot Manager" in case you've got that bug. (You could try with a less deceptive name, and on most systems that will work, but maybe not for you.) If you're not using Secure Boot, you could substitute
shimx64.efi in this command, but given that
shimx64.efi is present on your system, my suspicion is that you are using Secure Boot.
- Reboot and test it.
If it works at this point, then great. If it boots to GRUB but GRUB can't launch Windows, you may need to adjust your GRUB configuration so that it references
EFI/Microsoft/Boot/bootmgfw.efi rather than
If you can't get your system to launch GRUB in this way, then you may have a very brain-damaged firmware combined with something in Windows that's automatically "fixing" a "damaged" boot loader on every boot, closing off your best (albeit ugly) avenue of repair. In that case, I have several further suggestions:
- If the computer is new enough, return it to the store and get a new one. Make it very clear, both to the store and to the manufacturer, why you're returning it.
- Look for whatever in Windows is checking and "repairing" its boot loader and disable that. You should then be able to use Ubuntu's Boot Repair, or do something similar manually, to get it all working.
- Create a second ESP and install GRUB (or another Linux boot loader) to it using the Microsoft names. By juggling partition ID numbers (using gdisk, for example -- use the
t option on the experts' menu), you might be able to get the firmware to use your desired boot loader while getting Windows to look at its own boot loader. This is highly speculative, though; it might not work at all.
- Create a USB flash drive with my rEFInd boot manager. You'll then be able to insert it into the computer and boot from the USB device to get rEFInd, which should then detect both Windows and GRUB and give you the option of booting either. With a little extra reconfiguration, you could get it to boot Linux directly. If you can set your firmware to boot from the USB device by default, you could leave the USB drive plugged in permanently for a permanent solution.
- Install rEFInd or GRUB from Windows. I'm far from positive of this, but if you install a boot loader from Windows (as described on rEFInd's Web site), it might bypass whatever in Windows is juggling the boot loaders, thus enabling your preferred boot loader to run by default.
Note that, if you use any solution that involves rEFInd, you may need to set it up with Secure Boot, with involves jumping through some extra hoops. (This situation will improve in time, but for now it's still a bit awkward.) Alternatively, you could disable Secure Boot in your firmware.
I hope this helps!