Reinstall Grub after installing windows
- Boot from a Live Linux USB drive. You can use any Live Linux distribution for this, such as Ubuntu, Fedora, or Debian.
- Once you have booted into the Live Linux environment, open a terminal. For example;
Ctrl+Alt+T - Type the following command to list all the partitions on your system:
sudo fdisk -l
- Identify the partition where your Linux operating system is installed. Note the partition name, for example,
/dev/sda1>/code>. - Mount the partition with the Linux operating system:
sudo mount /dev/sdx1 /mnt
Replace
/dev/sdx1with the actual partition name. - Mount other necessary partitions:
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
- Chroot into the mounted Linux partition:
sudo chroot /mnt
- Install the Grub bootloader:
sudo grub-install /dev/sdx
Again, replacing
/dev/sdxwith the actual device name of your hard drive. If you have more than one hard drive, make sure to select the one where the Linux operating system is installed. - Update the Grub configuration:
sudo update-grub
- Exit the chroot environment:
exit
- Unmount the partitions:
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
- Reboot your computer from the terminal.
sudo reboot