Breaking News
Home | Tutorial | Linux | How to Repair or Reinstall Grub 2 with a Ubuntu Live CD or USB
repair grub in linux

How to Repair or Reinstall Grub 2 with a Ubuntu Live CD or USB

How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB

Warning:

Using sudo command in live CD/ USB should damage to your system. Before executing any command confirm how your command will work. When pasting into the Terminal, use Ctrl + Alt + v Not Ctrl + v .

When you install windows alongside Linux OS , Grub 2 typically gets overridden. To make Ubuntu/Linux Mint / Kali Linux or any other Linux distro(Linux distribution) control the boot process, you need to reinstall (Repair/Restore) Grub using a live CD or USB

Repair/ Reinstall  Grub 2 within a minute:

Mount the partition your Ubuntu/ Mint Kali installation is on. If you are not sure which it is, launch Gparted (included in the live CD / USB) and find out. Replace the XY with the drive letter , and partition number , for example:

sudo mount /dev/sda1 /mnt
sudo mount /dev/sdXY /mnt

Now bind the directories that grub needs access to detect other operating system.

sudo mount --bind /dev /mnt/dev && 
sudo mount --bind /dev/pts /mnt/dev/pts 
&& sudo mount --bind /proc /mnt/proc 
&& sudo mount --bind /sys /mnt/sys

Now we will jump into that using chroot

sudo chroot /mnt

Now install , check and update grub

Note: This time you only need to add the drive letter (using a) to replace X , for example: grub-install /dev/sda, grub-install –recheck /dev/sda.
 

grub-install /dev/sdX

grub-install --recheck /dev/sdX

update-grub

Now grub is back, that’s all to exit the chrooted system and umount everything.

exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt

Shut down and turn your computer back on, and you will be met with the default Grub screen.
You may want to update grub or re-install burg however you like it.

Congratulations !!!

you have just Reinstalled / Repaired / Restored Grub with a Live Ubuntu / Mint / Kali linux CD / USB !

Review This Post

User Rating: 4.38 ( 2 votes)

About ncnharry

Professionally I am a tech geek, learners of technology. Working as a freelancer on various platform. I would like to share knowledge around the world. Working in Help Me BD group in social network-Facebook. Join with Help Me BD Group, a social sharing group with various ideas. https://web.facebook.com/groups/www.helpme.com.bd/

Check Also

Bootable USB in Ubuntu

Create a bootable USB stick on Ubuntu

1. Preface To create bootable USB stick on Ubuntu you need some tools available in …

Leave a Reply