how to get liux back after installing windows on a new paartition that removed the grub…
- User
how to get liux back after installing windows on a new paartition that removed the grub loader
- Assistant
how to get liux back after installing windows on a new paartition that removed the grub loader
If you've installed Windows on a new partition and lost access to your Linux system because the Windows installation removed the GRUB bootloader, don't worry—you can restore GRUB to regain access to both operating systems. Below are two primary methods to achieve this: using the Boot-Repair tool (which is simpler) and manually reinstalling GRUB via the terminal.
Boot-Repair is a user-friendly tool that can automatically fix most GRUB-related issues. Here's how to use it:
Create a Live USB/DVD:
Boot from the Live USB/DVD:
F12, Esc, F2, or Del during startup) and select the USB/DVD to boot from.Connect to the Internet:
Open a Terminal:
Ctrl + Alt + T.Add the Boot-Repair Repository and Install:
sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt update
sudo apt install -y boot-repair
Launch Boot-Repair:
boot-repair
Perform the Recommended Repair:
Reboot Your System:
If you prefer a manual approach or Boot-Repair doesn't resolve the issue, you can reinstall GRUB using the terminal.
Open a Terminal:
Ctrl + Alt + T or find it in the applications menu.List Partitions:
sudo fdisk -l
/dev/sda2) and, if applicable, the EFI partition (usually around 100-500MB and formatted as FAT32, e.g., /dev/sda1).Mount the Root Partition:
sudo mount /dev/sdaX /mnt
sdaX with your actual Linux root partition identifier.If You Have a Separate EFI Partition (For UEFI Systems):
sudo mount /dev/sdaY /mnt/boot/efi
sdaY with your EFI partition identifier.Mount Necessary Filesystems:
for i in /dev /dev/pts /proc /sys /run; do sudo mount --bind $i /mnt$i; done
sudo chroot /mnt
For BIOS Systems:
grub-install /dev/sda
/dev/sda with your primary drive (not a partition, so no number at the end).For UEFI Systems:
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
Update GRUB Configuration:
update-grub
Exit Chroot:
exit
Unmount All Mounted Filesystems:
for i in /run /sys /proc /dev/pts /dev; do sudo umount /mnt$i; done
sudo umount /mnt/boot/efi
sudo umount /mnt
Restart:
sudo reboot
GRUB Menu:
Backup Important Data: Before making changes to disk partitions or bootloaders, ensure you have backups of important data.
UEFI vs. BIOS: Ensure you know whether your system uses UEFI or BIOS, as the steps slightly differ, especially regarding the EFI partition.
Troubleshooting:
By following either of these methods, you should be able to restore the GRUB bootloader and regain access to your Linux installation alongside Windows.
Note: Commands may vary slightly based on your Linux distribution. Always refer to your distribution's official documentation if you encounter issues.
Not yet included in a published release.