How-To

Installation of Grub after Windows Installation in Ubuntu 10.04

We all know that, in a machine which is a dual boot (one which has more than one Operating System) its important to have Grub Loader (especially when you have Linux based distro) as Grub is responsible for Switching between the OS. When you have Linux based distro already in your PC but for some reason you also install Windows or Update to Newer Version or Reinstall Windows, it happens that Windows REPLACES Grub Loader from your machine and puts Windows Boot Loader due to which you can’t switch to any of the other Linux based distros. Hence its important to know how to re-install Grub Loader rather than re-installing the distro itself.

Earlier Methods:

In the earlier methods i.e. before Ubuntu 9.10 there was Grub 0.97, but after Ubuntu 9.10 they introduced Grub 1.96.
In the earlier versions it was quite easy to install Grub Loader as you have to type commands such as ‘sudo grub’ which used to take you to grub prompt. Where by giving ‘find /boot/grub/stage1’ you used to give location where exactly grub loader was located and then by ‘root (hd_,1)’ and ‘setup(hd_)’ you were able to get back Grub Loader.
But in Grub 1.97 the method is changed. I tried to find out ‘menu.lst’ and ‘stage1’ files in grub folder but I found that these files are removed and replaced by ‘grub.cfg’. In fact if you run ‘sudo grub’ in any live CD it gives error as ‘Command not Found’, then i tried it by installing via ‘sudo grub-install’ and tried replacing ‘stage1’ by ‘grub.cfg’ ie ‘find /boot/grub/grub.cfg’ but it was not working out. There is a little different way of installing Grub 1.97 in your machine.

Grub 1.97 Installation
Media_http4bpblogspot_vtdjk
If you tried above method then it is recommended to Reboot your machine. And follow the steps given below:-
Media_http2bpblogspot_xsffb
  1. Boot from Live CD (Ubuntu 9.10 or above)
  2. Mount the partition which has ‘Ubuntu Installation’. (Note that it is ‘/’) And once mounted you should see ‘boot’ folder in it.
  3. Get the UUID of the partition. You can get the UUID from ‘/media’. In my case its shown in the image. (You better go to Properties of the partition by right clicking on the partition and then Copy it)
  4. And then open ‘Terminal’ from ‘Applications -> Accessories’.
  5. Then type
    sudo grub-setup -d /media/UUID/boot/grub /dev/sda
  6. Replace UUID with your UUID.
  7. In the above case ‘sda’ and ‘sdb’ will be dependent on where MBR is installed in most of the cases its in ‘sda’.
  8. Reboot it.
  9. BANG!! You will get those OS options again.
Advertisements
Standard

Express your thoughts

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s