13

Today after I installed Ubuntu 16.04 via USB on my pre-installed Windows 8 machine, I was required to restart my computer. After doing so I wasn't offered to select an OS, so after searching the internet, I came across Boot-Repair which I ran using the Try Ubuntu option in my Ubuntu installation USB.

Following the boot repair I got a message saying,

If your computer directly reboots into Windows, try to change the boot order in your BIOS. If your BIOS does not allow to change the boot order, change the default boot entry of your Windows bootloader. For example, you can boot into Windows then type the following in an admin command prompt:

bcdedit /set {bootmgr} path \EFI\ubuntu\shimx64.efi

After I rebooted my PC, I am receiving the following error message for about 3 seconds, after which it boots automatically into Windows 8, without letting me access Ubuntu.

Error received while booting after manufacturer's logo, before grub:

Failed to open \EFI\BOOT\grubx64.efi - Not Found  
Failed to load image \EFI\BOOT\grubx64.efi: Not Found    
start_image() returned Not Found  

So I tried the other solution of typing that command in the cmd, to which my surprise, worked, and I am now prompted a window (grub) to choose my OS each time I turn on my PC, but unfortunately, I still receive an error each time, that lasts about 3s, after which I can choose my OS (both are working just fine) and work normally.

Do you have any suggestions to get rid of the error message each time I boot my PC?

3
  • Does the file .../EFi/BOOT/grubx64.efi actually exist? Mount the EFI partition in a live session and look. The normal place for grub is /EFI/ubuntu/grubx64.efi. Do you have an entry for it (efibootmgr -v)?
    – ubfan1
    Apr 19, 2017 at 23:04
  • 1
    Please run the Boot Repair utility and select the "Create BootInfo Summary" option. (DO NOT click "Recommended Repair," at least not yet!) When asked whether to upload the report, click "Yes," and then post the URL provided here. This will give us more details about your configuration, which is required to base an answer on more than guesswork. Also, both the image links point to the same image. Please correct whichever one needs correcting (I suspect the first).
    – Rod Smith
    Apr 19, 2017 at 23:42
  • For some yet unknown reason; my QNAP does not want to boot from /EFI/Ubuntu so I had to move the files to /EFI/Boot.
    – Paul
    Feb 27, 2019 at 9:26

6 Answers 6

10

Don't try these present above. These are hard and may not work. I also ran into same problem so what I did was took a live USB of Ubuntu and pressed try Ubuntu. Then I went to terminal . There you press this following command .Internet is needed here.

First command: sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt update

Second command : sudo apt-get install boot-repair && boot-repair

Then an app will be there. In that you press recommended fix. Then it will fix the grub and reinstall it .here too Internet is must. Then reboot and enjoy dualbooting.

1
  • Indeed this worked. Thank you for the perfect answer! Oct 10, 2023 at 19:57
5

Finally managed to solve it.

For the rest, open the terminal

$ sudo bash
$ cd /boot/efi/EFI
$ sudo cp -p ubuntu/grubx64.efi Boot
$ sudo touch ubuntu/grubx64.efi.gbr

After that, I stopped seeing the error message and grub showed up normally (it did before, too, just after seeing that error message for 3s).

1
  • 7
    can you provide more details of how to go about this? do I boot from liveusb, which partition to mounts,.. thanks
    – wakandan
    Aug 8, 2017 at 2:42
5

After a Windows update I could no longer boot into Ubuntu: failed to open /EFI/ubuntu/grubx64.efi

I was able to boot using a Live Ubuntu USB, then:

# find the EFI partition
sudo fdisk -l 

# mount EFI
sudo mount /dev/<partition_name> /mnt

cp -p /cdrom/EFI/grubx64.efi /mnt/EFI/ubuntu

I had to reboot and enable Secure Boot and that did the trick. This was dual booting 18.04 on a Lenovo Thinkpad t470 with Windows 10

3

You should probably fix the boot loader entry itself instead of copying files around. That'll always break when upstream updates something. Try something like this instead:

efibootmgr --create --label Ubuntu --disk /dev/sda1 --loader "\EFI\ubuntu\grubx64.efi"

Where /dev/sda1 corresponds to /boot/efi. For the curious, there's more details in this guide.

3
  • 1
    You saved my day. I tried: 1. Boot-repair (recommended) 2. Copy manually file from /cdrom/ to mounted efi partition and this solution is the one I have my Ubuntu back (and also windows as I have dual-boot with 2 ssd). Thank you very much. Apr 4, 2020 at 19:22
  • Glad to help! :)
    – bviktor
    Apr 4, 2020 at 23:01
  • Is it possible to run this from within Windows? I have a savedefault in my grubconfig and after switching to Windows I'm now stuck in Windows.
    – exhuma
    Apr 22, 2021 at 9:20
2

Very similar error occurred with my Ubuntu 20.04 LTS (Focal Fossa) and my Windows 10 on the same SSD, after receiving the latest Windows 10 June 2020 update. The boot menu with grub was gone, the laptop only booted to Windows 10.

**This is how I solved: **I downloaded the Ubuntu ISO, burned to USB drive with Rufus, then booted up the laptop with this USB drive. I selected Try Ubuntu. Open terminal, then set the keyboard

setxkbmap <country_letters>

I was not able to recover the grub using the boot-repair utility, because it complained about a missing EFI partition at the beginning of the disk, which was there indeed.

**Finally this solution worked: ** Check the available partitions

sudo fdisk -l
Disk /dev/nvme0n1: 238,49 GiB, 256060514304 bytes, 500118192 sectors
Disk model: INTEL SSDPEKKF256G7L 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A1234567-6733-7263-BB45-5E83CFBE3430

Device             Start       End   Sectors   Size Type
/dev/nvme0n1p1      2048    534527    532480   260M EFI System
/dev/nvme0n1p2    534528    567295     32768    16M Microsoft reserved
/dev/nvme0n1p3    567296 259842047 259274752 123,6G Microsoft basic data
/dev/nvme0n1p4 498069504 500117503   2048000  1000M Windows recovery environment
/dev/nvme0n1p5 259842048 481527807 221685760 105,7G Linux filesystem
/dev/nvme0n1p6 481527808 498069503  16541696   7,9G Linux swap

Partition table entries are not in disk order.

Mount the EFI System partition, you may check what's there:

sudo mount /dev/nvme0n1p1 /mnt/

sudo ls /mnt/EFI/ubuntu

sudo stat /mnt/EFI/ubuntu/grubx64.efi

File: /mnt/EFI/ubuntu/grubx64.efi
Size: 1419128       Blocks: 2776       IO Block: 4096   regular file
Device: 10301h/66305d   Inode: 14          Links: 1
Access: (0700/-rwx------)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2020-06-25 02:00:00.000000000 +0200
Modify: 2020-06-25 19:24:06.000000000 +0200
Change: 2020-06-25 18:55:30.870000000 +0200
Birth: -

Then copy over the correct grubx64.efi from the USB drive, as recommended by Matthew Hegarty and adrianTNT above.

cp -p /cdrom/EFI/grubx64.efi /mnt/EFI/ubuntu/

Then reboot, remove your USB and you should be fine. (At least I hope I'm fine... :) )

1
  • 1
    In my case boot-repair did the job. Try boot-repair first before implementing above suggestions.
    – sugab
    Jan 6, 2021 at 2:25
1

Just search for the file and copy it to the location in error.

After some updates and power failures, a HP 8200 was complaining about EFI\BOOT\grub64.efi not being found at boot. I put the SSD in another computer (newer motherboard), this booted just fine, maybe it does a search for the .efi files (?!) So I was able to login, I did a search for the missing file name, copied it to the location in error and it booted just fine:

find /boot -name grubx64.efi

/boot/efi/EFI/centos/grubx64.efi

cp /boot/efi/EFI/centos/grubx64.efi /boot/efi/EFI/BOOT/grubx64.efi

The error just said "EFI\BOOT\" but full directory was: "/boot/efi/EFI/BOOT/".

I guess the copy can also be done by putting the hdd in another linux machine.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .