Dual Boot Restore

H

hawk

I have a system that has Win98 on physical drive "C". I installed
WinXP on physical drive "D" in a dual boot configuration. Everything
worked perfectly. Then I decided to format drive "C" and re-install
Win98. I read the MS page about a WinXP recovery disk and I formatted
a floppy from WinXP and copied files from drive "C", (boot.ini,
bootsect.dos, ntldr and ntdetect.com). But after Win98 was installed,
the only way I can boot to WinXP is to have the recovery disk in the
drive.

I have read many MS pages regarding fixmbr, fixboot, dual boot, etc.
And I have read Doug Knox's page. And I have read other WinXP News
Groups and asked a few questions and have gotten a few answers that
have not answered my questions. Some say use fixmbr some say use
fixboot. Some say fixboot destroyed the partition table, etc. So, I am
confused as to the correct course of action.

Could someone give me an explanation of what needs to be done to
restore my system to the dual boot set up that I had before the format
and re-install of Win98?

My research has led to a limited understanding of the boot process.
The BIOS determines the boot device, and then loads the first sector
of the first track of the boot device into memory and transfers
control there. If the boot device is a HD, this "boot sector" is also
known as the "Master Boot Record", (MBR). The MBR code then loads a
different "boot sector" from the active primary partition into memory
and transfers control there. That code then completes the boot to the
proper OS.

Questions:

Where is the code that displays the boot menu? Is this the MBR code or
the primary partition boot sector code?

Why do people talk about MBR and boot sector as if they were the same
code? Or, if there is only one maximum size partition on the boot
device are they the same?

Anyway, you get the idea as to my confusion. Any and all help will be
much appreciated.

Regards, hawk
 
P

Patti MacLeod

Hi hawk,

The best explanation that I have found, thus far, of how dual boot 9x and
NT-based OS works is the following (credit R.C. White).......although
written with 9x/2K in mind, it is equally applicable to 9x/XP (except that
the reference to WinNT folder would be Windows folder):

"When your computer starts to boot, it's pretty dumb. All it knows is what's
in the BIOS. That tells it to read the first sector of the first hard drive,
which contains the Master Boot Record. The MBR holds just a few bytes of
code, plus the partition table. Each partition (and each volume in the
extended partition) starts with a boot sector, with either DOS/Win9x-style
or WinNT/2K-style data in it. The Win9x boot sector tells the computer to
load C:\io.sys and C:\msdos.sys, which starts Win9x. When you install Win2K
on a computer that already has Win9x, Win2K first saves a copy of the old
boot sector as C:\bootsect.dos. Then, it writes the Win2K data into the boot
sector, which tells the computer to load C:\ntldr, instead of io.sys.
C:\ntldr calls C:\boot.ini, which puts the dual-boot menu on the screen. If
you select Win9x, it reads bootsect.dos, io.sys and msdos.sys and boots
Win9x. If you choose Win2K, it reads ntdetect.com, which sends it to
whatever volume you have selected for the Win2K "boot volume", where it
finds the \WinNT folder, containing ntoskrnl.exe and all the other files
that it needs to boot Win2K.
C:\boot.ini is a short and simple text file with no magic properties, except
that it is hidden, system and read-only. It never looks for ntldr; ntldr
looks for boot.ini, and then for a specific drive number and partition
number, where it expects to find the \WinNT folder, or for C:\, where it
expects to find the Win9x system files, which will point to the Win9x boot
files."

Hopefully the above clears up some of the confusion. As to your Questions:

1) the "code" that displays the boot menu is the boot.ini file, which is
neither the MBR nor the boot sector code.

2) I don't know why people refer to MBR and boot sector as if they were the
same code, as they're not. And no, if there were only one maximum size
partition, the MBR and boot sector would not be the same code.

IMHO, the best course of action would be fixboot, not fixmbr (unless you're
having problems booting into 98 also). All I can additionally say at this
point is that I have recommended Doug Knox's "Repairing the Windows XP Boot
Loader" (when installing 98 after XP is already installed) instructions to
quite a few others who were in similar circumstances to your current
dilemma, and all met with success.



Regards,
 
H

hawk

Thanks for your reply. Just a couple more questions. In your
description of the boot process, where you say, "When you install
win2K on a computer that already has Win9x... Win2K first saves a copy
of the old boot sector.. Is this "boot sector" the one in the active
partition or the boot device "boot sector" (MBR)? The implication is
active partition boot sector. If so that means that fixboot would be
the correct procedure.

But, in the past I had a system with Win98 and Linux in a dual boot
configuration. When I ditched Linux, I used fdisk /mbr to get rid of
Linux LILO and restore the standard MBR.

Second question, Doug Knox says that his procedure only works for a
system where WinXP is installed on "C" drive. I don't understand that
disclaimer. And the first steps in his procedure with the debug
routine copies the MBR of "C" drive to the file C:\BOOTSECT.DOS. To
me, the debug routine clearly reads the first sector of "C" drive.
This implies that the MBR is what is being changed, even though Doug
says to use fixboot.

So, I am still confused. Further comments much appreciated.

Regards, hawk
 
H

hawk

Well, I have answered one of my questions. Doug Knox's debug routine
is being executed from a Win98 boot floppy, not from "C" drive. So,
the first sector is the boot sector. Since I have a copy of
bootsect.dos, I don't need to go through this part of the procedure.

I guess the only question left is about his disclaimer regarding the
procedure only working on a system where WinXP is installed on "C" drive.

Regards, hawk
 
H

hawk

Whoops! I have been looking at this stuff for too long. The debug
statement, L 100 2 0 1, clearly loads to memory location 0100 the
contents of disk 2 (C), sector 0, one sector. This has to be the MBR.
What am I missing? The rest of this code just names the file to save
this data to and specifies how much data to save (0200 hex or 512 bytes).

Someone please respond and end my confusion.

Regards, hawk
 
I

I'm Dan

hawk said:
Thanks for your reply. Just a couple more questions. In your
description of the boot process, where you say, "When you install
win2K on a computer that already has Win9x... Win2K first saves a copy
of the old boot sector.. Is this "boot sector" the one in the active
partition or the boot device "boot sector" (MBR)? The implication is
active partition boot sector. If so that means that fixboot would be
the correct procedure.

But, in the past I had a system with Win98 and Linux in a dual boot
configuration. When I ditched Linux, I used fdisk /mbr to get rid of
Linux LILO and restore the standard MBR.

Second question, Doug Knox says that his procedure only works for a
system where WinXP is installed on "C" drive. I don't understand that
disclaimer. And the first steps in his procedure with the debug
routine copies the MBR of "C" drive to the file C:\BOOTSECT.DOS. To
me, the debug routine clearly reads the first sector of "C" drive.
This implies that the MBR is what is being changed, even though Doug
says to use fixboot.

So, I am still confused. Further comments much appreciated.

Hi, Hawk,

The boot sector in question is the partition boot record (PBR), not the
master boot sector (MBR).

You're right the first time -- the debug routine is saving the PBR from
"drive C:", not the MBR. See
http://www.geocities.com/thestarman3/asm/debug/debug.htm#L for clarification
of the debug command. Symantically, there is no such thing as 'the MBR of
"C" drive'. The MBR is not associated with any logical volume, so what you
mean is the PBR of "C" drive.

What Doug's trick does is install 98 on a partition other than logical
volume "C" (because XP is already there). But a byproduct of the 98 install
is that it automatically overwrites the XP PBR on drive C: with a 98 PBR, so
Doug uses debug to capture that 98 PBR, then restores the XP PBR (the
fixboot step).

You may find my webpage at www.goodells.net/multiboot helpful. In
particular, see the sections on the boot process and multibooting
principles. FTR, bear in mind that Doug's technique is an amended version
of the Microsoft method of multibooting, while the linux example you
mentioned above concerns the third-party method of multibooting.
 
H

hawk

OK, things are getting more clear. Just a quick note before I
investigate the links you mentioned. The debug command, "L 100 2 0 1",
reads the first sector of "C" drive. (0=A, 1=B, 2=C, 3=D) first sector
is 0 - zero and the 1 - one, means read one sector. I thought the very
first sector on a drive was the MBR. But are you saying that any
reference to "C" (or any partition letter) sectors really refers to
the sectors within that partition? If so, all of this now makes sense.

Regards, hawk
 
I

I'm Dan

hawk said:
OK, things are getting more clear. Just a quick note before I
investigate the links you mentioned. The debug command,
"L 100 2 0 1", reads the first sector of "C" drive. (0=A, 1=B,
2=C, 3=D) first sector is 0 - zero and the 1 - one, means
read one sector. I thought the very first sector on a drive
was the MBR. But are you saying that any reference to "C"
(or any partition letter) sectors really refers to the sectors
within that partition? If so, all of this now makes sense.

It sounds like you're getting mixed up with the definition of "drive". For
example, "Seagate drive" and "drive C" are two different meanings of
"drive" - the first is physical, the second is logical. Also, note there is
no such thing as "C" except in the context of whatever OS is actively
booted. When the computer is turned off, there is no "C". And one OS's "C"
may be another OS's "D" or whatever. It is the OS that assigns drive
letters when it boots, and those letters have meaning only within that OS.

It's less ambiguous to refer to them as hard disks and logical volumes. The
debug "L" command reads logical volumes. The first sector of logical volume
"C" is the boot sector of that partition. The first sector of the hard disk
is the MBR.
 
P

Patti MacLeod

The very first 512 bytes on a hard drive contains the MBR.......this is
located prior to C, D or any other logical drives. The debug command reads
the first sector of "C" drive, not the first sector of the hard drive.

It is my understanding that when the Linux Loader (LILO) is written, and one
opts to write it to the MBR (as you can have LILO written to the MBR or to
the boot sector of the partition on which Linux will be installed), the
loader overwrites the first 4xx (I know it overwrites an amount in the four
hundred range, I just don't know exactly the amount) bytes of the
"DOS-style" (for lack of better terminology) MBR with its own code. Thus
everything but the partition table and signature bytes is overwritten by
LILO. That was why you had to restore the DOS-style MBR, by running fdisk
/mbr, when you ditched Linux. The DOS-style MBR doesn't know if there is
WIN9x or WINNT-style boot code written in any of the boot sectors of any of
the partitions.....it examines the partition table to find an active,
bootable partition, loads that partition's boot sector into memory, verifies
the signature bytes at the end of that partition, then passes control over
to the boot sector of that partition.

When you formatted and reinstalled 98, it overwrote, without saving it
anywhere, the NT-style boot code required to boot into XP. This is because
WIN9x doesn't understand dual boot. XP, however, does understand dual boot,
and that is why, when it is being installed in a dual-boot situation, it
saves the WIN9x-style boot code as bootsect.dos before it overwrites the
boot sector with its own code. I believe the same thing would happen with
the NT-style boot code if you simply used the fixboot command from Recovery
Console, without first saving the WIN9x-style code to bootsect.dos The
NT-style boot code would overwrite the 9x-style code without saving it
first, rendering XP bootable but not 98.

Another, allbeit far more lengthy, method of repairing your dual boot setup
would be to perform a repair (in place upgrade) install of XP, as described
here:
http://michaelstevenstech.com/XPrepairinstall.htm
The drawback of the above method would be that you would have to reinstall
all updates and service packs that you had previously installed. All other
application data plus user settings would be saved.

I don't know if I've helped to clear up the confusion or make things worse.
I hope the former.



Regards,
 
H

hawk

Many thanks Dan and Patti! Everything now makes sense. And I completed
Doug's fixboot procedure and everything is back to normal. I didn't
need to use the debug stuff because I had followed a MS procedure for
making a WinXP "boot" floppy before I formatted "C". So, I had the
four files for the root of "C", boot.ini, bootsect.dos, ntldr and
ntdetect.com. Booting with my WinXP CD and following Doug's procedure
went without a problem.

Regards, hawk
 
P

Patti MacLeod

You're very welcome, hawk! I'm glad that everything makes sense now, as yes,
it can be very confusing to understand the diference between boot sector and
MBR when the two terms are used interchangeably (much like the confusion
people have when they see the terms "bootdisk" and "startup disk" used
interchangeably).


Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top