Thursday, January 29, 2009

How to repair the GRUB..

I have been using both Windows XP and Ubuntu 8.04 as the operating systems in my laptop. But after formatting the Windows XP OS of my laptop, I had no way of accessing the ubuntu partition. I was wondering whether I will have to reinstall ubuntu in my laptop. Then I found the solution. The following steps will lead you to repair the GRUB and reaccess the unseen ubuntu partition, if you have the same problem.

1. Boot the PC or Laptop with an Ubuntu Live CD.

2. Open a Terminal

3. Type the following command..

sudo grub

4. Type the following followed by the TAB key

root (hd

5. This will show the list of physical drives.

6. Type the number of the drive you installed ubuntu on,.

7. If you are not sure about the ubuntu installed drive add a ‘,‘ after the number and press theTAB key again.

root (hd0,

8. This will enable you to see something like following,

grub> root (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0×7
Partition num: 1, Filesystem type is ext2fs, partition type 0×83
Partition num: 2, Filesystem type unknown, partition type 0×7
Partition num: 3, Filesystem type is fat, partition type 0xb
Partition num: 4, Filesystem type is fat, partition type 0xb

9. The ext2fs partition is the one Ubuntu is installed partition of your machine. 

10. The type the following with replacing 1 with the ubuntu installed partition num of your mechine.

root (hd0,1) 

11. Finally type the following, replacing hd0 with the physical drive Ubuntu is installed

setup (hd0)

This worked out fine for me. Hope it will work with you too. Let me know if there are any issues.

Cheers!!



No comments: