For those who are having a dual (triple or quad) boot system in your computer, chances are, your bootloader might break when you update one OS to a newer version. If you are using Ubuntu (with the new Grub 2 bootloader) and you installed Windows. The Windows bootloader will erase your Grub 2 and you won’t be able to boot in your Ubuntu. As such, you will need to restore your bootloader to Grub 2.
Requirement: Ubuntu LiveCD (download it from Ubuntu.com)
Start your computer and boot into your Ubuntu LiveCD.
The first thing that we need to do is to mount your existing Ubuntu partition. If you already know your partition number (of the form “sda1”, “sdb2” etc), you can easily mount using the following command:
sudo mount /dev/sda1 /mnt #replace sda1 with your partition number
If however, you have completely no idea of your partition number, launch GParted (System -> Administration -> gParted). Locate your Ubuntu partition and record down the partition number.
If you are are using different partitions for the “root” and the “home” folder, make sure you record the root partition instead of the home.
Close the GParted. Open a terminal and type in the following command:
sudo mount /dev/sda1 /mnt #replace sda1 with your root partition number
Next, all you need to do is to reinstall Grub 2 with the following command:
sudo grub-install --root-directory=/mnt/ /dev/sdX #replace the X in sdX with your partition alphabet
Reboot.
You should be able to boot into your Ubuntu now.
Run the following to update your Grub 2 to include the bootloader of Windows (or other OS).
sudo update-grub
You should be able to boot into your Ubuntu and Windows (or other OS) now.
13 comments
Comments are closed.
Thanks a lot.. this was the only guide that worked for me!
Thank you, This was soo useful!
“Next, all you need to do is to reinstall Grub 2 with the following command:
sudo grub-install –root-directory=/mnt/ /dev/sdX
#replace the X in sdX with your partition alphabet”
What partition alphabet? Linux or Windows?
and how do I know the partition alphabet of linux?
if you look at the screenshot above, you will see that the partitions are listed in the order sda1, sda2, sda3 etc. This represent different partition in the same hard disk. If you have several hard disks, it will show up sda, sdb, sdc etc. Depending on your configuration, you will have to replace the sdX with sda, sdb or sdc.
If you follow the above step and boot into a live CD, you should be able to check the partition alphabet with Gparted.
Thanks for sharing the info.. it really helped me…..
This was the best explaining that I could find on the web! ThX..you are da man!
thanks alot
Useful and simple. Thank you a lot! Good job.
I did learn something from here and used it ti restore my grub though I did use another article.
I must say this article is already good for me.
So in the end I had my dual boot ubuntu and windows running smooth.
I did an article to share my experience dual booting.
Hope it helps others who didn’t make to work using this article.
Try http://www.paullabis.com/2011/10/recover-ubuntu-grub2-after-windows.html
Hope this helps and thanks author. This article did thought me something.
Thanx a lot. This is simply explained what to do. Saved me from whole lot of trouble.
Thank you so much. Today I’ve been reinstalling Lucid and XP on my little netbook, and after installing Sonicstage I suddenly had a problem with the bootloader not loading. This guide sorted me out really well.
Btw Sonicstage is terrible! Don’t buy Sony MP3 players.
Wow, i didn’t know the mp3 software can crash your bootloader.
I am glad all is fine for you now.
Thanks so much Damien, worked perfectly for me! You’ve just saved me hours re-installing.