Thursday, October 30, 2008

How to recover grub after installing windows

If you install windows on your Ubuntu computer, you will lose the opportunity of using Ubuntu, as windows removes the os loader (grub). You can recover grub easily if you have an Ubuntu live CD.
  1. Boot your computer with Ubuntu live CD
  2. Open the terminal and run following command
  3. sudo grub
  4. Then you will see a prompt like grub>
  5. Issue following commands
  6. grub>find /boot/grub/stage1
  7. then you will see a result like (hdx,y) , where x and y are natural numbers
  8. grub>root (hdx,y)
  9. grub>setup (hdx)
  10. grub>quit
  11. Reboot your machine and remove your live CD

No comments: