After installing Ubuntu 22.04 on my PC I had problems booting Windows 10 via the GRUB Bootloader. This tutorial can help you to fix your Windows 10 Bootloader and GRUB Bootloader.
1. Boot Windows 10 from a USB device
Download Windows 10 from the Microsoft Website and create a bootable USB stick with Windows 10. This is very easy with the Windows Tool.
Insert the USB stick into your PC and boot Windows 10 from the USB stick. You might need to select the USB stick as booting device in your BIOS.
2. Repair your Windows Master Boot Record with the USB device
If you are using Windows 11 or Windows 10, when your PC boots from the USB stick, you will be asked to select the keyboard layout you want to use. When this happens, click or tap the layout that matches your keyboard. On the next screen, click or tap „Troubleshoot (reset your PC or see advanced options)“. Go to the „Advanced Options“ and then the „Command Line Prompt„.
3. Command Line Prompt
In your command line type and run this command to repair the corrupted or damaged Master Boot Record (MBR):
The second command writes a new boot sector to the system partition that is compatible with your Windows 10 version:
bootrec /fixboot command sometimes fails with the error „access denied„. This means the command has problems finding a proper boot device and Windows installation to fix. Only if you get this error message use the tool „bcdboot„. Run the following command and then continue with this tutorial as normal. Make sure to replace C:\ with your Windows 10 partition.
If everything was successful, you will need to rebuild the Boot Configuration Data with the third command:
Try to run this command to check if the system has found your Windows 10 installation:
If it returns something like „identified Windows installations: 1“ you have succeeded. You will need to clean the Master Boot Record again with:
And lastly update the master boot code on all partitions:
bootsect.exe /nt60 all /force
Now your Master Boot Record on Windows 10 should be fixed. But be careful when working with these tools. A broken Master Boot Record could result in data loss or a broken Windows system.
4. Fix the GRUB Bootloader
If you have a dual Windows 10 and Ubuntu installation with GRUB Bootloader you will need to add Windows 10 to your GRUB. This makes it possible to select if you want to boot Windows or Ubuntu when turning on your PC.
Firstly, launch Ubuntu and open your Terminal.
Then run this command to identify Windows 10:
You should get something like this if the system detected a Windows 10 installtion:
/dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
If there is nothing and os-prober found no Windows 10 please start this Tutorial from the beginning or reinstall Windows 10 on your PC.
Lastly, run this command to update GRUB: