Jump to content

Will an XP Repair Install mess up MBR?


JorgeA

Recommended Posts

I need to reinstall or repair-install XP Pro on a multibooting PC that also has Vista Business (32-bit) and Netrunner 12.12 (x64) on it. The booting process appears to be controlled by a version of GRUB that came into existence on my computer when I installed Netrunner (the third OS on the machine). If I reinstall or repair-install XP, will it screw up the MBR such that I'll lose the option to boot into Vista or Netrunner, or can I expect the MBR to be left alone by the XP reinstallation process?

Thanks!

--JorgeA

Link to comment
Share on other sites


A "normal" install of any MS system will always try to (and usually succeed ;)) "take control" of the booting sequence.

Particularly an XP setup is made of 2 steps, the first one where the $WIN_NT$.~BT and $WIN_NT$.~LS are created on a hard disk volume and the second where files from it are actually booted from.

The usual procedure is:

  1. fully understand your current boot sequence
  2. save/backup, etc.
  3. install the Windows XP
  4. restore the previous situation

If you installed Netrunner, it is likely to be using either GRUB (the real. good ol' thing that the good Linux guy senselessly now call "GRUB legacy") or GRUB2 (the new thing that the good Linux guys senselessly now call GRUB, thus creating a lot of confusions/misunderstindings).

Procedure to restore/reinstall the one or the other is different, most probably Netrunner installer/.iso does have a "repair" provision, point is that it may not find your old configuration file (menu.lst or grub.cfg) and find only the just reinstalled XP, so that the result will be a dual boot XP/Netrunner and Vista will be inaccessible/unbootable.

I would personally make an "external" media (like a USB stick or a floppy, or even a CD) with grub4dos, NTLDR, NTDETECT.COM, BOOT.INI, BOOTMGR and /boot/BCD capable of booting all three systems as they are now, to be on the "safe side" and reinstall the XP only after you have tested and verified working this solution (BTW, I would have made this anyway, even if no reinstall of XP is foreseen/foreseeable).

jaclaz

Link to comment
Share on other sites

Thank you very much, jaclaz, this is a great help.

The XP partition (C: drive) and the Vista partition (F: drive) each have their own BOOTMGR file. Same size (326 KB) but different dates. Which one should I put on the boot CD that I'd be creating? (I'm guessing the one from the XP partition.)

--JorgeA

Link to comment
Share on other sites

Yes, XP will leave you with a XP only boot option. Jaclaz has a good suggestion. Here is another option or maybe better said, a thought. Use a live CD of most any flavor of Linux and use "dd" to copy the MBR to a safe place. Then after the repair/reinstall, just reverse the process. The Linux Journal had an article about this three or so years ago, so you could probably find how to use dd to this there. I mentioned this on another thread here some time ago, maybe I'll go see if I can find it and post back.

Found the post and the link still works, so here it is: http://www.linuxjournal.com/magazine/hack-and-when-disaster-strikes-restoring-master-boot-record

edit to place link to article.

bpalone

Edited by bpalone
Link to comment
Share on other sites

Installation was in this order, correct?

1 - XP from Bootable CD

2 - Vista from Bootable DVD

3 - Netrunner from Bootable CD/DVD

None of which will "understand" time zones, only what's on the CD/DVD at the time of Build, wherever it was "built, and in the case of Windows will be "specifically" set using (usually) GMT/UTC as basis and a Time Zone Offset.

The one on "C-drive" (probably) came from the WinPE (within BOOT.WIM) and the one on the "F-drive" undoubtedly came from the INSTALL.WIM. A Binary Compare will probably reveal they're exactly the same.

Followup - bpalone just suggested something (before I posted). I might suggest that you get the whole front of the MBR/"Reserved" (sectors 0-62) since Netrunner "could" be using several sectors, and even made a "backup" of the original (Vista, since it was installed second) somewhere. :unsure:

Link to comment
Share on other sites

The "dd" method sounds conceptually simpler, thanks. Although I will still implement jaclaz's idea as a precaution, as a CD is "forever" (can't be erased by mistake).

An initial Web search for information on the Linux "dd" method led me to TestDisk, which apparently can be used to fix the MBR. Wonder if I could do the XP reinstallation with no preliminary steps, :ph34r: and then use TestDisk as needed.

--JorgeA

Edited by JorgeA
Link to comment
Share on other sites

Installation was in this order, correct?

1 - XP from Bootable CD

2 - Vista from Bootable DVD

3 - Netrunner from Bootable CD/DVD

Yup, that's exactly the order in which they were installed. The only (possible) difference from your description is that XP was factory-installed. The computer came with both XP and Vista disks. There is also a pre-installed D: recovery drive based on XP.

--JorgeA

Link to comment
Share on other sites

How about the instructions given in post #7 from this thread? They sound especially relevant because I'd be doing precisely what he says -- copying to the same disk with the same unchanged partitions.

--JorgeA

Edited by JorgeA
Link to comment
Share on other sites

An initial Web search for information on the Linux "dd" method led me to TestDisk, which apparently can be used to fix the MBR. Wonder if I could do the XP reinstallation with no preliminary steps, ph34r.png and then use TestDisk as needed.

First rule to follow is number 1, which is Make Backups. Rule Number 2. See Rule Number 1.

It is much less stressful, to have a good quality backup setting on a drive, disks or whatever. Using a tool designed to help save data and installations as a front line defense item would make me quite nervous. I don't know if you have ever experienced a hard drive failure or not. But, I have and it was a complete failure. I had to to redo an entire years worth book keeping, because I didn't have a backup. Needless to say, I came upon a whole new religion about the use of and necessity of backups.

Probably wouldn't hurt have the tool available, as you can't have to many tools.

bpalone

Link to comment
Share on other sites

How about the instructions given in post #7 from this thread? They sound especially relevant because I'd be doing precisely what he says -- copying to the same disk with the same unchanged partitions.

--JorgeA

That is the correct answer. I was assuming you were not going to be changing anything other than just repairing/reinstalling XP. Speaking of that, be careful with using Vendors installation media. I don't know if they did during the XP era, but I had an instance with a Windows 7 reinstallation that it took the ENTIRE disk without even asking. I had pre-partitioned it to have a Linux partition and a NTFS Windows partition. No data loss, just some time, but I was not a happy camper.

So to repeat myself:

1.) Make backups.

2.) See Rule Number 1.

bpalone

Link to comment
Share on other sites

...and a Follow-Up - betting that your Restore (Recovery) Partition will no longer function because you have already wiped the Vendor-Specific MBR code, unless you can find a method of recreating it -or- knowing a method of utilizing the Restore Partition depending on the Image Type made by the Vendor.

The computer came with both XP and Vista disks. There is also a pre-installed D: recovery drive based on XP.

How odd, seeing as how it has the D-RecoveryPartition.

edit - typos.

Edited by submix8c
Link to comment
Share on other sites

First rule to follow is number 1, which is Make Backups. Rule Number 2. See Rule Number 1.

Excellent advice, which I will follow. :)

--JorgeA

P.S. I forgot to comment about HDD failures. I've had two of them (in laptops) in the last year, on different machines. Macrium Reflect (free edition) has been a very good friend in these cases. (OTOH, I had a Seagate Replica external drive which claimed to keep a "bare metal" image that could be restored if disaster struck. Well, disaster did strike my laptop and the Replica software was worthless. Macrium to the rescue!)

Edited by JorgeA
Link to comment
Share on other sites

...and a Follow-Up - betting that your Restore (Recovery) Partition will no longer function because you have already wiped the Vendor-Specific MBR code, unless you can find a method of recreating it -or- knowing a method of utilizing the Restore Partition depending on the Image Type made by the Vendor.

Huh, that's interesting. Good thing I have an image of that whole disk (all three OS's).

--JorgeA

Link to comment
Share on other sites

JorgeA

You seemingly miss some background.

A MBR is made of three main parts:

  1. CODE
  2. Disk Signature (only on NT based systems) (DATA)
  3. Partition Table (DATA)

A "normal" MBR has additionally these two characteristics:

  1. it is 512 bytes long (i.e. it fits entirely in the first sector)
  2. its only scope is to chainload the first sector (PBR) of the Primary partition marked as actiive in the partition table.

Booting sequence for a "normal" MBR:

BIOS->MBR->PBR of Active Primary partition->loader or system file->OS

In XP:

BIOS->MBR->PBR of Active Primary partition->NTLDR->BOOT.INI choices->NTDETECT.COM-> XP OS

In Vista:

BIOS->MBR->PBR of Active Primary partition->BOOTMGR->\boot\BCD choices->WINLOAD.EXE-> Vista OS

A Linux behaves differently.

The GRUB or GRUB2 can be installed BOTH to the MBR (but in this case it will take more than the first sector) or to the Volume/Partition (PBR).

IF the GRUB is installed to the MBR, it will look for it's own files, and then access it's configuration file (either menu.lst or grub.cfg) where the "choices" are.

IF the GRUB is installed to the PBR, the MBR may remain a "normal" one, still only chainloading the PBR of the active partition, which will then load GRUB.

We have to understand if your MAIN bootmanager is currently the Vista BOOTMGR or either GRUB or GRUB2, and how EXACTLY they are set.

TESTDISK (as well as other data recovery oriented tools) will only care about the partition table of a MBR (completely ignoring both the code and the disk signature).

Of course any install will NOT change the partition table (nor the Disk Signature, unless it is empty or having a collision with another disk).

The XP install will change the CODE of the MBR, replacing it with a "normal" MBR simply chainloading the PBR of the active primary partition.

It will also change the CODE in the PBR writing one that will load NTLDR.

It will "keep" the contents of BOOT.INI.

But if you installed those three Operating Systems in that order, the Vista install will have:

  • replaced the MBR with some slighly different code (but that still chainloads the PBR of the active partition)
  • replaced the PBR code with one loading BOOTMGR
  • added to the \boot\BCD an entry corresponding to the one(s) you had before in BOOT.INI

The point is then which bootmanager Netrunner uses and HOW EXACTLY it was installed.

It could have been installed at least in two ways:

  1. to the MBR (and hidden sectors) and become the "main" bootmanager
  2. to the PBR (of another partition dedicated to the Linux OS) and added as an entry to the \boot\BCD

jaclaz

Link to comment
Share on other sites

Excellent explanation! (Keep it for future questions/reference)

...bearing in mind the OEM's "special" MBR Code is now long-gone with the advent of Vista's "replacement", hence the references to that "RecoverPartition" (possibly no longer "useable"). :unsure:

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...