OS Notes
Physical disk structure — platters, tracks, sectors, cylinders, disk geometry, CHS and LBA addressing, disk formatting, and how the OS sees physical storage organization.
Introduction
To understand how operating systems manage storage, you must first understand the physical structure of storage devices. While SSDs are becoming dominant, magnetic hard disk drives (HDDs) remain important — they store the vast majority of the world's data due to their cost advantage for bulk storage. The physical characteristics of disks directly influence how file systems are designed, why disk scheduling algorithms exist, and why fragmentation matters.
Understanding disk geometry also helps you grasp why older systems had limitations (like the 2TB partition limit) and how modern addressing schemes removed those constraints.
Physical Components of a Hard Disk Drive
Platters
Circular aluminum or glass disks coated with a thin layer of magnetic material. Data is stored as magnetic orientation of tiny regions on the surface. Modern drives have 1-5 platters stacked vertically on a central spindle.
Platters spin at constant speed: 5400, 7200, 10000, or 15000 RPM.
Read/Write Heads
One head per platter surface, mounted on a shared actuator arm. All heads move together — you cannot position them independently. The head floats nanometers above the spinning platter on an air cushion.
Head crash: If the head contacts the platter surface (due to shock or manufacturing defect), it physically scratches the magnetic coating, destroying data permanently. This is why you should never move a running HDD.
Tracks and Cylinders
Track: One concentric circle on a single platter surface. A typical drive has thousands of tracks per surface.
Cylinder: The set of tracks at the same radial position across all platter surfaces. Cylinder 0 means track 0 on every surface.
Why cylinders matter: Reading from tracks in the same cylinder requires no head movement (seek time = 0). File systems try to allocate sequential data within the same cylinder for performance.
Sectors
Sector: The smallest addressable unit on a disk — a fixed-length arc of a track. Traditional sector size is 512 bytes; modern drives use 4096 bytes (Advanced Format).
Each sector contains:
- Preamble: Synchronization bytes and sector identification (track number, sector number)
- Data: 512 or 4096 bytes of user data
- ECC: Error Correction Code for detecting and fixing bit errors
Disk Capacity Calculation
Modern drives use Zone Bit Recording (ZBR): outer tracks have more sectors than inner tracks because they have larger circumference. This increases capacity and means the outer tracks have higher data transfer rates.
Disk Addressing
CHS (Cylinder-Head-Sector)
The original addressing scheme. Each sector identified by its physical location:
- Cylinder number (which track, 0-based)
- Head number (which platter surface)
- Sector number (which sector within track, traditionally 1-based)
Limitation: BIOS CHS addressing used 10 bits for cylinder (max 1024), 8 bits for head (max 256), 6 bits for sector (max 63). This created the 8.4 GB limit: 1024 × 256 × 63 × 512 = 8,455,716,864 bytes.
LBA (Logical Block Addressing)
Modern scheme that assigns a sequential number to each sector, starting from 0. The disk controller internally translates LBA to the physical CHS location.
| LBA 0 | First sector on disk |
| LBA 1 | Second sector |
| LBA N | Last sector |
| Total addressable sectors with 32-bit LBA | 2³² × 512 = 2 TB |
| Total with 48-bit LBA | 2⁴⁸ × 512 = 128 PB |
The OS works exclusively with LBA addresses. It says "give me block 1,543,902" and the disk firmware handles physical positioning.
GPT (GUID Partition Table) uses 64-bit LBA, supporting disks up to 9.4 ZB (zettabytes).
Disk Formatting
Low-Level Formatting (Physical)
Performed at the factory. Creates the sector structure on each track:
- Writes preamble, data area, and ECC for each sector
- Defines sector sizes and identifies bad sectors
- Modern drives: done once at manufacture, not user-accessible
Logical Formatting (File System Creation)
Creates the file system structures within a partition:
# Partition the disk
fdisk /dev/sdb # For MBR (< 2TB)
gdisk /dev/sdb # For GPT (> 2TB)
# Create file system
mkfs.ext4 /dev/sdb1 # Linux ext4
mkfs.xfs /dev/sdb1 # Linux XFS
mkfs.ntfs /dev/sdb1 # Windows NTFSThis process creates:
- Superblock (filesystem metadata)
- Inode table (file metadata storage)
- Data blocks (actual file storage)
- Free space bitmap
Partitioning Schemes
MBR (Master Boot Record)
| Partition table | 4 entries × 16 bytes = 64 bytes |
| Boot code | 446 bytes |
| Signature | 2 bytes (0x55AA) |
Limitations: Max 4 primary partitions, max 2TB disk size (32-bit LBA).
GPT (GUID Partition Table)
Advantages: 128 partitions standard, supports disks > 2TB, redundant headers (backup at end), CRC32 checksums for integrity.
Solid State Drive Structure
SSDs have no mechanical components. Their structure differs fundamentally:
| ├── Channel 0 | Die 0 → Plane 0 → Block 0 → Page 0-63 |
| │ | Block 1 → Page 0-63 |
| │ | ... |
| ├── Channel 1 | Die 1 → ... |
| ├── Channel 2 | Die 2 → ... |
| └── Channel 3 | Die 3 → ... |
- Page: Smallest read/write unit (4-16 KB)
- Block: Smallest erase unit (128-512 pages = 512KB-8MB)
- Write constraint: Can only write to empty pages. To modify data, must erase entire block first.
Key Takeaways
- HDD data is organized in platters → tracks → sectors (physical hierarchy)
- Cylinder = same track position across all platters (fastest access within cylinder)
- LBA replaced CHS addressing, removing the 8.4GB limit and hiding physical geometry
- Sector size is 512B (legacy) or 4KB (modern Advanced Format)
- GPT replaced MBR for disks > 2TB and removes the 4-partition limit
- SSD structure (pages, blocks, channels) requires completely different optimization strategies
- Understanding physical structure explains why sequential I/O is faster than random I/O on HDDs
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Disk Structure - Physical Organization.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Operating Systems topic.
Search Terms
operating-systems, operating systems, operating, systems, storage, management, disk, structure
Related Operating Systems Topics