You need to boot from a LiveCD / USB. Once you are booted to it, you need to open a terminal window by pressing Ctrl+Alt+T. Once your terminal is open, type in the following to get a listing of your hard drive(s) in your system:
sudo blkid
You might see something like this:
/dev/sda1: UUID="A0F0582EF0580CC2" TYPE="ntfs"
/dev/sda2: UUID="8c2da865-13f4-47a2-9c92-2f31738469e8" TYPE="ext4"
/dev/sda3: UUID="5641913f-9bcc-4d8a-8bcb-ddfc3159e70f" TYPE="swap"
As you can see here that the /dev/sda2
is where the Ubuntu is installed by the TYPE="ext4"
format of the partition. To install the grub
, we are going to mount that partition. From the terminal window, type in:
sudo mount /dev/sda2 /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
Then we are going to switch over to the drive so we can install grub
. Type in the terminal window:
sudo chroot /mnt
Now, we are going to install grub to the first drive, which should be /dev/sda
. Type in at the terminal window:
grub-install /dev/sda
Then we need to update grub to make it the bootable MBR. Type in:
update-grub
you should see output similar to:
Found linux image: /boot/vmlinuz-3.16.0-38-generic
Found initrd image: /boot/initrd.img-3.16.0-38-generic
Found linux image: /boot/vmlinuz-3.16.0-37-generic
Found initrd image: /boot/initrd.img-3.16.0-37-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
done
Then all we have to do is unmount everything and reboot the host back to the hard drive. It should default to grub2
when booting back up.
exit
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt
sudo reboot
Hope this helps!