modified on 20 September 2011 at 22:02 ••• 4,150 views

Restoring grub after windows installation

From Maties Ubuntu

Jump to: navigation, search

If you cannot boot your Ubuntu after installing Windows (of just broke your grub) follow these steps:

Method 1: (Recommended if you have internet access)

Boot from an Ubuntu Live CD

Open a terminal and enter:

sudo add-apt-repository ppa:yannubuntu/boot-repair
sudo apt-get update && sudo apt-get install -y boot-repair && boot-repair

follow the steps in the boot-repair program and restart

Method 2:

Boot into your ubuntu with the Ubuntu Desktop CD

Mount the HDD that you run your Ubuntu from

Open a terminal

Find your <UUID> and <Designation Disc> with:

mount | tail -1 

this gives something like:

/dev/sda2 on /media/0d104aff-ec8c-44c8-b811-92b993823444 type ext4 (rw,nosuid,nodev,uhelper=devkit)

where 0d104aff-ec8c-44c8-b811-92b993823444 is your <UUID> and /dev/sda is your <Designation Disc>

Enter:

sudo grub-setup -d /media/<UUID>/boot/grub -m /media/<UUID>/boot/grub/device.map <Designation Disc>

and your ubuntu will now boot.


If Windows does not boot now simply enter

sudo update-grub

And everything will work now.

  • note: if your ubuntu says that grub-setup does not exist install grub-pc with
sudo apt-get install grub-pc