How to reinstall grub2 after Windows has been installed

I have had quite a few people asking me lately how to reinstall grub2 after they have installed windows. It is actually pretty simple and straight foward. Boot the live media and work out where /boot is , if like me there is no seperate /boot partition then where the / partition is. This can be achieved with sudo fdisk -l . Here is my output,

/dev/sda1 * 63 293242879 146621408+ 7 HPFS/NTFS/exFAT
/dev/sda3 293250510 625137344 165943417+ 5 Extended
/dev/sda5 364884408 369077309 2096451 82 Linux swap / Solaris
/dev/sda6 369078272 625137344 128029536+ 83 Linux
/dev/sda7 293252558 364884407 35815925 83 Linux

For /dev/sda1 is my Windows install , also note the * for the boot flag , dont move this as windows still needs it there, sda6 is my / and sda7 is a small storage partition. I would next mount sda6 , so in terminal sudo mount /dev/sda6 /mnt. If sda7 had been a sperate /boot , I would have then mounted that to /mnt/boot , so in terminal sudo mount /dev/sda7 /mnt/boot.

With that mounted its time to install grub which can be achieved in terminal with sudo grub-install –root-directory=/mnt /dev/sda.

Please not that had the partition been /dev/sdc5 I would change the last part of the previous command to /dev/sdc from /dev/sda.
Also be aware that a message similiar to cannot find /boot is is mounted , you can ignore that as long as you see the message Installation finished. No error reported.

When you reboot you might notice that Windows isn’t listed in the boot menu , thats an easy fix , open the terminal and run sudo update-grub.

Advertisements
Tagged with:
Posted in 01Ben, Computers, General, Linux, Windows
One comment on “How to reinstall grub2 after Windows has been installed
  1. mickeyj4j says:

    great poste ben love it.

Please feel free to 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

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 68 other followers

%d bloggers like this: