This article, itsmeit will provide guidance on 3 methods to fix Grub2 bootloader, can’t boot Windows after installing Ubuntu or dual-boot Windows and Ubuntu, or after deleting Ubuntu from the computer.
How to fix Grub2, Can’t Boot Windows After Installing Ubuntu for Dual Boot
When installing dual boot windows and ubuntu, a very common error is that the computer goes directly to windows or ubuntu without a menu selection. Caused by the loss of Grub2, this article will guide fix boot error windows and ubuntu dual boot for you for both UEFI and Legacy standard (MBR and GPT).
The reason why Grub2 error or disappeared
- After installing Ubuntu and Windows in a dual-boot configuration, re-installing either Windows or Ubuntu may result in a Grub2 error.
- Updating the BIOS can also cause Grub2 to be lost in a UEFI system.
- Incorrect installation of Grub2 during the Ubuntu install process may result in the computer booting directly into Windows with no option to boot Ubuntu.
- Failing to update Grub2 can prevent boot to Windows after installing Ubuntu.
- Updating Windows may cause loss or modification of files necessary for Grub2 to function properly, leading to Grub2 issues.
- Software bugs may result in improper functioning or missing Grub2.
Don’t worry about the above error(s), itsmeit will guide you on how to reinstall Grub in Ubuntu right below.
How to Fix GRUB Errors when Dual-Boot Ubuntu and Windows
Method 1: Use Boot-Repair to reinstall grub in Ubuntu (Recommended)
The first method mentioned in the article by us for resolving the issue of being unable to boot Windows after installing Ubuntu in a dual-boot setup is highly recommended due to its ease of use and automation, which is achieved through the use of the Boot-Repair tool.
Boot-Repair is an effective software to fix the Grub2 error of not being able to access Windows after installing Ubuntu. The software helps to restore and recreate the Ubuntu boot menu. (Reference)
Requirements: You need a current version of Ubuntu installation USB boot. You can use Rufus to create the bootable USB. Or follow Create USB Boot UEFI-Legacy Multipurpose Hidden Partition post.
Restart the computer and boot from the USB. Then, select “Try Ubuntu“, and connect to the internet. Finally, run the commands listed below to install Boot-Repair and reinstall Grub in Ubuntu.
sudo add-apt-repository ppa:yannubuntu/boot-repair sudo apt-get update sudo apt-get install -y boot-repair && boot-repair
Boot-Repair tool will automatically scan, select Recommended repair to fix the error. Once it’s done, you just need to restart your computer and select Ubuntu or Windows from the boot menu.
Method 2: Fix can’t boot Windows 10/11 after installing Ubuntu [Command]
Requirements: Similar to how to use Boot-Repair to reinstall grub for Ubuntu, you need a USB boot Ubuntu. You can create a USB boot with Rufus tool and this second method you need to note will apply exclusively to NVME SSD or SATA SSD (not NVME).
For NVME SSD drives
Restart the computer and boot into the USB then select
Try Ubuntu, Then press
Ctrl+ALT+T to open Terminal, type
sudo fdisk -l
fdisk -l will list all the partitions of the hard drives. Identify the partition where Ubuntu is installed by its Linux name (as shown in the picture, the partition is named “nvmeOn1p6”). If you are using a UEFI device and NVME SSD, it is important to also locate the EFI partition (as shown in the picture, the EFI partition is named “nvmeOn1p1“). Make note of the names of these partitions to use in the corresponding command later.
Now enter the following commands one by one, you should copy the command and edit the partition name, double check before proceeding to handle the can’t boot Windows after installing Ubuntu 22.04, 20.04 or Linux.
sudo mount /dev/nvmeon1p6 /mnt sudo mount /dev/nvmeon1p1 /mnt/boot/efi sudo arch-chroot /mnt (or) sudo chroot /mnt grub-install /dev/nvmeOn1p update-grub
The above command requires root or
- nvmeOn1p6: Ubuntu partition
- nvmeOn1p1: EFI or ESP partition (For UEFI machines)
- nvmeOn1p: Dual boot (parallel) Ubuntu and Windows hard drive
Need to replace the correct nvmeOn1p(xx) partitions that you found in the
fdisk -l command, the nvmeOn1p symbol is for the new generation SSD NVME hard drive
For SSD drives but not NVME
Use the command fdisk -l to list all the partitions of the hard drives. See which partition Ubuntu is installed on (Linux name), as shown in the picture above is the sda7 partition. With UEFI device, you need to see more about where the EFI partition is (pictured above is sda2). Please make note of the names of the partitions mentioned above in order to correctly enter the commands listed below to fix GRUB error Ubuntu.
sudo mount /dev/sda7 /mnt for i in /dev /dev/pts /proc /sys; do sudo mount -B $i /mnt$i; done sudo chroot /mnt grub-install /dev/sda update-grub
Replace the appropriate “sdxx” partitions that you discovered using the “fdisk -l” command. Please note that the “sdxx” symbol represents a non-NVME hard drive. Then, restart the computer. If the GRUB error in Ubuntu persists and you are still unable to enter Windows, double-check the steps to ensure their accuracy. If necessary, you can try the process again or choose a different method.
Method 3: Fix errors Dual boot Ubuntu vs Windows with BootIce (MBR Legacy)
If your hard drive is in Legacy mode but you can’t boot Windows after installing Ubuntu, BootIce provides a quick solution. It can fix the Dual boot issue between Ubuntu and Windows Legacy (BIOS – MBR) by reloading the MBR for the hard drive using the BootIce tool.
Remember to select the correct drive where dual-boot Ubuntu is installed.
Select Grub 2.00 -> Restore MBR. Then lead to the file *.bin, this file you download Grub2 Ubuntu.
Finally, select the “Restore” option and restart your computer. The error of missing Grub2 when installing Ubuntu and Windows in dual-boot has been resolved, and you can choose between Windows or Ubuntu to boot.
The above are the methods for fixing the error of being can’t boot Windows after installing Ubuntu. You don’t have to worry about using dual boot with the same issues. If you have any questions, please leave a comment below.