How to make EFI grub2 chainload to legacy Windows
Efter reinstalling Fedora, I cannot persuade grub2 to boot Windows.
I have a system with a 1TB harddisk (HD) and a 500GB solid state disk (SSD).
If I ask the bios to boot from SDD then Windows starts.
If I ask the bios to boot from HD then first grub2 and then Fedora starts.
But I cannot persuade grub2 to boot Windows.
I installed Windows and then Fedora five years ago using msdos partitions on both disks. Then my Fedora became unstable and tainted, so I decided to make a fresh install of Fedora, leaving Windows as it was. So I downloaded a fresh Fedora 30/spin xfce
installer to a USB stick, asked the installer to wipe my Fedora partitions, and left partitioning to the installer.
BACKGROUND:
Mapping:
/dev/sda = grub hd0 = 1TB HD
/dev/sdb = grub hd1 = 500GB SDD
What Fedora has to say
> cat /etc/fedora-release
Fedora release 30 (Thirty)
> sudo fdisk /dev/sda
...
/dev/sda1 2048 908550143 908548096 433,2G 7 HPFS/NTFS/exFAT
/dev/sda2 1932550144 1953521663 20971520 10G 27 Skjult NTFS Win
/dev/sda3 * 908550144 908959743 409600 200M 6 FAT16
/dev/sda4 908959744 1932550143 1023590400 488,1G 5 Udvidet
/dev/sda5 908961792 911058943 2097152 1G 83 Linux
/dev/sda6 911060992 1932550143 1021489152 487,1G 8e Linux LVM
...
> sudo fdisk /dev/sdb
...
/dev/sdb1 * 2048 2099199 2097152 1G 7 HPFS/NTFS/exFAT
/dev/sdb2 2099200 732899327 730800128 348,5G 7 HPFS/NTFS/exFAT
/dev/sdb3 732899328 937701375 204802048 97,7G 8e Linux LVM
...
> sudo head -c 11 /dev/sdb1 | tail -c 8
NTFS
> sudo ls /boot/efi
'$RECYCLE.BIN' EFI mach_kernel System 'System Volume Information'
> sudo ls /boot/efi/EFI
BOOT fedora
> sudo ls /boot/efi/EFI/fedora/grub.cfg
/boot/efi/EFI/fedora/grub.cfg
What grub2 has to say
grub> ls
(hd0) (hd0,msdos6) (hd0,msdos5) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1)
(hd1) (hd1,msdos3) (hd1,msdos2) (hd1,msdos1)
(hd2) (lvm/fedora_localhost--live-root) (lvm/fedora_localhost--live-home)
(lvm/fedora_localhost--live-swap)
grub> ls (hd0,msdos3)/
efi/ System/ mach_kernel/ System Volume Information/ $recyclebin/
grub> set root=(hd1,msdos1)
grub> chainloader +1
error: ../../grub-core/loader/efi/chainloader.c:156:invalid EFI file path.
PROBLEM:
As said, I cannot persuade grub2 to boot Windows.
I try to boot Windows from the grub command prompt (if I tamper with
/etc/grub.d/40_custom
I often end in a state where I have to reboot from
my USB stick and replace /boot/efi/EFI/fedora/grub.cfg
by a backup).
If I read the invalid EFI file path
error correctly, grub2 is in some sort
of “EFI” mode and refuses to chainload to a legacy disk.
When I boot from SDD, Windows clearly boots from the MBR of the SDD.
When I boot from HD, I have no idea how grub2 is invoked.
But I have asked the bios to try legacy mode first and then EFI.
QUESTION:
Is there a way to persuade grub2 to boot Windows in my situation?
Or do I have to make yet another fresh install of Fedora 30, wiping my
Fedora partitions, and making some clever choice (which) other than
automatic partitioning?