How to restore Ubuntu grub
As we know, windows will destory the GRUB if you install it with Ubuntu installed first.So how to fix GRUB?
I found a great solution on a blog. The steps are as follows:
- boot with a Ubuntu LiveCD(U disk), and choose
try Ubuntu without install
$ sudo fdisk -lin terminal to find out where you installed Ubuntu.
I installde in sda1(maybe not same as you)
$ sudo -ito get the the ability to run commands as root.
$ mkdir /media/tmpdirto create a temporary folder.
$ mount /dev/sda1 /media/tmpdirto mount system
$sudo gurb-install --root-directory=/media/tmpdir/dev/sda. And
no error reportmeans you are almost there.
Attention: sda here is not sda1
- Reboot without LiveCD and boot Ubuntu first to update grub with
$ sudo update-grub2
- Enjoy windows and Ubuntu.
Test sucessfully in win7, win8, win10.