Search This Blog

Thursday 8 December 2011

Grub Re-Installation

In a nutshell Grub2

You will notice the power of a bootloader when you have at least two Operating Systems (OS). Basically the application grub2 assist you and your machine with this process. Grub2 works like a director in y junction road. At times when your director is gone or damaged you must have emergency numbers to call him/her. In this short tutorial will deal with such a remote situation. Let me not repeat what has already been said by Ubuntu Community

Scenario

Will make use of a scenario to follow this tutorial, it will not be formal or general but I have a feeling that it will give one some basic clue or direction. Just in case you find bugs or wrongful information please do give feedback because I am still learning myself.

You have installed Windows XP and Ubuntu Oneiric things are working fine. Suddenly you have installed Windows 7 which took over your Boot Loader. So now you must bring back the grub menu. Here I assume that while you were installing Windows 7 you had a free partition or hard drive. If you have formated the partition having your Ubuntu installation then you will have to skip this tutorial and reinstall your Ubuntu distro.

Solve the problem

Here are the basic tools/stuff that will need to finish this tutorial.

  1. Ubuntu Live Disk/USB
  2. Pen and Paper

Boot your Live Disk and then select test Ubuntu, then after press "Ctr + F2" on your keyboard. It can be a different story if you are using alternative disk instead of live disk, for example you will select "Rescue Mode". We will be working in console mode to cover both methods.

While in console type the following :

  1. sudo su
  2. fdisk -l
  3. //To show the partitions on you computer
    //You might have got different results choose the line with "*". It might be /dev/sdb2 in your case or something else.
  4. mkdir /media/tempDisk
  5. mount /dev/sda1 /media/tempDisk
  6. //Notice that in your case it might be /dev/sdb1 so just adjust accordingly.
  7. grub-setup --directory=/media/tempDisk/boot/grub/ /dev/sda
  8. //For example if your partition is /dev/sdc1 then you will type /dev/sdc
  9. shutdown -r now
  10. //That will restart your computer.

Update the grup menu

If all went well you should be logged in your Ubuntu system. The last thing to do is to update the grup menu, since you have added the third OS.

sudo update-grub

Feedback

I hope this tutorial was helpful. Please feel free to give feedback it can be bug fix, suggestion and even critics are more than welcome. Enjoy you Ubuntu Desktop.

No comments:

Post a Comment