Monday, 22 March 2010

Recovering Corrupted/Malfunctioned GRUB in Linux

This problem is actually not related to NGW100 :) However I wanted to give solution how to recover your corrupted/crashed GRUB menu due to some reasons. Well, most common reason for GRUB to crash is a new Windows installation over Linux which is a process that writes specific information to your PC's boot sequence. People are having great difficulty if their GRUB is crashed. They may even cannot boot any of the installed operating system. So in this article I'm gonna try to help recovering your GRUB.

All the operations below must be done with administration privileges.

1. First of all you should get a Live CD of any Linux distro. In my situation I'm using Ubuntu CD to boot my computer.

2. After booting your Ubuntu using Installation CD or Live CD(earlier versions of Ubuntu, now you can use Installation CD as Live CD) you need to get yourself into Linux's terminal.

3. Well only information you need at this moment is what partition has what operating system. Fortunately GRUB's setup will help you decide those partitions. Unlike most of humans(yea, yea)
GRUB starts to count from 0 not 1. So lets say you have 2 HD's in your computer first one is hd0 and 2nd one is hd1.Same rule will be applied to your partitions. If your Linux operating system is installed in your first hard-disk and 2nd partition then you have (hd0,1).

4. Based on our previous assumption you need to get to grub interpreter by typing grub. After that follow the codes below:

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


Now you can reboot your computer safely into your operating systems :)

P.S: fdisk -l will give you some information about your hard-disks, partitions and operating systems. If you're not sure where your operating system (mainly your linux partition) then I suggest you to use that information.

No comments:

Post a Comment