Tuesday, July 3, 2007

GRUB recovery after installing Windows XP

If any one use dual boot system then after installing windows again we lost GRUB loader. It can recover in various method. Here i discuss GRUB recovery using Live cd. For this we have to boot our system by Live cd.Then in terminal

sudo fdisk -l

to see the partitions,we'll see something like this..

Disk /dev/hda: 81.9 GB, 81964302336 bytes
255 heads, 63 sectors/track, 9964 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1275 10241406 c W95 FAT32 (LBA)
/dev/hda2 1276 2187 7325640 83 Linux
/dev/hda4 2806 9963 57496635 f W95 Ext'd (LBA)
/dev/hda5 2806 4080 10241406 b W95 FAT32
/dev/hda6 4081 5355 10241406 b W95 FAT32
/dev/hda7 5356 6630 10241406 b W95 FAT32
/dev/hda8 6631 9963 26772291 b W95 FAT32


Here my linux partition is hda2.
Now we have to type

cd /boot/grub

then type

grub

we'll see

grub>

in terminal.
then type

grub> root (hd0,1)
grub> setup (hd0,0)
grub>quit

Now reboot your Computer and watch.

Spacial thanks to Suzan bhai & Asad

Note: For hda1,sda1 it'll be (hd0,0),hda2,sda2 it'll be (hd0,1),hdb1,sdb1 it'll be (hd1,0)

No comments: