LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Recovering corrupted grub (https://www.linuxquestions.org/questions/debian-26/recovering-corrupted-grub-623684/)

sunils1973 02-25-2008 08:01 AM

Recovering corrupted grub
 
My friends's dual boot system (Debian and XP)corrupted.
I think it caused because he attempted to recover from a virus attack on
windows. Any way it is not able to run the grub loader.
I think both the OS have no problem but the boot loader has been corrupted. In another situation which happened to me i have reinstalled debian and after that everything was ok for windows, means windows was there .
My question is how to correct the grub boot loader when it is corrupted.

Dutch Master 02-25-2008 08:16 AM

That's too little info. Tell us more: what can and can't he do, will any OS boot, what errors does he get?

In short: if he can boot XP, that OS overwrote the Grub entry in the MBR. That can be repaired by running a LiveCD and use that to re-install Grub into the MBR. If only Linux boots, getting XP back is as simple as editting the /boot/grub/menu.lst file to include it as a bootoption. If neither boots, he probably managed to somehow mess up the disk geometry and/or partitiontable. In this case, you'll need cfdisk or something with a GUI that does the same from a LiveCD.

sunils1973 02-25-2008 11:48 PM

Quote:

Originally Posted by Dutch Master (Post 3069051)
That's too little info. Tell us more: what can and can't he do, will any OS boot, what errors does he get?

In short: if he can boot XP, that OS overwrote the Grub entry in the MBR. That can be repaired by running a LiveCD and use that to re-install Grub into the MBR. If only Linux boots, getting XP back is as simple as editting the /boot/grub/menu.lst file to include it as a bootoption. If neither boots, he probably managed to somehow mess up the disk geometry and/or partitiontable. In this case, you'll need cfdisk or something with a GUI that does the same from a LiveCD.

Thank you it is the last one mentioed.

None of the OS's are booting. Message is GRUB error after that nothing happens.

TigerLilly56 02-26-2008 08:44 AM

Something similar happened to me. I decided to move my Ubuntu to a Microsoft Virtual Server because I need my network running constantly and everything connects through the same box. When I deleted the partition that had Ubuntu Server and rebooted I got Grub error (17) and could do nothing. After searching high and low and numerous sites I finally found one that gave me an answer that worked. (Helps if you know what the right question is). Boot from the XP install disk and select Repair from the initial options. When you get the command prompt for windows use the command FIXMBR, you'll get a warning about rewriting the masterboot record but that did the trick for me. Windows Server is loading fine, and i can move on with the Virtual Server load. Hope this helps you somewhat although it may not be the solution for you problem it probably won't hurt to try it. Good Luck!

revenge80200 02-26-2008 03:42 PM

You could download super grub from: http://supergrub.forjamari.linex.org/

It is smaller then a live CD in the case that you do not have one, and with just a few clicks, you should be able to access your OS (not to mention fix grub).

Worked fine when I had to reinstall Xp and then needed to recover Lenny.

Eric

jabx 03-02-2008 10:31 PM

load from RescueDisc
go to console
grub-install /dev/your-hd-drive

or
#grub
>root (hd0,1) ;hd0,1 change to your root-partition on HD drive (see /boot/grub/device.map)
>setup (hd0) ;hd0 change to your HD drive
>quit

then check what changed in menu.lst
#vi /boot/grub/menu.lst
and finaly
#reboot


All times are GMT -5. The time now is 06:38 PM.