Sunday, September 7, 2008

grub errors

if you somehow delete the linux partition from windows, then it is very likely to get grub error. That means when we boot it looks like grub>

To recover windows ntloader you need only a winxp cd.
Boot your pc with cd and when blue screen appears, press 'r' for a recover console and then type 'fixmbr' in the console. Take the cd out and restart your system. you did it

If you dont have a cd or if you want to boot winxp for once:
Type the following commands at the grub command prompt
grub> rootnoverify (hd0,0) #(hd0,0) means your hard disk id in which you installed winxp
it may be (hd0,1); it depends
grub> makeactive
grub> chainloader +1
grub> boot

note: But in this method you need to type all the commands everytime you want to boot winxp

Suppose you installed windows after linux, you wont see linux option in the boot menu and starts windows automatically. Thats because windows will erase mbr.
To recover that you need first cd or rescue cd of linux. Boot from cd and type this at boot prompt:
boot: linux rescue
This will go some options which then leaves to a shell prompt. Type these commands at that prompt:
prompt: chroot /mnt/sysimage
prompt: grub-install /dev/hda #hda refers to your hard disk naming. It may be hdb or sda
prompt: exit
remove the cd and reboot it . you did it
Note:
we cant boot windows which is installed in logical drive and linux in primary drive

No comments: