Sunday, January 2, 2011

Reinstalling grub boot loader

This post is only for the Linux users. If you want to use Linux with Windows you need to install a boot loader. Most of the latest distros provides a boot loader (ex: grub) and it installs automatically with the OS. If you install Windows after installing Linux the boot loader will disappear, in other words, you are unable to load Linux OS. To solve this problem you need to reinstall grub boot loader. First of all, you need to find a live Linux CD and boot it without installing. ( http://www.livecdlist.com )

1. Open a terminal and log in as root.
:~> su -
or use "sudo"  

               
2. run grub
 :~# grub
or :~> sudo grub

3. finding master boot record
grub> find /boot/grub/stage1

4. If you know where the master boot record
grub> root (hd0,6)

5. Setup the boot loader
grub> setup (hd0) 
grub> quit

 Now you can have both operating systems.