grub has coprrupted mbr

Asked by Jack Davis

When I installed Ubuntu by itself on my hard disk, it wiped out the MBR. I need to reinstall Windows XP. Windows won't recognize the hard disk - no MBR (Master Boot Record), only Grub shows on bootup. How can I rebuild the MBR and install Windows XP? There is no OS on the hard disk right now. I am an Ubuntu newbie.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu software-center Edit question
Assignee:
No assignee Edit question
Solved by:
Jack Davis
Solved:
Last query:
Last reply:
Revision history for this message
Jez (hoppy1971) said :
#1

Hi
You need to install XP first, then Ubuntu.
XP will then show as an option in Grub, there is no need for Windows MBR.
If you install Ubuntu first, when you install XP it will erase Grub and you will not be able to boot into Ubuntu.
Hope this helps.

Revision history for this message
applecache(Nolan King) (nolanking) said :
#2

Hello

I agree but also disagree with what jez has said.

Jez said; "If you install Ubuntu first, when you install XP it will erase Grub and you will not be able to boot into Ubuntu." which is true but misleading. You can get back into ubuntu by inserting your cd/dvd that you used to install ubuntu in the first place. From there you can run recovery mode which can reinstall the grub2 menu. Notice i used grub2 with the number 2( grub my itself without a number was eliminated)

You can also bring up a terminal in the Live cd/dvd of ubuntu (Live meaning that you dont make alterations to the computer and run ubuntu in a "virtual" environment ie live mode) and then type sudo update-grub

But rather follow the tutorial if you are a newbie:
https://help.ubuntu.com/community/GrubHowto?highlight=%28%28Grub2%29%29
 and navigate to this section >>>> Backup, Repairing and Reinstalling GRUB

All the best :)

Revision history for this message
Jack Davis (edavis9) said :
#3

Perhaps I should explain a bit more. I need to return this disk (actually the Acer AR1600 nettop) to "like new" condition, which had XP only and some other Acer programs. I have the "return to factory setup" backup disks. Although I can't get into the XP to check it out, they seemed to install all right, except for Grub replacing the MBR. Now I get the "grub rescue" error and it won't boot. I need to rebuild the MBR.

Since this computer is being returned, it can't have Ubuntu on it. That's a shame, because Ubuntu is a much better, much faster OS.

Thanks to jez and applecache for their suggestions. I don't think either solves my problem. I will check out the GrubHowTo doc. I do run Ubuntu LiveCD sometimes.

Revision history for this message
delance (olivier-delance) said :
#4

I am surprised because in company the first thing done is to format and reinstall disk.
Using an unknown disk is too dangerous.

You should be able to boot on XP backup disk, except if your CDs are too old.
Use also a Ubuntu LiveCD to check if there is not a hidden partition for system recovering.
If it is true, you could access it at boot time, by entering in BIOS.

Revision history for this message
Jack Davis (edavis9) said :
#5

Thanks, delance, but XP from anywhere will find the hard drive. The Recovery Partition doesn't change the MBR.

Still have the problem: How can I replace Grub loader with an MBR recognized by Windows?

Revision history for this message
Jack Davis (edavis9) said :
#6

Last message should have read:

Thanks, delance, but XP from anywhere will NOT find the hard drive. The Recovery Partition doesn't change the MBR.

Still have the problem: How can I replace Grub loader with an MBR recognized by Windows?

Revision history for this message
applecache(Nolan King) (nolanking) said :
#7

Hello

Off the top of my head i think there is a way.

If you can boot into ubuntu whether through the Live CD/DVD or actual as in ubuntu already installed on the laptop you should naviagate to your windows partition.

In it go to the c: drive where the windows and program files are on. In it there should be a boot.ini file of which you can edit. Im not too familiar with boot.ini so you definitely have to research before you edit but you can probably change the MBR there???

Revision history for this message
Jack Davis (edavis9) said :
#8

Thanks, applecache, that's a very good idea. I will try it tomorrow.

Revision history for this message
thelinuxfan (arparp3733) said :
#9

Hey, if you want to reinstall/restore the Windows bootloader, there is a way.
Boot from XP installation disk.
Then, there should be an option to Repair/Restore the computer...I am not sure about the exact title.
Should be something similar.
This will lead you to command line.
There, enter this command:-
                  fixmbr
This should solve your problem.
If this doesn't, boot from the XP disk again, reach to the command line interface,
and then, enter these two commands in the exact sequence:-
                  fixboot
                  fixmbr

These should solve your problem.

Revision history for this message
Jack Davis (edavis9) said :
#10

Still no solution. Unfortunately, none of the suggestions panned out. Has anyone got the answer?

Revision history for this message
delance (olivier-delance) said :
#11

http://www.arsgeek.com/2008/01/15/how-to-fix-your-windows-mbr-with-an-ubuntu-livecd/

If it doesn't work, can you tell me, in PC manual, which is the procedure to restore WIndows when there is a problem.
Even if it doesn't work today.

Revision history for this message
Jack Davis (edavis9) said :
#12

If I understand your question right, in XP, boot from an XP setup disk, then when it stops select R for the Recovery procedure. That's all the farther I got, because it never recognized the hard disk though it did find a USB disk once.

That might be a way to fix it, using an USB enclosure. I will have to try that.

Revision history for this message
delance (olivier-delance) said :
#13

My understanding of english is limited.
Does mean "XP setup disk" a floppy/CD you did when you power on the PC the first time, or a provided media, or does it means the hard drive ?

Revision history for this message
Jack Davis (edavis9) said :
#14

By XP setup disk I meant the original Microsoft XP CD and boot from the CD not the hard drive.

Revision history for this message
delance (olivier-delance) said :
#15

Do you have today this CD ?
Did you tried to boot on this CD ?
Was it what you means by "The Recovery Partition doesn't change the MBR." ?

Revision history for this message
Jack Davis (edavis9) said :
#16

Yes, I have it and I booted from it. It could not find the hard drive.

I don't know about "The Recovery Partition doesn't change the MBR."

Revision history for this message
delance (olivier-delance) said :
#17

If XP CD could not find the hard drive, it should not be a problem of MBR.
This CD is supposed to be used to reinstall the MBR.

Can you use a Ubuntu Live CD
   1) open GParted
   2) report the partitions discovered by GParted
I need to know:
   partition name (/dev/sda1 and label if there is a label)
   file system
   is bootable

Revision history for this message
Jack Davis (edavis9) said :
#18

Thanks for the help, delance. I have changed that disk so I can use it in my netbook. It boots up from Grub OK, so no problem.