Re-installing GRUB boot loader in your PC

Are you using dual-boot in your system? And is this comprised of any Linux distro and Windows? If yes, then there is something essential for you – Re-installing GRUB bootloader if accidentally you overwrote it with boot.ini which is the bootloader of Windows. If you have installed your Linux distro after Windows, you will have access to both the Operating Systems. But if its not so, access to Linux distro would be lost as Windows assumes its the only OS installed.. isn’t it? So, let’s solve it->

1. First of all find out on which hard-drive partition you have installed Linux. (Let’s say it just sda1 here)
2. Run the bootable media and boot in Live CD mode.
3. Open a Terminal and write the following commands:

sudo mount /dev/sda1 /mnt
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
sudo chroot /mnt
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub
exit
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt

4. Shut down and Restart your system after ejecting/detaching the bootable. You will get the GRUB screen back.

Congratulations you just reinstalled GRUB as your Bootloader.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s