LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 02-25-2008, 08:01 AM   #1
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 323

Rep: Reputation: 30
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.
 
Old 02-25-2008, 08:16 AM   #2
Dutch Master
Senior Member
 
Registered: Dec 2005
Posts: 1,682

Rep: Reputation: 124Reputation: 124
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.
 
Old 02-25-2008, 11:48 PM   #3
sunils1973
Member
 
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 323

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by Dutch Master View Post
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.
 
Old 02-26-2008, 08:44 AM   #4
TigerLilly56
LQ Newbie
 
Registered: Feb 2008
Location: Lexington and suburban Detroit
Posts: 4

Rep: Reputation: 0
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!
 
Old 02-26-2008, 03:42 PM   #5
revenge80200
Member
 
Registered: Mar 2004
Location: Chicago
Distribution: Lenny & Xp
Posts: 238

Rep: Reputation: 30
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
 
Old 03-02-2008, 10:31 PM   #6
jabx
LQ Newbie
 
Registered: Feb 2008
Location: Troitsk/74/RU
Distribution: OpenSUSE10.3/Debian4.0
Posts: 1

Rep: Reputation: 0
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering grub almon Linux - General 21 06-20-2007 02:22 PM
Recovering grub almon Linux - Newbie 2 06-17-2007 10:25 AM
Recovering Grub after Windows Install paul-r Debian 1 01-28-2006 11:52 PM
Problem in recovering GRUB ilyushin Linux - Newbie 1 07-07-2005 11:55 PM
Lilo config or recovering Grub....??? avols143 Linux - Newbie 5 03-03-2004 07:03 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration