5

I have a Dual Boot setup using Ubuntu 20.04 and Windows. Today I updated Windows 10 to Windows 11 using Windows Update and I lost my GRUB bootloader (Windows 11 was working fine).

I managed to recover the GRUB by changing the Boot order in UEFI and everything seemed alright after that. Then, I ran sudo update-grub because I read that you had to do so in this forum, got many errors in the output, restarted my computer and everything went wrong after that... Now when I select "Windows Boot Manager" I get an error:

/EndEntire
error: cannot load image

I read that this could be solved by booting into Windows and running some commands but I cannot boot into Windows anymore choosing the bootloader in UEFI! If I choose Windows, my computer restarts but fails to do so and defaults to GRUB again. It seems like Windows cannot boot anymore.

Things I have tried:

  • Disabling Secure Boot again
  • Running boot-repair with the "Repair Windows boot files" option
  • Running boot-repair with the "Backup and rename Windows EFI files" option
  • Running sudo update-grub multiple times

boot-repair results of the 1st time I ran the tool:

Output of update-grub:

Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.15.0-72-generic
Found initrd image: /boot/initrd.img-5.15.0-72-generic
Found linux image: /boot/vmlinuz-5.15.0-71-generic
Found initrd image: /boot/initrd.img-5.15.0-71-generic
Found linux image: /boot/vmlinuz-5.13.0-52-generic
Found initrd image: /boot/initrd.img-5.13.0-52-generic
Found linux image: /boot/vmlinuz-5.11.0-46-generic
Found initrd image: /boot/initrd.img-5.11.0-46-generic
Found Windows Boot Manager on /dev/nvme0n1p1@/EFI/Microsoft/Boot/bootmgfw.efi
Adding boot menu entry for UEFI Firmware Settings
done

Output of fdisk -l:

Disk /dev/nvme1n1: 931,53 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: WDS100T3X0C-00SJG0                      
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: FFC58535-6B06-4DDC-81BC-ED4A4575504F

Device Start End Sectors Size Type /dev/nvme1n1p1 2048 156250111 156248064 74,5G Linux filesystem /dev/nvme1n1p2 156250112 234375167 78125056 37,3G Linux swap /dev/nvme1n1p3 234375168 236328959 1953792 954M EFI System /dev/nvme1n1p4 236328960 1701173247 1464844288 698,5G Linux filesystem

Disk /dev/nvme0n1: 476,96 GiB, 512110190592 bytes, 1000215216 sectors Disk model: SKHynix_HFS512GDE9X084N
Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: gpt Disk identifier: AA11E4E4-987D-4872-88CD-DF2600D0C425

Device Start End Sectors Size Type /dev/nvme0n1p1 2048 534527 532480 260M EFI System /dev/nvme0n1p2 534528 567295 32768 16M Microsoft reserved /dev/nvme0n1p3 567296 998166527 997599232 475,7G Microsoft basic data /dev/nvme0n1p4 998166528 1000214527 2048000 1000M Windows recovery enviro

It is just weird that even when booting Windows by UEFI it does not work neither.

Runsis
  • 203
  • As Boot-Repair suggests post in your question the link it gives for its Summary Report. – oldfred May 22 '23 at 18:50
  • Just edited the post to add the link https://paste.ubuntu.com/p/ZDwtZm99cQ/ @oldfred – Runsis May 22 '23 at 18:55
  • 1
    Boot-Repair does not fix Windows issues. But it looks like the Windows UEFI boot entry uses the ESP - nvme0n1p1 and originally Ubuntu also did. But now the reinstall of grub installed Ubuntu boot entry to nvme1n1p3 's ESP. You must have changed UUID in fstab. If Windows does not boot directly from UEFI boot entry that should use Windows boot files, you need to use Windows repair/recovery flash drive, booted in UEFI mode to make Windows repairs. – oldfred May 22 '23 at 22:42
  • Hey there @oldfred thank you so much for helping me ! I managed to get a Windows recovery flash drive but when I try to repair the boot problems using the WIndows Troubleshoot options nothing really happen. It gives me an error. The recovery drive can't find the other Windows apparently so I am a little bit lost on how to proceed here without having to format my computer. Not sure if maybe editing the Windows Boot entry to point to a different partition could help :/ – Runsis May 23 '23 at 21:21
  • This is an Ubuntu question & answer site, so only questions on Ubuntu are on topic. And I do not really know Windows. I have one dual boot system, and hate it, but have to have it for one application. Updates take forever & I often have to google fixes for it when I know (have notes) most fixes for Ubuntu. Just noticed report says Windows 7. Is that correct? As Windows does not support that anymore. – oldfred May 23 '23 at 22:01
  • Thanks @oldfred Yeah I know it's an Ubuntu forum but the problem arises because of the Dual Boot I have and it's related with the Windows boot problem. Well, I guess I will have to dig further or just format my laptop :/ Thanks again! – Runsis May 23 '23 at 22:06

1 Answers1

5

FINALLY SOLVED THIS!

Because of the Dual Boot with Ubuntu and the Windows update from Windows 10, Windows 11 boot files were just corrupted and even using the Recovery flash drive and the Troubleshoot option did not work

SOLUTION

  1. Flash a USB with Windows 11 Recovery files. Go to https://www.microsoft.com/software-download/windows11 and Download the "Windows 11 Installation Media" file in another Windows machine (or a Virtual Machine with Windows). Run the installer with the flash a USB option.
  2. Reboot your computer with the flashed USB and in the UEFI/BIOS menu boot from the USB drive to enter a Windows 11 installation GUI.
  3. Choose a language and then in the second step click the small "Repair" button
  4. From now on you can follow this video https://www.youtube.com/watch?v=F72D7uL6cZg or continue reading
  5. Choose the "Command Prompt" option to open a cmd in this recovery mode. (or click Troubleshoot if that appears first)
  6. Type diskpart
  7. list disk and choose the disk where the original Windows is using select disk # (# is the number of the disk)
  8. list partition and select partition # by choosing the partition number of where the boot files of Windows are (every Windows installation will have this. It's usually a 300-500 MB partition. Careful here)
  9. format to format that boot partition
  10. Now, assign a letter to this boot partition assign letter=n:
  11. Select the other WIndows partition where your files are usually stored (this is probably the biggest partition of the list). Use select partition #
  12. Assign a letter to this partition "C": asssign letter=c:
  13. exit
  14. bootsect /nt60 all /force. This just updates all the target volumes to be compatible with the bootloader.
  15. Type c:
  16. bcdboot c:\windows /s n: /f all (Instead of n: use the letter you assigned to the boot partition )
  17. Now the final steps: bootrec /scanos
  18. bootrec /fixmbr
  19. bootrec /fixboot (note: this can give you a pemission denied error. Just skip this step if you have that error and continue with the next command. It still worked for me. Otherwise, google the error and try some solutions.)
  20. bootrec /rebuildbcd
  21. Exit the Windows recovery mode and continue to Windows 11 and it should be working fine now.

Thanks to @olfred for the help too.

Runsis
  • 203
  • 2
    For me step 16, i.e. 'bcdboot c:\windows /s n: /f all' fixed the issue. – Sebastian Thees Aug 26 '23 at 22:02
  • Yes, steps 1-16 fixed the issue for me as well. Also didn't need to do step 14 as well. – Sumit Jain Dec 24 '24 at 05:27
  • Afterwards, Windows bootloader became the first entry in boot sequence and I was able to directly boot into windows. However, I couldn't enter the bios or boot sequence screen using keyboard shortcuts to boot into Ubuntu.

    From Windows I restarted the computer while pressing shift key and selected change uefi firmware settings. From BIOS settings, I moved ubuntu to the top of boot sequence, which made grub as the default bootloader.

    – Sumit Jain Dec 24 '24 at 05:34
  • Thanks Runsis and Sebastian for your help. – Sumit Jain Dec 24 '24 at 05:35