Disk Structure
Tracks and Sectors
Read aloud is unavailable in this browser.
Organizing Data on Spinning Disks
A hard disk platter is a smooth, featureless circle of magnetic material. There are no visible divisions, no physical markers—just an unbroken expanse of magnetic coating spinning at thousands of revolutions per minute. Yet somehow, the operating system can address billions of individual storage locations with perfect precision.
The answer lies in tracks and sectors—the fundamental logical divisions that partition a continuous magnetic surface into discrete, addressable units. This organizational scheme transforms an undifferentiated magnetic surface into a structured storage medium capable of locating any piece of data within milliseconds.
This page provides an exhaustive examination of how tracks and sectors work, from the physics of magnetic encoding to the evolution of sector formats, to the sophisticated encoding schemes that maximize storage efficiency.
By the end of this page, you will understand: how tracks partition a platter surface into concentric rings; how sectors subdivide tracks into discrete data units; the anatomy of a physical sector including headers, data areas, and ECC; zone bit recording and variable sectors-per-track; and the transition from 512-byte to 4K advanced format sectors.
Understanding Tracks
A track is a single concentric ring of data on a platter surface. When the read/write head is positioned at a fixed radial distance from the spindle and the platter completes one full rotation, the head traces (or reads) exactly one track.
1.1 Track Geometry
Physical Characteristics:
- Shape: Perfect concentric circles centered on the spindle axis
- Width: The radial extent occupied by the track; typically 50-100 nanometers for modern high-density drives
- Pitch: The center-to-center distance between adjacent tracks; slightly larger than track width to prevent cross-talk
- Count: A modern HDD may have 200,000-500,000+ tracks per surface
Track Numbering:
Tracks are numbered starting from the outer edge of the platter (track 0) toward the inner edge (highest track number). This convention arose because:
- Outer tracks have greater linear velocity and can store more data
- Critical boot information should be on faster, outer tracks
- Early drives had longer seek times to inner tracks
1.2 Track Density Evolution
Track density—measured in Tracks Per Inch (TPI)—has increased dramatically over HDD history:
| Era | Approximate Year | Track Density (TPI) | Track Width |
|---|---|---|---|
| Early HDDs | 1956-1970 | ~100 TPI | ~250 μm |
| MFM Era | 1980-1990 | ~2,000 TPI | ~12 μm |
| MR Heads | 1995-2000 | ~25,000 TPI | ~1 μm |
| Perpendicular | 2007-2015 | ~200,000 TPI | ~125 nm |
| SMR/HAMR | 2015-present | ~500,000+ TPI | ~50 nm |
The Track Density Challenge:
Increasing track density requires:
- Narrower heads — Writer poles and reader sensors must shrink proportionally
- More precise positioning — The servo system must position the head within nanometers
- Better servo patterns — The embedded servo data that guides positioning must be finer
- Reduced cross-talk — Adjacent tracks must not interfere with each other
Between tracks, a small unwritten region called a guard band provides isolation. In conventional recording, guard bands separate tracks completely. In Shingled Magnetic Recording (SMR), tracks intentionally overlap, with each new track partially overwriting the previous one—requiring sequential writes within bands.
Sector Fundamentals
While tracks provide radial organization, sectors provide circumferential division. A sector is the smallest addressable unit of storage on a disk—the fundamental quantum of data that can be read from or written to the drive.
2.1 Sector Basics
Definition: A sector is an arc-shaped slice of a track containing:
- A header with identification and synchronization information
- A data area holding user bytes
- Error detection/correction codes
Historical Standard: The traditional sector size of 512 bytes was established by IBM in 1956 with the RAMAC and remained dominant for over 50 years.
2.2 Why Sector-Based Organization?
Dividing tracks into sectors solves fundamental problems:
| Problem | Sector-Based Solution |
|---|---|
| Variable track length | Outer tracks can have more sectors than inner tracks |
| Error isolation | An error in one sector doesn't corrupt the entire track |
| Update granularity | Updating data requires rewriting only affected sectors |
| Addressing | Each sector has a unique address (CHS or LBA) |
| Error correction | ECC can be applied per-sector, optimizing redundancy |
2.3 Sectors Per Track: The Geometry Problem
A key insight: different tracks have different circumferences. An outer track has a larger circumference than an inner track. This creates a fundamental choice:
Option A: Constant Angular Velocity (CAV)
- The platter spins at constant RPM
- All tracks have the same number of sectors (limited by shortest track capacity)
- Outer tracks are underutilized—wasting potential capacity
- Simpler to implement; dominated early drives
Option B: Zoned Bit Recording (ZBR)
- The platter still spins at constant RPM
- Tracks are grouped into zones; outer zones have more sectors per track
- Called Multiple Zone Recording (MZR) or Zone Bit Recording (ZBR)
- Maximizes capacity; used by all modern drives
ZBR zone example (typical 7200 RPM drive):
| Zone | Track Range | Sectors/Track | Relative Capacity |
|---|---|---|---|
| Zone 0 (Outer) | 0-15,000 | 800 | 100% |
| Zone 1 | 15,001-30,000 | 768 | 96% |
| Zone 2 | 30,001-45,000 | 736 | 92% |
| ... | ... | ... | ... |
| Zone N (Inner) | 185,001-200,000 | 400 | 50% |
This means outer tracks transfer data faster (more sectors pass under the head per rotation)—a critical performance characteristic.
Because outer zones are faster, strategic data placement matters. Operating systems should place frequently-accessed files (like OS system files) on outer tracks. This is why Windows defragmentation tools traditionally consolidated files at the "beginning" (outer edge) of the disk.
Anatomy of a Physical Sector
A physical sector is far more than just 512 or 4096 bytes of data. Each sector contains multiple fields that enable the drive to locate, synchronize, read, and verify the data. Understanding sector structure is essential for grasping drive efficiency and overhead.
3.1 Traditional 512-Byte Sector Structure
A typical sector in the legacy format includes approximately 570-600 bytes of physical space for 512 bytes of user data:
| Field | Typical Size | Purpose |
|---|---|---|
| Gap (Inter-Sector) | ~15-30 bytes | Provides tolerance for write splice; allows head to stabilize |
| Sync Pattern | ~12-14 bytes | Bit pattern (e.g., 4E 4E 00 00...) to synchronize clock recovery |
| Address Mark | 4-6 bytes | Unique pattern indicating start of sector ID field |
| Sector ID (Header) | 6-10 bytes | Track, head, sector number, and ID CRC |
| Gap | ~15-20 bytes | Separation between ID and data; time for processing |
| Data Sync | ~12 bytes | Synchronization pattern for data field |
| Data Address Mark | 4 bytes | Indicates start of data field |
| User Data | 512 bytes | The actual data being stored |
| ECC (Error Correction) | ~40-100 bytes | Reed-Solomon or LDPC error correction codes |
| Gap (Post-Data) | ~10-15 bytes | Tolerance for next sector |
Efficiency Calculation:
With ~580 bytes of physical space for 512 bytes of user data:
$$\text{Format Efficiency} = \frac{512}{580} \approx 88.3%$$
This overhead is significant—roughly 12% of disk capacity is consumed by formatting information.
3.2 Understanding Each Field
Gap Fields: Gaps are areas of unwritten (or specially-written) magnetic space that provide tolerance margins. When writing, the head must have time to stabilize at write current before data begins. After writing, there must be margin before the next fixed sector position.
Sync Pattern: The read channel operates at extremely high frequencies (billions of bit transitions per second). The sync pattern provides a known sequence that allows the Phase-Locked Loop (PLL) in the read channel to lock onto the exact bit timing.
Sector ID Field: Contains the address (track, head, sector) so the drive can verify it's reading the correct sector. Early drives read this ID field to confirm positioning; modern drives use embedded servo for positioning but retain ID fields for verification.
ECC Field: The Error Correction Code is the sector's defense against bit errors. Modern drives use sophisticated LDPC (Low-Density Parity-Check) codes capable of correcting dozens of bit errors per sector.
Not all sectors contain user data. Servo sectors are periodically embedded around each track, containing position information that the head uses for track-following. Servo data occupies 5-10% of disk capacity and is written at the factory—never modified during normal operation. The loss of servo data renders the drive unreadable.
Advanced Format: The 4K Sector Revolution
After 50 years of 512-byte sectors, the industry began transitioning to Advanced Format (AF) with 4096-byte (4K) sectors starting in 2009-2010. This transition addressed fundamental efficiency and error correction limitations.
4.1 Why 4K Sectors?
The Efficiency Problem:
As areal density increased, the per-byte overhead of 512-byte sectors became increasingly wasteful. Each sector needs fixed overhead (gaps, sync, ECC) regardless of size.
- •~88% format efficiency (12% overhead)
- •Limited ECC strength (~50 bytes)
- •8× more sector headers for same capacity
- •More sync patterns needed
- •Gap overhead multiplied 8×
- •~97% format efficiency (~3% overhead)
- •Stronger ECC (~100+ bytes per sector)
- •1/8th the number of sector headers
- •Fewer sync patterns needed
- •Gap overhead reduced 8×
Capacity Gain:
Switching from 512-byte to 4K sectors recovers approximately 7-11% of drive capacity that was previously consumed by formatting overhead.
4.2 4K Native vs. 512e (Emulation)
The transition to 4K introduced compatibility challenges, leading to two approaches:
4K Native (4Kn):
- Physical sector size: 4096 bytes
- Logical sector size: 4096 bytes
- OS and applications see 4096-byte sectors
- Best efficiency, but requires OS/application support
- Example drives: Many enterprise NVMe and SATA drives
512e (512-byte Emulation):
- Physical sector size: 4096 bytes
- Logical sector size: 512 bytes (emulated)
- OS sees traditional 512-byte sectors
- Drive firmware translates—slower for misaligned writes
- Legacy compatibility maintained
The Alignment Problem (512e):
When an OS writes 512 bytes to a 512e drive at an address not aligned to a 4K boundary, the drive must:
- Read the entire 4K physical sector
- Modify the 512-byte portion being written
- Write back the entire 4K sector
This Read-Modify-Write (RMW) penalty can reduce write performance by 50% or more.
| Property | 512n (Native) | 512e (Emulation) | 4Kn (Native 4K) |
|---|---|---|---|
| Physical Sector Size | 512 bytes | 4096 bytes | 4096 bytes |
| Logical Sector Size (to OS) | 512 bytes | 512 bytes | 4096 bytes |
| ECC Strength | Limited (~50 bytes) | Strong (~100+ bytes) | Strong (~100+ bytes) |
| Format Efficiency | ~88% | ~97% | ~97% |
| Alignment Penalty | None | Yes (misaligned writes) | None |
| Legacy Compatibility | Full | Full | Requires 4K support |
For 512e drives, partition alignment is crucial. Partitions should start at 4K boundaries (sector numbers divisible by 8). Modern partitioning tools (Windows 7+, Linux parted, etc.) automatically align to 1MB boundaries (2048 sectors), ensuring 4K alignment. Legacy tools may create misaligned partitions, causing severe performance degradation.
Sector Addressing Evolution
How does the operating system specify which sector it wants to read or write? The answer has evolved dramatically as drive capacities have grown.
5.1 CHS Addressing (Historical)
Cylinder-Head-Sector (CHS) addressing directly specified physical location:
- Cylinder (C): Which track (same track number across all surfaces)
- Head (H): Which surface (which platter side)
- Sector (S): Which sector within that track
Example: CHS (500, 3, 42) = Cylinder 500, Head 3, Sector 42
CHS Limitations:
| BIOS Interface | Max Cylinders | Max Heads | Max Sectors | Max Capacity |
|---|---|---|---|---|
| Original CHS | 1,024 | 16 | 63 | 504 MB |
| Extended CHS | 1,024 | 256 | 63 | 8.4 GB |
| BIOS Int 13h extensions | 65,536 | 256 | 63 | ~137 GB |
As drives exceeded these limits, CHS addressing became untenable.
5.2 LBA Addressing (Modern)
Logical Block Addressing (LBA) replaced CHS with a simple linear numbering scheme:
- Sectors numbered 0 to (Total Sectors - 1)
- No assumption about physical geometry
- Drive firmware translates LBA to actual physical location
LBA Calculation from CHS (theoretical):
$$\text{LBA} = (C \times H_{\text{per cylinder}} + H) \times S_{\text{per track}} + (S - 1)$$
But in practice, modern drives map LBAs to physical locations through internal zone mapping that accounts for ZBR, defect skipping, and other factors.
LBA Bit-Width Evolution:
| LBA Size | Max LBA Value | Max Capacity (512-byte sectors) | Adoption |
|---|---|---|---|
| 28-bit | 268,435,456 | 137 GB | ATA-1 through ATA-5 |
| 48-bit | 281,474,976,710,656 | 144 PB | ATA-6 (2003+) |
48-bit LBA is sufficient for any foreseeable HDD capacity.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
/* * LBA to CHS Conversion * * This conversion is mainly historical—modern systems use LBA exclusively. * Included here for understanding legacy systems and boot sectors. */ typedef struct { uint16_t cylinder; uint8_t head; uint8_t sector;} CHS_Address; typedef struct { uint16_t sectors_per_track; // Typically 63 for BIOS compatibility uint16_t heads_per_cylinder; // Number of surfaces uint32_t cylinders; // Number of tracks (per surface)} DiskGeometry; /* * Convert LBA to CHS * * Note: This assumes a constant geometry, which doesn't match * actual ZBR drives. Used only for BIOS/MBR compatibility. */CHS_Address lba_to_chs(uint64_t lba, const DiskGeometry* geom) { CHS_Address chs; // Sector numbers are 1-based in CHS chs.sector = (lba % geom->sectors_per_track) + 1; // Calculate head and cylinder from remaining uint64_t temp = lba / geom->sectors_per_track; chs.head = temp % geom->heads_per_cylinder; chs.cylinder = temp / geom->heads_per_cylinder; return chs;} /* * Convert CHS to LBA */uint64_t chs_to_lba(CHS_Address chs, const DiskGeometry* geom) { return ((uint64_t)chs.cylinder * geom->heads_per_cylinder + chs.head) * geom->sectors_per_track + (chs.sector - 1); // Sector is 1-based} /* * Example usage */void example() { DiskGeometry geom = { .sectors_per_track = 63, .heads_per_cylinder = 16, .cylinders = 10000 }; // LBA 1000 -> CHS CHS_Address chs = lba_to_chs(1000, &geom); // chs.cylinder = 0, chs.head = 15, chs.sector = 57 // CHS back to LBA uint64_t lba = chs_to_lba(chs, &geom); // lba = 1000 (verified)}Modern drives entirely abstract physical geometry. The drive reports LBA sector count to the OS, and internally handles all physical mapping. This enables drives to hide defects, optimize performance with zone recording, and evolve internal architecture without OS changes.
Inter-Sector Gaps and Servo Wedges
Between the sectors containing user data lie critical overhead regions that enable the drive to function. Understanding these gaps reveals why format conversions affect capacity.
6.1 Inter-Sector Gaps
Purpose of Gaps:
Gaps serve multiple functions:
-
Write Tolerance — When writing sector N ends and writing sector N+1 must begin, the write head needs time to stabilize. The gap provides this margin.
-
Read Pipeline — After reading data and ECC, the controller needs time to process before the next sector arrives. Gaps provide this buffer.
-
Timing Tolerance — Minor speed variations in platter rotation are absorbed by gaps.
-
Write Splice Allowance — When overwriting a sector, the written data must not extend into adjacent sectors. Gaps provide safety margin.
Gap Size Reduction:
Advances in head electronics have progressively reduced gap requirements:
| Era | Inter-Sector Gap | Contributing Factor |
|---|---|---|
| 1980s | ~100 bytes | Slow write current switching |
| 1990s | ~50 bytes | Faster write drivers |
| 2000s | ~30 bytes | Preamplifier improvements |
| 2010s+ | ~15-20 bytes | Integrated head electronics |
6.2 Servo Wedges
Beyond inter-sector gaps, every track contains servo wedges (also called servo sectors or servo bursts)—special non-user regions that provide positioning feedback.
Servo Wedge Contents:
| Field | Purpose |
|---|---|
| AGC (Automatic Gain Control) | Calibration pattern for read amplitude |
| Servo Sync Mark | Timing reference for servo field |
| Track ID (Gray Code) | Coarse track identification |
| Index Mark | Once-per-revolution reference |
| Position Error Signal (PES) | Fine position bursts for nanometer-precision tracking |
Servo Sector Frequency:
Modern drives have 200-400+ servo wedges per track, consuming 5-10% of each track's capacity. The servo feedback loop operates at 20-40 kHz, providing continuous track-following.
Why So Many Servo Wedges?
With tracks only ~50-100nm wide, even minor vibrations or thermal expansion would cause the head to drift off-track. Frequent servo samples enable the actuator to continuously correct position—a control system operating thousands of times per platter revolution.
Servo patterns are written during manufacturing using specialized servo track writers—large, precision instruments that write servo data to every surface with nanometer accuracy. This process takes 2-10 hours per drive. Once written, servo data is never modified—it's the immutable reference for all subsequent head positioning.
- •Servo Sectors: 5-10% of raw magnetic capacity
- •Sector Headers & ECC: 3-12% (depending on 4K vs 512-byte format)
- •Inter-Sector Gaps: 1-2% of formatted capacity
- •Defect Spare Area: 0.5-1% reserved for defect mapping
- •Total Overhead: 10-25% depending on format and drive design
Error Correction and Data Integrity
Every sector written to disk will eventually be corrupted to some degree. The magnetic domains degrade, cosmic rays flip bits, read noise obscures signals. The only defense is Error Correction Codes (ECC)—sophisticated mathematical systems that detect and correct errors before data reaches the OS.
7.1 Error Correction Fundamentals
Types of Errors:
- Random Bit Errors — Individual bits flipped by noise or degradation
- Burst Errors — Consecutive bits affected by media defects or head instability
- Hard Errors — Permanent defects in the magnetic media
ECC Capabilities:
Modern drives use combinations of codes:
| ECC Type | Strength | Usage |
|---|---|---|
| Reed-Solomon (RS) | Corrects t byte errors with 2t redundancy bytes | Legacy and header protection |
| LDPC (Low-Density Parity-Check) | Near Shannon-limit error correction | Primary data protection in modern drives |
| Iterative Soft Decoding | Extracts marginal data with probability weighting | Recovers degraded signals |
7.2 ECC in Practice
A modern HDD's ECC system operates in layers:
Layer 1: Inner ECC (per sector)
- Each sector has 50-100 bytes of ECC
- Can correct ~50+ bit errors per sector
- Operates automatically on every read
Layer 2: Outer ECC (across sectors)
- Additional redundancy across groups of sectors
- Catches errors that exceed inner ECC capacity
- Adds latency but improves reliability
Layer 3: Dynamic Read Verification
- If ECC corrects near-maximum errors, the sector is "marginal"
- Drive firmware may rewrite marginal sectors to fresh locations
- Called background surface scan or media scan
Layer 4: Sector Reallocation
- If errors exceed ECC capability, the sector is marked bad
- Data (if recoverable) is moved to a spare sector
- The defect map is updated; the OS never sees the bad sector
Bit Error Rate (BER) Specifications:
| Metric | Typical Specification |
|---|---|
| Raw BER (before ECC) | 10⁻² to 10⁻³ |
| Corrected BER (after ECC) | Better than 10⁻¹⁵ |
| Uncorrectable Error Rate | <10⁻¹⁶ for enterprise drives |
This means ECC transforms an unreliable medium (1 error per 100-1000 bits) into an effectively perfect storage system (less than 1 uncorrectable error per 10 quadrillion bits).
Despite impressive error rates, large-scale storage systems face real challenges. With a URE (Uncorrectable Read Error) rate of 10⁻¹⁵ and 100TB of storage, you statistically expect one URE per 100TB read. During RAID rebuild of a failed 18TB drive, reading companions may hit URE, causing data loss. This drives enterprise adoption of stronger ECC and RAID-6/erasure coding.
KEEP LEARNING
Keep learning for free.
Read the complete lesson, save your notes and pick up where you left off with a free account. No card needed.