Thursday, September 22, 2011

Restore your GRUB in simple steps.....



GNU GRUB(GRand Unified Bootloader)
is often a confusing topic for linux newbies but it's not.It is an implementation of a method to load various operating systems or different kernel configurations available on your system...confused ??
In simple words you can load different operating systems from a simple list.




GRUB is the default bootloader for many Linux systems.GRUB loads its configurations at startup and lets you choose different operating systems from a simple list.It supports all commonly used Unix file systems and Windows file systems.GRUB can be used with different user interfaces and there are many softwares that let you edit your grub configuration files and its entries with simple GUI.

Now sometimes your bootloader gets corrupted or you install windows and windows overwrites GRUB and you are not able to boot into your linux but its a very simple process to restore your bootloader.Just follow these simple steps in Ubuntu...


Step 1: If you have ubuntu 10.04 or before just insert a live CD/DVD of the same ubuntu version on
            your system or boot from a pendrive.To create a bootable pendrive you can refer this post.

Step 2: Now boot from this pendrive and select Try ubuntu without installing.

Step 3: Go to the termnal fron Applications-->Accessories-->Terminal.

Step 4: Type the command sudo os-prober. This will tell u all operating systems on your Hard 
            Disk.

Step 5: Identify the linux partition which contains your linux partition (like /dev/sdaX ....X may
            be 1,2,3..etc).

Step 6: Now after identifying your linux partition run the command sudo mount /dev/sdaX /mnt.
            This mounts your linux partition.

Step 7: Install grub using command sudo grub-install --root-directory=/mnt /dev/sda.
          
Yeah that's /dev/sda not sdaX.

Step 8: If the message comes "Installation successful.No error reported" restart the computer and
            boot into any OS.If the list doesn't come boot from the CD/DVD or live USB again and 

            use the command sudo update-grub.

That's all.

If you liked this post don't forget to like and share with your friends.You can also comment below.







2 Comments
Comments
Akash said...

Awesome dude...keep it up!!

Dhiraj Thakur said...

thanks Akash....:)