Saturday 28 June 2014

how to recover grub loader in linux after installing windows?

Dual booting is quite helpful if you have plenty of disk space to spare .It provides advantage over virtual OS hosting in your system you don't have to compromise over your quality.If you want to play games you can switch to windows or you want to do something efficient or like say you want to code then you can switch to linux.

But it seems sometimes that after installing any Linux distribution along side windows the grub is messed up every time you try to boot you are welcomed with a blank screen and you end up with Linux.So there is a way to recover the grub.


Please follow the  instructions

Open the terminal












Find out where do you want to install the GRUB

Use the fdisk -l command on the terminal












Next use the ls command 










Next step mount the partition where you want to install the GRUB
 












lets say you want to mount it on the sda5 partition so
use the command sudo mount /dev/sda5 /mnt












Now mount the partition to an alternate location

Command
sudo mount /dev/sda5 /mnt/boot











Now  create and unbreakable link from the dev folder to the live image


Command to use is  sudo mount --bind













Next use the sudo chroot command














Now after doing that use the ls command

Next reinstall the GRUB boot loader to the dirve
command to use is

sudo grub-install













Now exit the chroot shell


Next  unmount all the partition using sudo umount


Now reboot the system using sudo reboot command

No comments:

Post a Comment