The Windows boot loader file, which is normally EFI/Windows/Boot/bootmgfw.efi
, must exist on the ESP for Windows to boot. You say you replaced this file with a copy of grubx64.efi
, but you don't say what you did with the original file. If you overwrote it, then Windows can't boot unless/until you restore the original file. (You can restore the file to another name, as described shortly.) If you've got a backup, you can restore it from that. If not, then I suggest you ask on a Windows forum about restoring the original file. You can then start over, being more careful with that original file.
If you renamed the original file, you should be able to edit GRUB's configuration to launch the file using its new name. The best way to do this, if you stick with GRUB, is to edit /etc/grub.d/40_custom
to include something like this:
menuentry "Windows" {
insmod part_gpt
insmod chain
set root='(hd0,gpt1)'
chainloader /EFI/Microsoft/Boot/bootmgfw.efi
}
You must change the partition ID [(hd0,gpt1)
-- that is, the first partition (gpt1
) on the first hard disk (hd0
)] in this example to match your ESP. You must also change the boot loader filename, which this example shows as the default filename, which of course you've changed.
After creating or editing /etc/grub/40_custom
, you must type sudo update-grub
. This transfers these changes, along with other GRUB settings, to /boot/grub/grub.cfg
. (You could edit that file directly, but then your edits will be wiped out whenever GRUB updates its configuration, such as after an automatic kernel update.)