Dual-booting Windows and Ubuntu offers the flexibility of both operating systems on a single machine. However, reinstalling Windows can sometimes disrupt the GRUB bootloader, leading to boot issues. This guide provides a straightforward solution to restore GRUB functionality and reintegrate Windows into the boot menu.
π The Issue
After performing a fresh installation of Windows 11 on a system that also runs Ubuntu, you might encounter the following problems:
- GRUB Bootloader Missing: The system boots directly into Windows without displaying the GRUB menu.
-
Windows Entry in GRUB Fails: Selecting Windows from the GRUB menu results in errors like
no such device: 22a5-da27
orerror: unknown filesystem
.
These issues arise because reinstalling Windows can overwrite the GRUB bootloader and change partition UUIDs, causing mismatches in GRUB's configuration.
π§ Solution Overview
To resolve these issues, we'll:
- Restore GRUB Bootloader: Modify the boot order in BIOS/UEFI settings to prioritize Ubuntu, allowing access to the GRUB menu.
- Update GRUB Configuration: Identify the new UUID of the Windows partition and update GRUB's configuration to reflect this change.
π οΈ Step-by-Step Guide
1. Modify Boot Order in BIOS/UEFI
Reinstalling Windows often changes the boot sequence, setting Windows Boot Manager as the default. To access GRUB:
-
Access BIOS/UEFI Settings:
- Restart your computer and enter the BIOS/UEFI setup by pressing the designated key (commonly
F2
,F10
,Delete
, orEsc
) during startup.
- Restart your computer and enter the BIOS/UEFI setup by pressing the designated key (commonly
-
Change Boot Priority:
- Navigate to the boot settings and set the Ubuntu drive or GRUB bootloader as the primary boot option.
-
Save and Exit:
- Save the changes and restart your computer. The GRUB menu should now appear, allowing you to boot into Ubuntu.
2. Update GRUB Configuration with the Correct UUID
Once you're back in Ubuntu, update GRUB to recognize the current UUID of the Windows partition:
-
Open Terminal:
- Boot into Ubuntu and open the terminal.
-
Identify Windows Partition:
- Run:
lsblk -f
- Locate the Windows partition (typically formatted as
ntfs
). Note its mount point (e.g.,/mnt/boot/efi
).
-
Find the UUID:
- Run:
blkid
- Find the UUID corresponding to the Windows partition.
-
Edit GRUB Configuration:
- Open the custom configuration file:
sudo vi /etc/grub.d/40_custom
- Add the following entry, replacing
YOUR_UUID
with the UUID obtained earlier:
menuentry "Windows 11" --class windows --class os { insmod part_gpt insmod ntfs search --no-floppy --set=root --fs-uuid YOUR_UUID chainloader /EFI/Microsoft/Boot/bootmgfw.efi }
-
Update GRUB:
- Save the file and run:
sudo update-grub
- This command regenerates the GRUB configuration to include the updated Windows entry.
3. Verify the Solution
-
Reboot the System:
- Restart your computer. The GRUB menu should display an option for "Windows 11".
-
Test Booting into Windows:
- Select "Windows 11" from the GRUB menu to ensure it boots correctly.
π― Conclusion
By following these steps, you can restore the GRUB bootloader and ensure both Ubuntu and Windows 11 are accessible in your dual-boot setup. This approach addresses the common issue of GRUB not recognizing Windows after a fresh installation due to UUID changes.
For more detailed information, you can refer to this Ask Ubuntu discussion: askubuntu.com
Feel free to share this guide with others who might encounter similar issues!
Top comments (0)