Fox Y2K Logo
FAT System Guide
FOXy2K
Contents

Home

FAT System Guide

The DOS Zone

My Software

 

The MBR

Use this information only if you agree to the terms in my Disclaimer

    I said previously that the first sector on a disk is the boot sector, well that's not strictly true. It is for floppy disks but with a hard drive however it is not the case. On a hard disk drive the first sector is called the master boot record or MBR for short. Like the boot sector this is basically a program which gets run when your computer is booting but also holds important information which is used by other software.

As you are almost certainly aware a hard drive can have many partitions, to facilitate this the MBR holds something known as a partition table which holds information on up to 4 partitions. If you have more than 4 partitions (or quite often even more than one) than one of these partition blocks points at another sector which has the same data layout as the MBR, and so can hold information on 4 more partitions, this may point at another sector which defines more partitions and so on. These are known as extended partitions and although they have the same data layout as the MBR the partition table in these is often called an extended partition table.

MS-DOS (and many other operating systems) comes with a utility called fdisk which is used to set up partitions and extended partitions. There is, as far as I know, no agreed rules on how a partitioning utility should go about things. For instance although recent MS-DOS versions can support up to 4 primary partitions, the fdisk utility will only allow the creation of one plus an extended partition so presumably something can create them. In fact even with extended partitions it will only create one FAT partition per extended partition table it then creates another extended partition for any more FAT partitions required. Generally new partitions start on a cylinder boundary which means some sectors get wasted around partitions, some low level programs use these for their own purposes.

That's pretty much all for this section if you want more information you could try MS KB article 69912.
One thing which I wanted to mention is the "fdisk /mbr" command, many people have incorrect ideas about what this does, so in an attempt to clarify it here's what it does do. The MBR splits into two areas, the machine code which is used to load the boot sector from the active partition, and the partition table. When "fdisk /mbr" is run the machine code part is re-written and that is all, it won't recover any partitions or anything like that.

Go Back To Previous Section.Procede To Next Section.

 

Technical Information on the MBR.

You only need to know about this if you are using BIOS to read the sectors, if you are using DOS it reads the sectors relative to the partition.

You can use these links to quickly locate items that are of interest.

The MBR.
Format of partition information blocks.
Format of sector and track information.
ID numbers for FAT volumes.
Master Boot Record Layout.
Up to offset 1BEh the MBR consists purely of machine code and data (strings etc.). At offset 1BEh the first primary partition is defined, this takes 16 bytes, after which the second primary partition is defined, followed by the third and fourth, the data structures are the same.
Offset
Length
(in bytes)
Field
000h446Machine Code and Associated Data.
1BEh16Partition 1 Information.
1CEh16Partition 2 Information.
1DEh16Partition 3 Information.
1EEh16Partition 4 Information.
1FEh2Boot Signature AA55h.
Back to links

 

Format of partition information blocks.
Offset
Length
(in bytes)
Field
00h1Set to 80h if this partition is active.
01h1Partition's starting head.
02h2Partition's starting sector and track.
04h1Partition's ID number.
05h1Partition's ending head.
06h2Partition's ending sector and track.
08h4Starting LBA.
0Ch4Partition's length in sectors.
Back to links

 

Format of sector and track information.
Bits 15-6Bits 5-0
TrackSector
Back to links

 

ID numbers for FAT volumes.
Many of these partition types I have just included because they are listed, I don't have any experience with most of them , so be warned I don't know that all these partitions follow the same rules as stated before.
ID number.Indicates.
00hUnused.
01hDOS FAT12 (0-15MB)
04hDOS FAT16 (16-32MB)
05hDOS 3.3+ extended partition.
06hDOS 3.31+ FAT16 (32MB-2GB)
0BhWin95 OSR2+ FAT32 (512MB-2TB)
0ChWin95 OSR2+ FAT32 (512MB-2TB LBA).
0EhWin95+ FAT16 (32MB-2GB) (LBA)
0FhWin95+ extended partition (LBA)
14hOS/2 Boot Manager hidden sub-32MB FAT16 partition
16hOS/2 Boot Manager hidden over-32MB FAT16 partition
1BhHidden Windows95 FAT32 partition
1ChHidden Windows95 FAT32 partition (LBA)
1EhHidden LBA VFAT partition
C1hDR DOS 6.0 LOGIN.EXE-secured FAT12 partition
C4hDR DOS 6.0 LOGIN.EXE-secured FAT16 partition
CBhReserved for DR-DOS secured FAT32
CChReserved for DR-DOS secured FAT32 (LBA)
CEhReserved for DR-DOS secured FAT16 (LBA)
D0hMultiuser DOS secured FAT12
D1hOld Multiuser DOS secured FAT12
D4hOld Multiuser DOS secured FAT16 (partitions equal to or smaller than 32MB)
D5hOld Multiuser DOS secured extended partition
D6hOld Multiuser DOS secured FAT16 (partitions larger than 32MB)
E1hSpeedStor FAT12 extended partition
E4hSpeedStor FAT16 extended partition
Back to links

Go Back To Previous Section.Procede To Next Section.
Copyright © Jonathan Fox 2000-2002.