Dualboot Ubuntu/Windows: "Error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found"

24,634

Solution 1

I'm not sure whats the exact way to solve this problem. But I tried a few thing and finally came up with a solution! So at least a small summarize:

At some point I felt like I had completely messed up the UEFI. When booting the laptop mouse and keyboard were flashing once before they turned them self off again just before even GRUB or UEFI could be loaded. And when trying to boot from a USB stick I also got stuck with a blank screen. So I decided to simply reset the UEFI to factory standards. This solved the problems with mouse, keyboard and USB stick!

To solve the actual problem

error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found

I decided to give it a try and edit /boot/grub/grub.cfg as mentioned in my first post. I changed just this one single line, nothing else! This made it working for me! So now I can boot into Ubuntu and Windows 10 again from GRUB. The only thing I'm actually wondering about is where I got this file at /EFI_PRE_RESCATUX_2020-09-01-20-46-59/Microsoft/Boot/bootmgfw.efi from. Yes it looks a lot like Rescatux is responsible for this but I don't know exactly what I did that rescatux created this backup file.

Good luck if you're facing a similar problem! :)

Solution 2

It is work for me.

  1. Create a bootable windows 10 USB.
  2. Select USB from boot menu.
  3. "Repair your computer" > Troubleshoot > Startup Repair.
  4. Done

It take few seconds. :)

Solution 3

I had the same problem as Tayfe(top most post), suddenly when ever i selected windows 10 from the grub boot menu this error popped up "error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found".

I tried editing the grub.cfg file as mentioned above but it did not help.

The efi file was there when i browsed to the location using file explorer its just that during booting it was not being found.

What i did to fix it was (first from boot menu disabled secure boot)(edited)

1.Created a bootable windows 10 usb

1a.downloaded the windows 10 iso from windows official website.

1b.Used balenaEtcher(this is the only rufus alternative i found for ubuntu) to create a bootable windows 10 media.

  1b1.First format the usb.

  1b2.Then using Gparted(in device tab in Gparted) create a new partition table (type of partition == GPT ).

  1b3.then created a new partition of fat32 type(allocated all the space to this partition so there is only a single partition on the usb)

1bc.Used balena etcher to etch the windows 10 iso file onto this usb(it gave a warning regarding the iso that it might not get recognised ignore it(i did)).

2.Now once u have a bootable windows 10 usb, restart the pc and when u are in the grub boot menu press c to enter the command line.

3.Press ls.

4.It will show all the harddrives on the pc.

5.My usb was (hd0) (yours may appear different but u can find it by first doing the "ls" part without having the usb inserted then again with the usb inserted) or like in the next step

6.to see the detail about a harddisk (eg for the (hd0) do "ls (hd0)" it will show you the details , i knew this is my bootable usb by comparing the size and also the name, eg for (hd1,msdos) run "ls (hd1,msdos)" like this).

7.Now run "set root=(hd0)" your "(hd0)" part may be diff.

8.now run "ls -l /"

9.this will show all the files on the root which is the usb now

10.if there is a "efi" DIR then everything is fine and u can follow along.

11.now just check "ls -l /efi/boot/" has an efi file or not mine showed me a file bootx64.efi when i ran this command.

12.You can also make sure your path "/efi/boot/bootx64.efi" is a correct path by opening the usb in ubuntu first and going to this path from the file explorer to check everything

13.So after the run root=(hd0) command, run this command "chainloader /efi/boot/bootx64.efi"

14.then if the command ran okay, run "boot".

15.this will boot into windows 10 installation, follow this link (https://www.thewindowsclub.com/boot-or-repair-windows-10-using-the-installation-media) from step number 3 or the instructions below

15a When you boot from the USB drive, it will kickstart Windows 10 installation. Do not have a craving to keep hitting next, or you will end up installing Windows. On the first installation screen, look for a link “Repair your computer.” Click on it. It will boot your computer into Advanced Recovery.

15b When at the advanced troubleshooting, select Advanced Options. Select Troubleshoot. Under Advanced options screen, you will see Startup Repair. Click on it and follow the instructions.

16.I followed all this and my error was fixed, hope the same happens for you.

Solution 4

Here's a much simpler alternative. It worked like a charm for me and can probably save thousands of other desperate souls.

  1. Download this file and save it in the Downloads folder.

  2. Save your Home Path in /tmp/home.txt:

    sudo echo "$HOME" > /tmp/home.txt
    
  3. Then run:

    sudo -s
    
  4. Export variable HOMEOLD:

    sudo export HOMEOLD=$(cat /tmp/home.txt)
    
  5. Copy .tar.gz file to EFI directory:

    sudo cp $HOMEOLD/Downloads/WindowsBoot.tar.gz /boot/efi/EFI
    
  6. Enter the EFI directory:

    cd /boot/efi/EFI
    
  7. Decompress .tar.gz file:

    sudo tar -xzf WindowsBoot.tar.gz
    
  8. Delete .tar.gz file:

    sudo rm WindowsBoot.tar.gz
    
  9. Reboot and voilà!

    sudo reboot
    

Credit to Vinicius Rolins, a random Brazilian YouTuber who shared this solution in his channel, he also published a tutorial in Portuguese)

Solution 5

Seems like each answer has a completely different experience with resolving this issue. Mine was quite more simple: I checked whether I had any space left on the /boot/ device with df -h, and it was completely full. I had several FSCKXXXX.rec inside /boot/efi (which I acessed with root after running sudo su), which were probably some leftover from previous inadvertent disk checks. I removed them all, disk was not full anymore and I could boot Windows again without further issues.

Share:
24,634
Tayfe
Author by

Tayfe

Updated on September 18, 2022

Comments

  • Tayfe
    Tayfe over 1 year

    I have a dualboot system with Ubuntu 20.04 and Windows 10 on one harddrive. Everything worked well for the last 4 weeks until an hour ago:

    All of the sudden I got this error when trying to start Windows from GRUB:

    error: file '/EFI/Microsoft/Boot/bootmgfw.efi' not found
    

    What can I do about this problem?

    What I tried and checked so far:

    • Updated grub
    • Checked the given file: it does exist! And it got a size of 1558328 bytes so it's not empty
    • Followed this answer and tried boot-repair as well as Rescatux (Reinstall Mictrosoft Windows UEFI)

    Here is a report of my current boot setup as analyzed by boot-repair.

    None of those trys fixed it so far. Has anyone got a solution or at least something to try?

    [EDIT]

    So what I achieved so far is that I'm able to boot into both OS again using UEFI. When pressing DEL on startup I can use the UEFI's boot menu to boot into grub (and into ubuntu from there) or into windows. But when starting into grub and trying to start windows from there I still get the same error message. Here is another boot report as analyzed by boot-repair. As you can see on line 97

    Boot0011* (Rescapp) bootmgfw.efi    HD(1,GPT,84e08278-2d18-4a4c-9885-fde204e033e6,0x800,0x32000)/File(\EFI_PRE_RESCATUX_2020-09-01-20-46-59\Microsoft\Boot\bootmgfw.efi)
    

    there is an entry on UEFI to boot into windows. But this entry uses a backup of the EFI to boot into windows. GRUB instead uses a more recent file to try to boot windows as you can see here in the grub.cfg file:

    ### BEGIN /etc/grub.d/30_os-prober ###
    menuentry 'Windows Boot Manager (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-efi-92CE-E05A' {
        insmod part_gpt
        insmod fat
        set root='hd0,gpt1'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt1 --hint-efi=hd0,gpt1 --hint-baremetal=ahci0,gpt1  92CE-E05A
        else
          search --no-floppy --fs-uuid --set=root 92CE-E05A
        fi
        chainloader /EFI/Microsoft/Boot/bootmgfw.efi
    }
    set timeout_style=menu
    if [ "${timeout}" = 0 ]; then
      set timeout=10
    fi
    ### END /etc/grub.d/30_os-prober ###
    

    I though about simply changing line

    /EFI/Microsoft/Boot/bootmgfw.efi
    

    to

    /EFI_PRE_RESCATUX_2020-09-01-20-46-59/Microsoft/Boot/bootmgfw.efi
    

    but on top of the file it says that you shouldn't edit this config file so I dont dare to do so. Could it break anything? And why does only the backed up version works and not the recent one? My whole boot setup looks a little messed to me.

    • oldfred
      oldfred over 3 years
      Did Windows do an update & turn fast start up back on? Grub only boots working Windows or Windows that is not hibernated nor needs chkdsk. But it does not look like you have an UEFI Windows boot entry to directly boot it from UEFI. See IV for UEFI entry using efiboomgr. askubuntu.com/questions/486752/… See also man efibootmgr
    • Tayfe
      Tayfe over 3 years
      Windows did at least some updates. I turned it off and restarted shutdown and restart into windows two times. After hat I started ubuntu and boot-repair. But the status summary still says: Windows is hibernated, refused to mount. Falling back to read-only mount because the NTFS partition is in an unsafe state. Please resume and shutdown Windows fully (no hibernation or fast restarting.). Seems like something went wrong there? I followed this instruction [asus.com/us/support/FAQ/1031533/] When I start into windows the logo appears so I does a least look like if it's deactivated
    • Tayfe
      Tayfe over 3 years
      And Rescatux somehow got me an UEFI entry to directly boot into windows from UEFI so at least I'm able to use windows again. But I got no clue how it did it, how I can fix grub to do the same. And for some reason I can't boot from my US stick with Rescatux anymore? It's shown in the list in UEFI [imgur.com/a/9GwYE7P] but when clicking there's just a black screen for like a second and my the laptop returns to the UEFI menu again.
    • oldfred
      oldfred over 3 years
      What brand/model system? What video card/chip? Sometimes during install something gets written to flash drive, so it does not work and needs to be recreated. Black screen is usually video issue. askubuntu.com/questions/162075/…
    • Tayfe
      Tayfe over 3 years
      I got a laptop "HP Elitebook 840 G3" with Intel 6200U and HD520. But I doesn't feel like a problem related to the graphic card since it's always working. The black screen seems rather to be a booting issue
    • oldfred
      oldfred over 3 years
      Is yours like this one? HP Elitebook 840 G5 gpt issues - HP put a fail-safe gpt recovery into the UEFI Settings, go into the UEFI Menu in Security -> Hard Drive Utilities -> Uncheck "Save/restore GPT System of Hard Drive" ubuntuforums.org/showthread.php?t=2436271
  • Tanvir
    Tanvir about 3 years
    Thanks for the detailed steps. It worked.
  • codetiger
    codetiger about 3 years
    This worked for me!!!
  • Giovanne Afonso
    Giovanne Afonso over 2 years
    Worked for me, thank you so much!
  • Jackssn
    Jackssn over 2 years
    Thank you, it's my case