A screen shot of the error message you're seeing may be helpful. I Googled it and found several pages, like this one, which show screen shots that make it look like this may be a Windows error. If so, then it sounds like your installation method left some Windows files intact, which have somehow been activated and are now trying to take control of the computer. (Side note: If you completely delete an OS from an EFI-based computer, be sure to delete its files on the EFI System Partition (ESP) to prevent this "zombie OS" syndrome! In your case, completely deleting the ESP and allowing the Ubuntu installer to create a new one would have been appropriate.) If my suspicion is correct, then deleting those Windows files from the ESP should work around this problem.
If the ESP (mounted at /boot/efi
in Ubuntu) is damaged, or if the Windows boot manager has returned, zombie-style, it should be possible to boot the computer by using my rEFInd boot manager on a USB flash drive or CD-R. Note, however, that you may need to disable Secure Boot if it's enabled. Once the computer has booted, you should be able to investigate further, such as:
- Use
dosfsck
to check for filesystem damage on the ESP. (Be sure to unmount it first.)
- Look for leftover Windows files on the ESP. (They normally reside in
/boot/efi/EFI/Windows
, as seen from Ubuntu.)
- Check the boot order with
sudo efibootmgr -v
. Pay attention to the BootOrder
line; the first item there indicates the boot loader that the computer tries to launch first. If the Boot####
line corresponding to the first BootOrder
line is Windows, then this explains the problem. Deleting the Windows files should fix the problem; or you can adjust the boot order with the -o
option to efibootmgr
. In extreme cases, you might need to add a new boot entry for Ubuntu. (Sometimes they go missing, either because of EFI bugs or because of accidents with tools like efibootmgr
.)
In an extreme case, if the ESP is badly damaged, I recommend:
- Back up what you can from the ESP. A file-level backup (using
cp
, tar
, zip
, or similar tools) is fine.
- Try using
dosfsck
on the ESP.
- If
dosfsck
doesn't fix the problem, create a fresh FAT filesystem on the ESP by unmounting it and using mkdosfs
on it.
- After creating a fresh filesystem, restore the original files and adjusting the
/etc/fstab
file to mount it using its new serial number (UUID=
item in /etc/fstab
; learn the new serial number by using blkid
).
- If you still can't boot, you'll have to (re-)install a boot loader.
- Boot Repair can completely re-install GRUB in a somewhat automated way.
- Alternatively, if you're successfully booting via rEFInd or some other temporary tool, you can run
sudo grub-install
followed by sudo update-grub
. This is a bit less thorough than Boot Repair, but is likely to be sufficient; and is less likely to create new problems through overkill.
- Yet another option is to install rEFInd via its Debian package, PPA, or (if you're using Ubuntu 17.04)
refind
package in Ubuntu. This will bypass GRUB. You'll need to jump through a few extra hoops to get it working with Secure Boot, though.
sudo dosfsck -t -a -w /dev/sda1
If only booting Ubuntu you can rename boot of shimx64.efi to be "Windows Boot Manager" or use fallback/hard drive entry /EFI/Boot/bootx64.efi which is really shim.http://askubuntu.com/questions/486752/dual-boot-win-8-ubuntu-loads-only-win/486789#486789 – oldfred May 26 '17 at 15:35