Friday, January 28, 2011

Recovering Ubuntu GRUB After Installing Windows

There are two method that I often use to fix the grub on ubuntu, on time after installing windows including,
First Method

  1. Boot into a LiveCD (recomanded Ubuntu 9.04)
  2. Open a terminal
  3. Open the GRUB Command-line utility by typing
  4. sudo grub
  5. Find where Grub is. If this gives a few different answers then you will need to find the correct one, perhaps by trial-and-error.
  6. find /boot/grub/stage1
  7. Tell GRUB which partition to tell the MBR your Grub is on by entering
  8. root (hdA,B)
  9. The coordinates A,B are where 'A' is the hard-drive number, starting at 0, and 'B' is the partition number, starting at 0. For example, if Ubuntu was installed on the second partition of the first hard-drive, the command should be
  10. root (hd0,1)
  11. Tell GRUB which drive's MBR to fix
  12. setup (hd0)
  13. Replace 0 only in the extremely unlikely event that your bios does not use the first hard-drive as the boot device. Typically Ubuntu might be on any drive but the bios will almost always go to the first drive's MBR to find out where to find the boot-loader.
  14. Leave the GRUB Command line
  15. quit
  16. And reboot.

If that method still dont work, you should try
Second Method
  1. Insert the Ubuntu CD (for recomanded Ubuntu 9.04) select live CD
  2. Once inside the desktop, open Terminal
  3. Check the Linux root partition is where the command
  4. sudo fdisk-l
  5. Once the device is known Linux root partition, suppose I have a /dev/sda6 and then type
  6. sudo mount-t ext4 /dev/sda6 /mnt/
    sudo mount-t proc proc /mnt/proc/ 
    sudo mount-t sysfs sys /mnt/sys/ 
    sudo mount-o bind /dev/ /mnt/dev/ 
    sudo chroot /mnt/bin/bash
  7. Install Grub on MBR command
  8. grub-install /dev/sda
  9. Install grub on linux partition
  10. grub-install /dev/sda7
  11. after all is finished please restart.

0 comments:

Post a Comment