LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices

Reply
 
Search this Thread
Old 03-19-2005, 09:56 PM   #1
stunter
Member
 
Registered: May 2004
Location: Kitsap, Washington
Distribution: Fedora Core 4
Posts: 107

Rep: Reputation: 15
MDK 10.2 GRUB - Windows killed MBR


I have a dual boot system with WinXP and Mandrake 10.2. This problem all started when my router died, my son came home from college and played on the internet in Windows---using Internet Explorer. He managed to get a virus that wiped out a bunch of WinXP system files. After spending a ton of time trying to figure out how to fix the WinXP installation I finally just re-installed it over the old one. Now Windows works fine (and all my Windows games are intact---the primary reason I keep it aound).

Anyway, at some point in the process, Windows, as is it's way, figured it was the only system around and overwrote the MBR. Now, I know there's a way to re-establish the GRUB MBR, but I can't for the life of me remember it. I've spent most of the afternoon googling for it, but haven't found an answer. I can boot off the Mandrake 10.2 installation CD and get to a command line, but I haven't been able to come up with the right commands. I did try the rescue option, but it appears to only work if you use lilo. I read the How-to here on LinxuQuestions, but apparently 10.2 won't accept the commands. Here's what I tried:

From command line:

grub (to get to the grub prompt)
root (hd0,0) (says that this is not a recognized partition)
setup (hd0) (says that it cannot recognize this device)

The linux installation is still there (it's on another hard drive) and I can get to pretty much everything through the CD installed command line. This happened to me a couple of years ago and I found the answer somewhere, but for whatever reason I can't find it now.

Thanks for any help. I promise I'll write it down this time.

stunter
 
Old 03-19-2005, 10:09 PM   #2
spoody_goon
Member
 
Registered: Sep 2003
Location: Michigan USA
Distribution: Mandrake, DamnSmallLinux, VectorLinux
Posts: 416

Rep: Reputation: 30
I have had the same problem, the Mandrake cd should have a tool. Choose rescue at the cd comand prompt and there should be a reinstall grub listing there and it will automatically detect your partitions
 
Old 03-19-2005, 10:10 PM   #3
rshaw
Senior Member
 
Registered: Apr 2001
Location: Perry, Iowa
Distribution: Mepis , Debian
Posts: 2,694

Rep: Reputation: 45
grub-install /dev/hdx
 
Old 03-19-2005, 10:12 PM   #4
stunter
Member
 
Registered: May 2004
Location: Kitsap, Washington
Distribution: Fedora Core 4
Posts: 107

Original Poster
Rep: Reputation: 15
Thanks guys.
 
Old 03-20-2005, 01:13 AM   #5
stunter
Member
 
Registered: May 2004
Location: Kitsap, Washington
Distribution: Fedora Core 4
Posts: 107

Original Poster
Rep: Reputation: 15
Well, I'm back. No luck as it turns out.

I tried doing grub- install from the command line gotten to from the MDK boot cd. Didn't work at all. Just gave an extended list of what it couldn't find. Then I tried mountingt the linux partition from the initial menu, going to a command prompt and then doing a chroot to mount /mnt and tried again. Says that it can't mount partition. Hmmm.

From the grub> prompt, I did a find /boot/grub/stage1 to find the partition name. That was hd1,0. So tried doing setup from the grub> prompt.

setup (hd0) (hd0,1)

That seemed to work in that it said it found everything, but rebooting just put me into Windows again. No grub.

I should say that my Windows installation is on hda1. The linux partition is installed on an SCSI hard drive sda1. Now, as I understand it, grub installed in the MBR of hda. Yes? Any other idea?

I'm about stumpted.

stunter

____________________________________________

Back after another try.

OK, so I tried it again. Booted up with the intall CD with the rescure option. Mounted my linux partition from the initial menu (which also loads the SCSI drivers). The partition is mounted to /mnt (according to the message it gives). Then I bailed to a console. I did a chroot /mnt to transfer control the partition to my linux partition. Tried:

grub-install /dev/hda

the message I got back was weird. It said:

/dev/ram3 does not have a corresponding BIOS drive

Tried:

grub-install hd1,0 and got back a "does not exist" message. So it seems I'm doing something wrong here.

Went ahead and typed "grub" to get to a grub> prompt and tried again to do the setup that way.

grub> find /boot/grub/stage1 returns hd1,0.

grub> setup (hd0) (hd1,0) seems to install everything. Gives a list of everything it finds and it all seems fine. But rebooting does not give me the grub menu.

Thanks for any help.

stunter

Last edited by stunter; 03-20-2005 at 01:47 AM.
 
Old 03-20-2005, 03:49 AM   #6
r0jaws
Member
 
Registered: Feb 2005
Location: Norfolk, UK
Distribution: Ubuntu
Posts: 40

Rep: Reputation: 15
if you haven't already looked try here,
GRUB from the ground up
hope it helps
 
Old 03-20-2005, 08:32 AM   #7
oldforce
Member
 
Registered: Jun 2004
Location: Turkey, Istanbul
Distribution: Novel Suse Professional 9.3
Posts: 86

Rep: Reputation: 15
answer

start installation and choose update existing mandrake version...
iy will fix grup and no files will be effected in your linux directories
 
Old 03-21-2005, 09:07 AM   #8
stunter
Member
 
Registered: May 2004
Location: Kitsap, Washington
Distribution: Fedora Core 4
Posts: 107

Original Poster
Rep: Reputation: 15
Thanks again, guys. Turned out to be weird sort of permission issue. From command line, I changed the permissions on the /boot directory then did the setup thing through the grub> prompt. It all works now (though not my internet connection, but that is my ISP, not me. They tell me they will have it fixed by today).

Thanks for the responses. Don't you just love Megalomania Bill?

stunter
 
  


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
grub and lilo on MBR with Windows xp blotch Linux - General 6 11-18-2005 09:57 PM
MBR killed after re-install of windows? heri0n Slackware 11 06-21-2005 01:27 PM
GRUB MBR overwritten by WIN98 MBR TOuseef Linux - General 7 11-14-2004 04:25 PM
Will "grub-install /dev/hda" kill Windows XP MBR? Zullocrit Linux - Newbie 3 09-25-2004 09:50 AM
XP killed my mbr goldie1 Debian 7 06-24-2004 01:44 AM


All times are GMT -5. The time now is 02:31 AM.

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