I need to install grub2
on Ubuntu 16 LTS.
When I try to boot both Windows 10 and Ubuntu, Windows 10 loads fine, But Ubuntu loads once and twice does not. I am afraid to damage the hard disk because i have to press power button to boot again!
grub2windows 10xubuntu
I need to install grub2
on Ubuntu 16 LTS.
When I try to boot both Windows 10 and Ubuntu, Windows 10 loads fine, But Ubuntu loads once and twice does not. I am afraid to damage the hard disk because i have to press power button to boot again!
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 find
commands.
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/BOOT/bootx64.efi
or 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:
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 grubx64.efi
for shimx64.efi
in this command, but given that shimx64.efi
is present on your system, my suspicion is that you are using Secure Boot.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 EFI/Microsoft/Boot/bootmgfw.efi.bkp
.
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:
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.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!
Best Answer