Total Pageviews

Saturday, 8 June 2013

Recover GRUB after Windows Installation

Often we lose GRUB boot loader whenever we install Windows after Linux installation. This is a terrible hazard to all who love to use dual, triple or even quadrapole or even higher boot systems on their Lappys or Desktop PCs. Here’s the fix 。
Step 1. Boot with your Ubuntu Live CD or DVD
Step 2. Open gnome-terminal or konsole
Step 3.
$ sudo grub
You’ll get a” grub>” prompt.
Step 4.
grub>find /boot/grub/stage1
You’ll have an output like (hd0,0) ,  it’ll be the number of your partition.
For hda1,sda1 it’ll be (hd0,0),
For hda2,sda2 it’ll be (hd0,1),
For hdb1,sdb1 it’ll be (hd1,0).
Step 5.
grub>root (hd0,1)
Step 6.
grub>setup (hd0)
Step 7.
grub>quit
Step 8.
Reboot the machine.
The boot loader should be recovered now 。
Another way to fix is to enter into the single user mode at the time of boot from the selection menu & when you have the root prompt do the following:
# grub
You’ll have “grub>” prompt like before.
Now repeat from Step 4 to Step 8 as before and you’re done。