Sunday, April 20, 2008

How to restore GRUB?

How to restore GRUB, When do you want to restore GRUB?
Take an example: You have dual boot system Windows OS and Linux. Somehow if you need to reinstall Windows OS it will overwrite the boot loader. So next time you boot to your system you won’t be able to boot into Linux.
How to fix the problem?
First you need to switch to Linux using live Linux CD, Then issue following command:
Open Terminal and logged in using root
#grub
grub>find /boot/grub/stage1
(hd0, x) ex: (hd0, 2)
grub>root (hd0, 2)
grub> setup (hd0)
quit
Reboot the system and you will able to log in into the Linux OS

No comments: