How to Restore Grub

On a dual or multi boot system when you install Windows XP again it overwrites Grub boot loader with its own boot loader. To restore Grub follow the steps as described below,

  1. Start your computer and boot with Ubuntu Live CD. Once Ubuntu Linux is loaded, open terminal and type sudo grub at the prompt.
  2. Now prompt will change to grub>
  3. Next type find /boot/grub/stage1 at the grub> prompt and press enter.
  4. The location of grub on different partitions will be shown as a result of find /boot/grub/stage1 command.
  5. Select the partition on which your Grub is located e.g. my grub loader for Ubuntu on first hard disk on partition 2 was shown as (hd0,1).
  6. Next choose this partition as root partition by typing root (hdd, partition No.), e.g. in my case I typed root(hd0,2) at the command prompt.
  7. Now to restore Master Boot Record type setup (hdd) at the command prompt e.g. in my case I typed setup (hd0).
  8. Once the MBR is installed on the hard disk, you can exit grub> prompt by typing quit and pressing enter.

Next reboot the computer without Ubuntu Live CD and you will get your usual Grub Menu.


Post a Comment


Original Blogger Template | Modified by Blogger Whore