1

/EFI/Microsoft/Boot/bootmgfw.efi not found

I ran the sudo grub-update and rechecked my etc/grub.d/40_custom file settings. Now it is executing the 40_custom file but apparently I have a error in how it boots into Windows 10 Pro. The 40_custom is executable ls -la etc/grub.d/40_custom -rwxr-xrwx 1 root root 360

But the /EFI/Microsoft/Boot/bootmgfw.efi is not found.
grub comes up with the following menu

*Ubuntu
Advanced options for Ubuntu
UEFI Firmware Settings
Windows X Homer Simpson

selecting Windows X Homer Simpson results in the following:

 error: unknown filesystem
    Press any key to continue...

so I hit 'Esc', it goes to the grub menu, e.g. grub> I type 'exit' it goes to fwupd-EFI version 1.4 and then after 10 seconds or so boots Windows 10 Pro 64 bit which is what I want.

So I'm making progress I just need to figure out the correct Windows bootloader yes it is /dev/nvme0n1p1 Also identified as hd0,gpt1 from the Grub menu.

Device             Start        End   Sectors   Size Type
/dev/nvme0n1p1      2048    1968127   1966080   960M EFI System
/dev/nvme0n1p2   1968128  212905983 210937856 100.6G Linux 
filesystem
/dev/nvme0n1p3 212905984  466812927 253906944 121.1G Linux swap
/dev/nvme0n1p4 466812928 1000214527 533401600 254.3G Linux 
filesystem

Background Have an Ubuntu 22.04 system which runs on a modern HP Z4 G4 Server (64 GB). I have a very old (20 yrs?) Desktop computer running Windows-10, booting from a new SSD (1TB) and with a 2 TB data HDD.

Moved my 2 Windows drives to my HP Server to have it duel boot Windows & Linux.

I've followed the instructions on this link: How can I add Windows 11 to grub menu?

I scanned my drives and added the UUID of the Windows boot drive (SSD,1.0 TB WDC) to the file etc/grub.d/40_custom

grub

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0

GRUB_TIMEOUT_STYLE=hidden

GRUB_TIMEOUT_STYLE=menu GRUB_TIMEOUT=20 GRUB_DISTRIBUTOR=lsb_release -i -s 2> /dev/null || echo Debian GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" #GRUB_CMDLINE_LINUX="" GRUB_CMDLINE_LINUX="Ubi 22.04"

Uncomment to enable BadRAM filtering, modify to suit your needs

This works with Linux (no patch required) and with any kernel that obtains

the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)

#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

Uncomment to disable graphical terminal (grub-pc only)

#GRUB_TERMINAL=console

The resolution used on graphical terminal

note that you can use only modes which your graphic card supports via VBE

you can see them in real GRUB with the command `vbeinfo'

#GRUB_GFXMODE=640x480

Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux

#GRUB_DISABLE_LINUX_UUID=true

Uncomment to disable generation of recovery mode menu entries

#GRUB_DISABLE_RECOVERY="true"

Uncomment to get a beep at grub start

GRUB_INIT_TUNE="480 440 1"

GRUB_INIT_TUNE="640 440 1 330 1 277 1 880 1"

GRUB_INIT_TUNE="950 392 3 0 6 392 3 0 6 466 3 0 3 523 3 0 3 392 3 0 6"

40_custom
#!/bin/sh exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after this comment. Be careful not to change # the 'exec tail' line above.

menuentry 'Windows X Homer Simpson' {

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

else

search --no-floppy --fs-uuid --set=root XXXX-XXXX

fi

chainloader /EFI/Microsoft/Boot/bootmgfw.efi }

1 Answers1

0

I have a rig with 24.04 alongside WIN10. If memory serves I just modified the config file /etc/default/grub and set: -

GRUB_DISABLE_OS_PROBER=true

To

GRUB_DISABLE_OS_PROBER=false

I also added the same line as the last uncommented thing in the file. I am not sure why now.

You then have to update grub.

sudo update-grub

If you have secure boot enabled I believe grub will check this and will not add anything that it cannot verify as such.


It worked for me.


Extra1

Just to check the file you modified as described above is: -

/etc/default/grub

Can you try to boot with Secure boot switched off? (I assume it is enabled?) Clearly there is a risk involved which you will have to assess and take precautions. It will not add WIN10 if it cannot verify the target with its security keys. (At least it doesn't on mine.)

To check if your modified 40_custom is being picked up you could add something that you know already works. You could try adding another copy of the Ubuntu you already have. (I have never tried this so I am not sure if grub will duplicate but it is worth a try.)

You can obtain a menu entry from the /boot/grub/grub.cfg but be very careful not to modify this file although I would think a 'update-grub' would regenerate it.

You might like to check that your 40_custom file is still executable. you can do this with: -

 ls -la /etc/grub.d/40_custom

-rwxr-xr-x 1 root root 214 Apr 4 11:12 /etc/grub.d/40_custom

Detail on using custom grub: -

https://help.ubuntu.com/community/Grub2/CustomMenus

I hope this is of some help.

Extra2

My grub compared...

Note: This is copied 1 char at a time from a second machine.

insmod part_gpt
insmod fat
set root='hd0:gpt4'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0:gpt4 --hint-efi=hd0:gpt4 --hint-baremetal=ahci0:gpt4 XXXX-XXXX
else 
search --no-floppy --fs-uuid --set=root XXXX-XXXX
fi
chainloader /EFI/Microsoft/Boot/bootmgfw.efi

I note, in particular that there is no '(${root})' in the chainloader line.

I thought this also might help.

Extra3:

In your Custom_40 you don't seem to have set root anywhere, (see the copy of my grub Win10 boot script above).

set root='hd0:gpt4'

That is grub for my UEFI partition. Try and add that to your 40_custom pointing at your UEFI and see if that makes it work.

You will probably need the insmod commands (see above) to make this bit work too.

To find out what grub calls each disk/partition see: -

https://superuser.com/questions/1258525/how-do-i-list-my-devices-in-grub

Get to grub menu and then type 'c' to get to grub prompt. Then type ls -l then ls (hd0,1)/ (Substituting your selected disk at start) should list UEFI directory tree. Might need the insmod stuff again here.)

Hope this is of some help.

david
  • 937