Hard Drive Partition Binary

How disk partitioning works at the binary level — MBR, GPT, and low-level addressing

The MBR: A 512-Byte Binary Structure

The Master Boot Record (MBR) is the oldest and most fundamental partition scheme in PC-compatible systems, and its structure is pure binary. Sitting in LBA 0 (the very first sector of the disk), the MBR is exactly 512 bytes long, structured as follows:

  • Bytes 0-445 (446 bytes): Boot code — executable machine code in binary
  • Bytes 446-509 (64 bytes): Partition table — four 16-byte entries
  • Bytes 510-511 (2 bytes): Boot signature — 0x55 0xAA (binary: 01010101 10101010)

In my forensic disk analysis work, I've read hundreds of MBR dumps in hex. The boot signature 55 AA at the end is the most recognizable binary pattern on any PC — it's what the BIOS checks to confirm the disk is bootable. The 512-byte size itself is significant: 512 = 2^9, which was the standard sector size for decades.

MBR Partition Table Entries: 16 Bytes Each

Each of the four MBR partition table entries is a compact 16-byte binary record. I've decoded these manually when recovering corrupted partition tables, and the structure is remarkably efficient:

  • Byte 0: Boot indicator (0x00 = not bootable, 0x80 = active/bootable)
  • Bytes 1-3: CHS start address (head, sector, cylinder in binary)
  • Byte 4: Partition type (0x07 = NTFS, 0x83 = Linux ext4, 0x0C = FAT32 with LBA)
  • Bytes 5-7: CHS end address
  • Bytes 8-11: LBA start sector (32-bit little-endian)
  • Bytes 12-15: Number of sectors in partition (32-bit little-endian)

The partition type byte alone tells you everything. I've memorized the common ones from years of system administration: 07 is NTFS, 83 is Linux, 0C is FAT32 with LBA, and EE indicates a GPT protective MBR.

GPT: The Modern Binary Partition Scheme

GUID Partition Table (GPT) replaced MBR to overcome the 2 TB limit and 4-partition restriction. GPT uses LBA 0 for a protective MBR, then its own binary structures:

  • LBA 1: GPT Header — 92 bytes of metadata
  • LBA 2-33: Partition entries — 128 bytes each, up to 128 partitions
  • Last 33 LBAs: Backup GPT at the end of the disk

In my experience managing server partitions, GPT's redundancy is a lifesaver. If the primary GPT at the start of the disk gets corrupted, I can restore it from the backup copy at the end. Each partition entry contains a partition type GUID (16 bytes), unique partition GUID (16 bytes), starting LBA (8 bytes), ending LBA (8 bytes), attribute flags (8 bytes), and a partition name (72 bytes of UTF-16LE).

CHS vs LBA Addressing: A Binary Perspective

Two addressing schemes have been used for hard drives, and both are rooted in binary arithmetic. CHS (Cylinder-Head-Sector) was the original addressing method that used three binary numbers to locate any sector. The cylinder number specified which track (up to 1,024), the head number specified which recording surface (up to 255), and the sector number specified which sector on the track (up to 63).

LBA (Logical Block Addressing) replaced CHS with a single linear binary number. LBA 0 is the first sector, LBA 1 is the second, and so on up to 2^48 - 1 (48-bit LBA limit). The conversion is pure binary arithmetic: LBA = (C x HPC + H) x SPT + (S - 1), where HPC = heads per cylinder and SPT = sectors per track.

The 2 TB MBR Limit: A Binary Ceiling

The 2 TB MBR partition limit is a mathematical consequence of the binary fields. The "number of sectors" field is 32 bits, so the maximum addressable sectors is 2^32 = 4,294,967,296. With 512-byte sectors: 4,294,967,296 x 512 = 2,199,023,255,552 bytes = approximately 2 TiB.

I've encountered this limit in enterprise storage migrations. A 3 TB drive using MBR can only use 2 TB of its space unless you switch to GPT. The math is pure binary: 32 address bits leads to 2^32 sectors. GPT removes this limit by using 64-bit LBAs, supporting up to 2^64 sectors = 9.4 zettabytes.

Partition Alignment in Binary

Modern operating systems align partitions to 1 MB boundaries for optimal performance on 4K-sector drives. In binary terms, partitions start at LBA 2048 (since 2048 x 512 bytes = 1,048,576 bytes = 1 MiB). That's 2^11 sectors from the start.

I've seen significant performance degradation from misaligned partitions on SSDs. An unaligned partition creates read-modify-write cycles: a single 4 KB write spans two physical NAND pages, forcing extra I/O. Modern partition tools automatically align to MiB boundaries. The rule is simple: partition_start_LBA must be a multiple of (MiB / sector_size).

MBR: 512B sector, 4 partitions max, 2 TB limit · GPT: 128 partitions, backup header, 64-bit LBAs · CHS: 3D historical addressing · LBA: modern linear addressing · Partition alignment: LBA 2048 = 1 MiB boundary

Try It Yourself

Open the Binary Code Decoder in a new tab and enter some binary patterns to see the results instantly. All conversions happen in your browser — no data is sent to any server.