How to Restore GRUB Bootloader After Installing Windows

If you have a dual-boot system with Windows and Linux, it’s common for the Windows installation or update process to overwrite the GRUB bootloader. This can prevent you from booting into Linux. Fortunately, there are several ways to restore GRUB and regain access to your Linux installation.

Method 1: Restore GRUB from a Live CD/USB

Boot from a live Linux CD or USB drive, such as an Ubuntu live disk.
Open the terminal and run sudo fdisk -l to identify where Linux is installed. Look for a partition labeled as Linux.
Mount the Linux root partition using sudo mount /dev/sdXY /mnt, replacing sdXY with the appropriate partition (e.g., sda3).
Bind-mount the necessary filesystems using:
sudo mount –bind /dev /mnt/dev
sudo mount –bind /proc /mnt/proc
sudo mount –bind /sys /mnt/sys

Chroot into the mounted Linux installation using sudo chroot /mnt.
Reinstall GRUB using grub-install /dev/sdX (replace sdX with the disk identifier, e.g., sda).
Update GRUB’s configuration file with update-grub.
Exit the chroot environment with exit.
Unmount the partitions with sudo umount -l /mnt/dev; sudo umount -l /mnt/proc; sudo umount -l /mnt/sys; sudo umount /mnt.
Reboot your system, and GRUB should now be restored.

Method 2: Restore GRUB from Windows

Boot into Windows and open an elevated command prompt (run as administrator).
Run the following commands:
bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

This command sets GRUB as the default boot loader.
Reboot your system, and GRUB should now appear, allowing you to boot into Linux.

Method 3: Use Boot-Repair Tool

Boot from a live Linux CD or USB drive.
Open the terminal and install the Boot-Repair tool with sudo apt install -y boot-repair.
Run boot-repair and follow the on-screen instructions to restore GRUB.
When prompted, select the recommended repair option.
Reboot your system, and GRUB should now be restored.

See also  Is IMEI Repair Legal in the United States? Understanding the Law and Implications

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *