0

I have previously had Windows 10 and Ubuntu installed with grub being able to dual boot to Windows and to Ubuntu. I have decided to reinstall Ubuntu due to reasons and unfortunately, it installed wrong grub configuration. Now I am not able to boot to Windows, it is not seen from grub (or os-prober).

I have multiple disks, Windows is installed on one SSD (sdc) and Linux has its own HDD (sda).

I think I have tried multiple answers from askubuntu.com, however none of them have worked so far and I feel more lost regarding which configuration everything is installed in, whether legacy or uefi, especially because it was working previously.

I am attaching my boot-repair report: boot-repair report

From the report I can see that Windows is detected, when I tried using Windows Live Disk to use cmd bootrec /FixMbr, it succeded, but nothing changed. Automatic repair did not. Also the report states that sdc1 has Boot files:

  • /bootmgr
  • /Boot/BCD

In GParted I can see that /sdc1 has flags boot.

Boot-repair has suggested steps which it cannot do by itself, so I tried that way. I booted from live usb and started following instructions. At one point, they wanted to manually remove grub, which I was unable to do, due to apt wanting cdrom inserted - askubuntu

I have tried to boot directly from Windows disk, then I receive error no such device, unknown filesystem: enter image description here

Do you know how I can fix this and get my proper boot configuration? I have tried changing BIOS legacy / uefi settings but I'm unsure how and what would be best configuration - bios page

I do want to keep my Windows installation, but I am fine to reinstall ubuntu once again to do it properly, with grub seeing Windows, but I don't know if reinstallation with current configuration would change anything.

Rad
  • 35

1 Answers1

2

Ubuntu is installed in EFI mode, but Windows is installed in legacy BIOS mode

GRUB can't chainload a legacy BIOS bootloader when in EFI mode, and vice versa. This means that Windows is not being added to the GRUB boot menu.

To resolve this issue, either GRUB must be re-installed in legacy BIOS mode, or the Windows installation needs to be converted to boot using EFI.

To detect Windows Boot Manager in EFI boot mode, GRUB searches the EFI System Partitions (ESPs) for bootmgfw.efi. According to the output from Boot-Repair, this file is not present; the disk that Windows is installed to contains a legacy BIOS MBR, and no ESP.

Converting a Windows installation to EFI

Considering OP wishes to upgrade to Windows 11 in the future, the best solution would be to convert the Windows installation to EFI boot.

From a Windows installation (preferably the Recovery environment from that installation, otherwise you will need to supply the /allowFullOS switch to force conversion), or from a Windows PE environment such as the Windows installer, you can run mbr2gpt to convert the Windows disk in to a GPT partition table, and create the ESP.

From the recovery environment of the Windows installation which is to be converted, the system disk is the disk to be converted, so identifying the disk number, and supplying the /disk:<number> argument, is not necessary.

Otherwise, the disk number is identical to the one shown in diskpart. You can run list disk in diskpart from a Command Prompt to identify your disk number:

X:\Windows\System32>diskpart

Microsoft DiskPart version 10.0.19041.964

Copyright (C) Microsoft Corporation. On computer: ...

DISKPART> list disk

You can then type exit to return to the Command Prompt.

Validate the conversion

Before you convert the disk, you must check to see if the disk can be converted, via the /validate switch.

From the Command Prompt:

X:\Windows\System32>mbr2gpt /validate /disk:<number>

If the disk is eligible for conversion, you will see:

MBR2GPT: Validation completed successfully

Perform the conversion

If all is good, and you are confident you have selected the right disk, you can then proceed with the conversion:

X:\Windows\System32>mbr2gpt /convert /disk:<number>

If all goes well, you will see these messages:

MBR2GPT: Conversion completed successfully
MBR2GPT: Before the new system can boot properly you need to switch the firmware to boot to UEFI mode!

If you reboot your system, your Windows installation may start booting over Ubuntu. Once Windows has booted up successfully, you can shut down Windows and select Ubuntu from the boot selection menu in your system firmware.

Updating the GRUB boot menu

Open up a Terminal, then run update-grub:

$ sudo update-grub

You should see Windows Boot Manager added to the GRUB boot menu. If so, you can now disable legacy BIOS boot in the system firmware.

Note also that there should be a Windows Boot Manager entry in your firmware's boot device selection menu. If there isn't, you need to run bootrec /FixMBR to add the option to NVRAM when Windows has booted in EFI mode. This may place the Windows Boot Manager entry higher in the boot order than Ubuntu. To reverse this, from a Terminal, list the NVRAM boot option entries:

$ sudo efibootmgr

Identify the number that corresponds to Ubuntu, then copy the BootOrder, moving Ubuntu to the beginning, and paste it in to the command, i.e., if the boot order is 0001,0002,0003, and Ubuntu is 0003, run:

$ sudo efibootmgr -o 0003,0001,0002

Ubuntu will now boot as the first operating system starting from the next reboot.

galexite
  • 614
  • 4
  • 8