MBR (Master Boot Record Partition Table)

The MBR partition table, introduced with IBM PC DOS 2.0 (1983), holds four primary entries (with extended and logical partitions) in sector 0 and is limited to 2 TiB with 512-byte sectors. It remains in use for BIOS booting, small and removable media and older disks, though GPT is the default for large disks.

Overview

The MBR occupies sector 0: 446 bytes of boot code, four 16-byte partition entries (status, CHS start, type, CHS end, LBA start, sector count) and the signature 55 AA. One primary entry may be an extended partition, which holds a linked chain of Extended Boot Records for logical partitions. LBA fields are 32-bit, so addressing is limited to 2 TiB with 512-byte sectors.

History

  • Introduced with IBM PC DOS 2.0 (1983).
  • Extended partitions arrived with DOS 3.30.

Structures

Offsets are in bytes from the start of the structure named in each heading. Field names are descriptive and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

Looks Like Volume Start

OffsetSizeTypeFieldNotes
0x204bytes–APFS
0x1FE1u8–boot sector: FAT, NTFS, exFAT, ReFS, BitLocker, HPFS
0x1FF1u8–boot sector: FAT, NTFS, exFAT, ReFS, BitLocker, HPFS
0x2008bytes–LVM2
0x4002bytes–HFS+ / HFSX / HFS
0x4381u8–ext2/3/4
0x4391u8–ext2/3/4

Read Facts

OffsetSizeTypeFieldNotes
at + 41u8Type
at + 84u32 LEStart
at + 124u32 LECount

Parse Entries

OffsetSizeTypeFieldNotes
e + 41u8–
e + 84u32 LE–
e + 124u32 LE–

Other fields read

Read inOffsetSizeTypeFieldNotes
Read Volumes0x1B84u32 LEDisk Id

Constants

Mbr Disk Carver

NameValueTypeNotes
EntriesOffset446int

Mbr Module

NameValueTypeNotes
EntriesOffset446int

Crc32

NameValueTypeNotes
TableBuildTable()uint[]

Implementation limits

ClassNameValueNotes
Mbr ModuleMaxLogicalPartitions256

Signatures and magic strings referenced

TextWhere checked
XFSBLooks Like Volume Start
LUKSLooks Like Volume Start
NXSBLooks Like Volume Start
LABELONELooks Like Volume Start
H+Looks Like Volume Start
HXLooks Like Volume Start
BDLooks Like Volume Start
Structures and constants were extracted from the implementation. Prose sections are a summary from public sources; verify details before relying on them.