5

Background

I have a Windows 10 machine with a SSD where I have installed Ubuntu LTS 20.04. This setup worked wonderfully for months. When I turn my machine on I get to choose which operative system to use.

Problem

That is, until yesterday. Yesterday I logged on my Windows boot, did nothing special and then turned the machine off. Windows probably installed some updates after I left.

Today I turned my machine on and realized I couldn't log on to my Ubuntu partition, where all of my work is:

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

Research

I did some searching around but it looks like this problem has a specific solution for each case.

So I installed Boot-repair, and got the following diagnostics link:

https://paste.ubuntu.com/p/TdbRzdmQsZ/

I didn't run the "Recommended Repair" option yet, as this was discouraged in a similar problem in favor of asking advice to the community first:

Error: "Failed to open \EFI\BOOT\grubx64.efi..." (Dual-Booting)

Questions

My Ubuntu partition is where all of my work is. I cannot stress the importance of this dual boot working properly. With this in mind I have the following questions:

  • How can I fix the issue now?
  • How can I prevent it from ever happening again?
Flame_Phoenix
  • 1,071
  • 5
  • 16
  • 32

4 Answers4

6

As the error states, you are missing grubx64.efi in the UEFI directory EFI/ubuntu. How that happened is anyone's guess, since a bad install would not have been working for months.

To fix, just copy grubx64.efi to the EFI/ubuntu directory. Your install media should have a copy. from the install media, you can mount the UEFI partition, say at /mnt, so the copy target would look like /mnt/EFI/ubuntu/grub.x64.efi (caps matter, make the target match what is actually there).

Your UEFI partition (ESP) is on nme0n1p1, from the running install media, mount it at /mnt:

sudo mount -tvfat /dev/nvme0n1p1 /mnt

You should now see the location you need to put the grubx64.efi file in /mnt/efi/ubuntu. Take a look with ls, you should have shimx64.efi and grub.cfg there already according to your boot-repair report.

Copy grubx64.efi to that location. The install media should have a copy of grubx64.efi in /EFI/boot/grubx64.efi, so the command is:

sudo cp /EFI/boot/grubx64.efi /mnt/efi/ubuntu 

Unmount the /mnt, remove the install media, and reboot. With grubx64.efi present in the same directory as shimx64.efi, the grub UEFI boot should work.

ubfan1
  • 19,049
1

I recently stumbled on this thread and followed through with the boot repair solution. It has worked perfectly, even with a difference between my ubuntu version (24) and my usb flash drive ubuntu version (22).

  1. Boot from flashdrive
  2. "Try Ubuntu"
  3. Connect to wifi
  4. Install boot repair tool
  5. Perform suggested repairs (frequent problems)
  6. Once done, reboot computer
  7. Grub appears and my ubuntu partition is there
schmat_90
  • 113
0

Grave robber comment: Come here for the same error when upgrading to 23.10 from 23.04 on my very old laptop.

Windows still booted so it clearly was an ubuntu error...

For me the problem was that the "grub-efi" package was not installed.

Booted from live usb, did the chroot stuff, inkl. the mount --bind stuff, installed the missing package, and undid all (or most...) the changes before and it worked.

Interesting ways that efibootmgr didn't work in the chroot environment, so that needed an extra reboot.

A. Rabus
  • 101
0

What da Falkirk Windows? This is not cool. Had been happily running dual boot with Windows 11 and Linux Mint 21.3 Cinnamon for years, then ran into this problem (after having been booted into Windows). The paths were slightly different for me - boot into live distro, then:

sudo mount -tvfat /dev/nvme0n1p1 /mnt
sudo cp /cdrom/efi.factory/boot/grubx64.efi /mnt/EFI/ubuntu 

Reboot, and all was good.

markmuetz
  • 101