PDA

View Full Version : Orphaned GRUB on the MBR



CytoTech
10-06-2005, 05:20 AM
Hi, I have Windows XP installed on the first partition, then i installed Mandrake 10.1 and instructed it to put the GRUB bootloader onto the MBR. then, I installed Knoppix last by using the "tohd=" cheatcode and added the grub entry for knoppix from mandrake. then, i changed my mind and from mandrake, i deleted the knoppix partition, fixed the grub entry. after a day, i decided to reinstall mandrake, but this time, i didn't put grub on the MBR, i put it on the mandrake partition. after restarting from the installation, i only see the word "GRUB" on my screen. the hard part here is that of all the rescue CDs i have (BART PE and linux live cds), none have fdisk on it that i can use to fix the mbr.

QUESTION: does anybody have an idea to fix the mbr using KNOPPIX? i know i can do it with a dos boot disk, but i haven't got the boot disk nor a working floppy drive to insert a boot disk. I have to be less dependent of M$ windows now and so i'm looking for a linux alternative. I know you'd think that i'm such a **** to let that happen, but it happened already and i need your help. Thanks!

---

It seems that i'm not alone with my problem... i browsed a blog at http://www.davidpashley.com/cgi/pyblosxom.cgi/debian and on his blog entry on Sun, 27 Jun 2004, he encountered the problem almost exactly as mine. i just would want to avoid having to reinstall XP... silly me... if only i could turn back time... any other ideas, guys?

UnderScore
10-06-2005, 04:52 PM
Thank you for providing lots of background info but I need to know but I am unable to figure out what you want or how you want your system to behave.

Do you want to remove grub and use the Windows XP bootloader only?
Do you want grub to boot normally from the MBR so that you can access both Windows & Mandrake?
Or do you want something different?

sakiZ
10-06-2005, 05:07 PM
Like Underscore, I'm not sure what you want after all those installs.

Looks like you need your MBR fixed for one thing. I can't tell if you can't boot XP anymore or not.

If you can't boot XP anymore, you need to use your XP install CD and get into the command console. There is a "Fix MBR" command in it you can use.

sakiZ

jjmac
10-10-2005, 11:06 AM
The problem is that you didn't bother to uninstall grub first. I would think that grub would have that facillity. No one reads their docs/man pages :roll:

>>
It seems that i'm not alone with my problem.
>>

Yes, you are one of many (grin)

But ...

Have you got anything in your boot directory that looks like it might be a mbr backup ?

I can't say much on grub ... but if it was lilo you would have a 512 byte file called boot.0300 in your /boot directory which would be a copy of the whole mbr including the table as it was for the original install.

In lilo, to replace it it would just be "lilo -u" wahlah !

I would be very surprised if grub didn't do something similar, read through the man pages/docs with that in mind !.

If you find something that could be a candidate, it should have a date that corresponds to the original mdk install date.

Have a look at it in "hexedit" or an equivalent hexeditor. Look for the last two bytes in the file, they should be "55AA". The actual boot code will vary depending on the windows version that originally installed it. But it should contain a text string along the lines of
" Invalid partition table. Error loading operating system. Missing operating system........"

If so ... you have found it, from there just do ... as "root"

]# dd if=<found-file> of=/dev/hda bs=446 count=1

Only copy the first 446 bytes back or you will screw up your existing partition table.

Don't reinstall XP straight away though, try the suggestion in the other post above, ie; use the recovery facility of your windows install cd. Mount it and look see what it has available. Go to a computer shop in town and ask someone if they have a spare startup disk with fdisk for windows on it. Offer to pay for the floppy. Best to go for a small struggling shop though, rather than a large trendy one. The smaller ones are more likely to understand, or have the time to :)

Can you mount your windows from a LiveCD ???

If so, can you navigate to the C:/windows/command directory or its equiv ??? there should be a "fdisk" there. But then you need to get it on a bootable dos startup floppy ?

Good Luck.


jm

CytoTech
10-11-2005, 08:49 AM
well, what i did was just to use the good ole w*n XP CD and use fixmbr and use diskpart to delete the offending partition/s. also, i have to activate the partition of wind*ws so it boots fine. thanks for the info about lilo uninstall thing. it's great to have a caring community here at knoppix.net!
*peace*