How can I boot from a EFI GRUB installation on a disc A a Windows 10 BIOS installation on a disk B?

Long explanation
os-prober is not detecting Windows anymore after having migrated Ubuntu from MBR+BIOS to GPT+EFI.

My disk situation is a little complicated:

sda                    1,8T                              
└─sda1      ext4       1,4T /media/Steam                 Steam
sdb                  931,5G                              
├─sdb1      vfat       512M                              
├─sdb2      ext4       125G                              home
├─sdb3      ext4     774,5G /media/Dati_ext4             Dati_ext4
└─sdb4      ext4      31,5G                              Ubuntu18.04
sdc                  232,9G                              
├─sdc1      ntfs       100M                              
├─sdc2      ntfs        59G                              Win10
├─sdc3      ntfs       483M                              
└─sdc4      ntfs     172,9G                              Dati_NTFS
nvme0n1                477G                              
├─nvme0n1p1 ext4      62,4G /                            Ubuntu19.10
├─nvme0n1p2 vfat       200M /boot/efi                    EFI
└─nvme0n1p3 ext4     322,1G /home                        home
  • I have 4 disks (1 NVMe and 3 SSDs).
  • Before today they were all using MBR and the UEFI was booting the NVMe in legacy mode.
  • I have 2 installation of Ubuntu (19.10 and 18.04) and 1 of Windows 10.
  • Each OS has it's own disk (and the 4th disk as no OS installed). This means that each OS had its own boot loader installed on the MBR of each disk.
  • GRUB was also able to see every other OS so, from the GRUB of the NVMe, I was able to boot any of the 3 OSs.

Today I decided to convert the NVMe installation of Ubuntu form MBR+BIOS to GPT+EFI. Since I did not touch any other disk, I was hoping that the GRUB will detect the other OSs and boot them normally.

The conversion worked fine and I'm able to boot in Ubuntu 19.10. But os-prober recognize Ubuntu 18.04 but not Windows 10.

What I would like to do is either to find a fix for os-prober, so that it recognize Windows, or to manually specify the GRUB configuration to boot the Windows MBR+BIOS installation.

I already tried something for the second approach but it didn't worked. I added this to the /etc/grub.d/40_custom of the EFI installation:

menuentry 'Windows 10 (su /dev/sdc1)' --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='hd2,msdos1'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-bios=hd2,msdos1 --hint-efi=hd2,msdos1 --hint-baremetal=ahci2,msdos1  C08E2C498E2C3A74
      search --no-floppy --fs-uuid --set=root C08E2C498E2C3A74
    parttool ${root} hidden-
    drivemap -s (hd0) ${root}
    chainloader +1

I took that from the working Ubuntu 18.04 GRUB MBR+BIOS installation.

But when I select Windows 10 from the GRUB menu I get just this error:

Setting partition type to 0x7
error: can't fine command `drivemap'.
error: invalid EFI file path.

Is it even possible to boot from an EFI GRUB a BIOS installation on a different disk of Windows 10?


Short answer, you can't boot a legacy Windows from UEFI grub. Once grub boots, the boot mode has been set to UEFI, and your Windows is in legacy mode, so cannot boot. You can select the device Windows is on (presumably with its own boot loaders), and boot that from the EFI boot menu (some function key at power-up to allow you to select boot device/OS). You could have either another grub installation or Windows boot successfully off that second disk, which would be in legacy mode. Try just booting the second disk, Windows may come up.

  • I ended up converting the Windows 10 installation to GPT+EFI using mbr2gpt /convert /allowFullOS. Now os-prober correctly sees it and GRUB boots it. – Roberto Leinardi Sep 27 '19 at 23:39
  • Could be some interesting warnings to put during installation.. – levesque Mar 19 '20 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.