Master Boot Record

G

Guest

A few questions about the Master Boot Record (MBR)

(1) Is sector One (MBR) considered to be located in unallocated space
immediately before the first partition of the hard drive ???

(2) Using partion Magic, I notice that my first partition starts at sector
63 - what else is included on these 62 some odd sectors in front of the first
partition and is this space also considered unallocated space

(3) How can you obtain any info about the MBR (read it, view it, write it,
save it, copy it, etc) I am particularly interested in knowing how you can
copy or save the MBR and also how you can restore the MBR for cloning or
restoration purposes. Does Windows have any utilities for this?? Can anyone
recommend any other third party programs/utilities??

(4) Is the so called boot program in the MBR a standard type of program or
is it a specific program that is unique to your operating system??

(5) If you take a hard drive fully erased (the whole drive written to zero's
and you
partition the drive with partition magic (DOS version) before you do
anything else - is a fully functional MBR created at that point or is an MBR
only created when an operating system is installed??

(6) Although I have read several articles on MBR, some really good
references on this topic would be greatly appreciated!!!

Thank you for your time
 
D

David Candy

You'll need Dos to do this. To repair one in XP type FixMBR in Help.
Warning - Read This - Warning
If you don't know why you'd want to restore or backup a boot sector then don't do it. If you get it wrong you may render all your drives on this disk unusable.

This is used by people who have multiple operating systems or wierd requirements. It's not useful for 99.9999% of computers.

To repair a boot sector use Scandisk, Sys command, or FDisk /mbr. If your partition table (part of the boot record) gets scrambled only scandisk might help. Don't run Sys or FDisk /mbr with a damaged partition table.

Backing up is safe enough (as long as you follow the instructions exactly, then check each line before pressing enter), but restoring is dangerous.

If you are thinking of doing this because you think it's an extra safety step then it's not needed as Fat32 drives back up their own boot sectors.

And again, you may notice the lack of warnings on this site compared to other similar sites, so this warning should be considered important rather than a general disclaimer.

Readme Next
The boot sector contains a computer program that loads Dos or Windows. It also contains the partition table.

Virus checking in the BIOS or by programs must be disabled to write to a boot sector. Windows also prevent programs writing to the boot sector.

To Create a Backup Boot Sector and Partition Table
To create a backup of your boot sector and partition table type the following lines at in MSDos mode. Bold text shows the prompt and should not be typed but is what you can expect to see. Text in italics also aren't typed but are instructions or explainations to you.

C:\WINDOWS>lock c:

WARNING: The LOCK command enables direct disk access by programs
that can CORRUPT file names and/or DESTROY disk data, resulting in the
loss of files on your disk.

Are you sure (Y/N)?Y

C:\WINDOWS>debug
-L 0100 3 0 1 The second parameter is the drive we're backing up, we're doing C here, 3=C 1=A 2=B 4=D ect
-rcx
CX 0000
:200 enter 200 (200 hex = 512 bytes the size of the boot sector, CX control how many bytes we'll write to file)
-n a:\bootsect.bak the name of the file to backup the boot sector to
-w write 200h or 512 bytes to a:\bootsect.bak
-q quit debug
C:\WINDOWS>unlock c:
To view your boot sector press D<enter> 4 times after the L 0100 3 0 1 line. All boot sectors end with 55 AA in hex.

To check that the file is probably OK make sure it's size is 512 bytes exactly, then view it in Edit with the following command line;

edit /78 /r a:\bootsect.bakthe last two characters should be U (55) followed by a right angle (AA) with the corner in the upper right.

To Restore a Backedup Boot Sector and Partition Table
To restore a backup of your boot sector and partition table type the following lines in MSDos mode. Bold text shows the prompt and should not be typed but is what you can expect to see. Text in italics also aren't typed but are instructions or explainations to you.

C:\WINDOWS>lock c:

WARNING: The LOCK command enables direct disk access by programs
that can CORRUPT file names and/or DESTROY disk data, resulting in the
loss of files on your disk.

Are you sure (Y/N)?Y

C:\WINDOWS>debug
-n a:\bootsect.bak the name of the file that contains backedup the boot sector
-L load the file specified by n
-rcx
CX 0200 check that it says 0200, if not quit (press enter, the Q, then enter) - something is wrong with the file or it wasn't loaded (200 hex = 512 bytes the size of the boot sector, CX contains how many bytes we read from the file)
:press enter this leaves CX unchanged
-W 0100 3 0 1 The second parameter is the drive we're restoring to, we're doing C here, 3=C 1=A 2=B 4=D ect
-q quit debug
C:\WINDOWS>unlock c:
To view your boot sector before writing it press D<enter> 4 times after the L line. All boot sectors end with 55 AA in hex.
 
R

Rick \Nutcase\ Rogers

Hi Howard,
(1) Is sector One (MBR) considered to be located in unallocated space
immediately before the first partition of the hard drive ???

Can be in unallocated space. The MBR typically houses a small program that
reads the partition table to determine which active partition should be
accessed for booting (the partion will contain the boot sector that loads
the OS itself).
(2) Using partion Magic, I notice that my first partition starts at sector
63 - what else is included on these 62 some odd sectors in front of the
first
partition and is this space also considered unallocated space

NTFS partitions are aligned on the 4K boundries, as it likes to use 4K
clusters, so there is typically some wasted space.
(3) How can you obtain any info about the MBR (read it, view it, write it,
save it, copy it, etc) I am particularly interested in knowing how you can
copy or save the MBR and also how you can restore the MBR for cloning or
restoration purposes. Does Windows have any utilities for this?? Can
anyone
recommend any other third party programs/utilities??

Partinfo, a freeware utility here:
http://www.terabyteunlimited.com/utilities.html
(4) Is the so called boot program in the MBR a standard type of program or
is it a specific program that is unique to your operating system??

It's supposed to be a standard code, but can be affected by drive overlays,
viruses, and boot manager programs.
http://cquirke.mvps.org/multboot.htm
(5) If you take a hard drive fully erased (the whole drive written to
zero's
and you
partition the drive with partition magic (DOS version) before you do
anything else - is a fully functional MBR created at that point or is an
MBR
only created when an operating system is installed??

If you create a partition table, then there must be an MBR to read it.
(6) Although I have read several articles on MBR, some really good
references on this topic would be greatly appreciated!!!

google it, there are volumes of information about this topic.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Associate Expert - WindowsXP Expert Zone

Windows help - www.rickrogers.org
 
L

Lil' Dave

The master boot record (MBR) is located in sector zero.

In a nutshell, the MBR points the PC at the active partition boot location.
It also lets the PC know the locaition and size parameters of the
partitions, excluding dos logical drives within an extended partition. An
MBR is typically created at the time of partitioning for obvious reasons.
With strictly MS tools, this is done with fdisk. There's no reason to know
more specific information about this unless writing virus code, attempting
restoration of lost partition information, or writing a boot manager
program. If you're just nosy/curious, google is your friend.
 
G

Guest

Hi David
You'll need Dos to do this. To repair one in XP type FixMBR in Help.

Is the DOS program relating to the commands which you mentioned in your
response found in windows or is this some third party DOS program??

What "Help" source are you referring to: Start menu/Help and Support ???
Warning - Read This - Warning
If you don't know why you'd want to restore or backup a boot sector then don't do it. If you get it wrong you may render all your drives on this disk unusable.

This is used by people who have multiple operating systems or wierd requirements. It's not useful for 99.9999% of computers.

To repair a boot sector use Scandisk, Sys command, or FDisk /mbr. If your partition table (part of the boot record) gets scrambled only scandisk might help. Don't run Sys or FDisk /mbr with a damaged partition table.

Backing up is safe enough (as long as you follow the instructions exactly, then check each line before pressing enter), but restoring is dangerous.

If you are thinking of doing this because you think it's an extra safety step then it's not needed as Fat32 drives back up their own boot sectors.

And again, you may notice the lack of warnings on this site compared to other similar sites, so this warning should be considered important rather than a general disclaimer.

What Site are you talking about ???
Readme Next
The boot sector contains a computer program that loads Dos or Windows. It also contains the partition table.

Virus checking in the BIOS or by programs must be disabled to write to a boot sector. Windows also prevent programs writing to the boot sector.

To Create a Backup Boot Sector and Partition Table
To create a backup of your boot sector and partition table type the following lines at in MSDos mode. Bold text shows the prompt and should not be typed but is what you can expect to see. Text in italics also aren't typed but are instructions or explainations to you.

Are you talking about using Windows Command Prompt as a means to type in
these DOS commands. I don't think so - I tried several of these commands -
couldn't get anything to come up !!
 
G

Guest

Hi Rick

Tried to get partinfw.exe to work from terabyteunlimited.com

Downloaded the compressed folder from said website to Windows Desktop
Unzipped the compressed folder to Windows Desktop
Clicked on the partinfw.exe icon (Windows XP version)
Open File - Security Warning window pops up
Clicked on Run
A data screen (white lettering/black background) flashes for about a
millisecond - doesn't stay up - so can't view anything

What do you have to do to get this program to work

____________________________________________________________________
 
R

Rick \Nutcase\ Rogers

Hi,

You have to tell it where to create the file, easiest done from a command
prompt open to the folder that contains the file:

partinfw > C:\partinfo.txt

will create the file on the root of C:\.

--
Best of Luck,

Rick Rogers, aka "Nutcase" - Microsoft MVP

Associate Expert - WindowsXP Expert Zone

Windows help - www.rickrogers.org
 
D

David Candy

In windows it is Dos 5 debug. But you have to find a Dos floppy and versions are unlikely to match. Just get a Win ME Emergency Boot Floppy and copy debug from Win ME onto it (or ditto 98).
 

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