0

I have a new computer with 2 nvme drives. I initially install windows 10 on one of the drives. Did not notice, but during the installation windows 10 placed its UEFI partition in the disk that was intended for Ubuntu (not in the windows SSD). I installed Ubuntu (with zfs) on the second disk. As expected, this type of installation wiped out the windows UEFI partition. I was able to repair the windows 10 boot and I am able to boot windows directly by selecting the windows disk from the bios boot menu or by using efibootmgr -n and selecting the windows partition. I was not able to add windows to grub. os-prober did not detect the windows partition. Then manually I edited the /etc/grub.d/40_custom file as follows:

menuentry "Windows 10" --class windows --class os {
   insmod ntfs
   insmod chain
   insmod search_fs_uuid
   search --no-floppy --set=root --fs-uuid D474C38D74C370B2
#   ntldr /bootmgr
#   chainloader /bootmgr
    chainloader +1
}

Everything up to the last line was verified to be correct, when testing in the grub rescue shell.

if I use ntldr /bootmgr then grub is complaining that it cannot find ntldr. None of the chainloader lines listed above work as well. Any ideas ho to fix.

user63726
  • 714
  • 1
    Are both systems installed in UEFI boot mode? Grub also only boots working Windows which means fast start up must be off and chkdsk not required. The bootmgr is a BIOS boot loader file. Windows uses /efi/Microsoft/Boot/bootmgfw.efi for UEFI boot. Microsoft has required vendors to install in UEFI mode to gpt partitioned drives since 2012. – oldfred Feb 15 '21 at 17:32
  • Ubuntu and windows were installed originally as UEFI. I suspect that when I recovered windows it created and MBR partition. The BIOS does not detect windows UEFI. only Ubuntu.I can boot windows by selecting the Disk in the bios or with efibootmgr -n. I'd like to add it to the grub menu as well. The windows disk does not have UEFI partition. /efi/Microsoft/Boot/bootmgfw.efi is not in the Ubuntu UEFI partition or Windows partition. Is there a way to make windows use the Ubuntu UEFI partition. – user63726 Feb 16 '21 at 18:32
  • UEFI & BIOS/CSM/Legacy are not compatible, they write configuration data to drive for operating system differently. You can only boot from UEFI boot menu, not from grub. And Windows in UEFI must have gpt and in BIOS must have MBR(msdos) partitioning. Conversion from MBR to gpt. typically erases drive, so be sure to have good backups. Better then to have Windows in UEFI boot mode which would be a new install & conversion of drive from MBR to gpt. – oldfred Feb 16 '21 at 19:24
  • Ubuntu is GPT partition but windows (fresh install) was installed as msdos partition. Since I wiped out the windows EFI partition. Is there a way to recreating it within the Ubuntu efi partion. This is actually how it is done when windows and Ubuntu share the same disk. Or if even better. Can I resize the windows partition and add some some space in the beginning of the disk for UEFI partition. – user63726 Feb 16 '21 at 21:02
  • You cannot have msdos partition, but have to have a MBR(msdos) drive. Same with gpt, entire drive is gpt partitioned. And Windows only installs & boots from gpt with UEFI, Ubuntu will let you install to a MBR drive but boot from an ESP, either on MBR or gpt. Windows does not allow that. How you boot install media, UEFI or BIOS for both Ubuntu & Windows is then how it installs and how it repairs if wanting to make repairs. A Windows UEFI boot will not repair a BIOS/MBR install. – oldfred Feb 16 '21 at 21:12
  • Does this answer your question? Add Windows 10 to GRUB OS list – karel Feb 20 '21 at 00:25

1 Answers1

0

All I had to do was to convert the windows from mbr to gpt using this link [https://www.maketecheasier.com/convert-legacy-bios-uefi-windows10/]1

and then run update-grub. I did not loose any of my files or setup in the main windows to partition, but my recovery partition WinRE is damaged.

user63726
  • 714