CSE Roadmap

Core tier · about 3 hours · 7 parts

Part 2 of 7 · 2 min read

Inside a hard disk

Think of a stack of record players that share one arm. Each record spins, the arm holds one needle per record, and all needles move together to the same ring. The analogy stops in one place: a needle reads a groove with a continuous signal, while a disk head reads and writes numbered blocks of fixed size.

In plain words: A hard disk stores data as magnetic patterns on flat round platters that spin at a fixed speed. A head floats just above each surface and reads or writes the patterns. The heads sit on one arm that moves in and out, so all heads are always over the same ring. To read a block, the arm must move to the right ring, and then the platter must turn until the block passes under the head.

A worked example. A made-up drive has 2 platters, so 4 surfaces. Each surface has 100,000 rings (called tracks). Each track holds 500 sectors of 512 bytes (made up to show the idea). One track then holds 500 × 512 = 256,000 bytes. One surface holds 100,000 × 256,000 = 25.6 GB. Four surfaces hold 102.4 GB.

The key lines. The OS does not see tracks, heads or surfaces. It sees one long list of numbered blocks, called logical block addresses (LBA). Block 0 is the first and the drive turns each number into a surface, a track and a sector inside its own controller.

Hard disk

A hard disk is a storage device that keeps data as magnetic patterns on one or more spinning platters. Heads on a common arm read and write the patterns, and the data is organised as tracks that are divided into sectors. The device presents its sectors to the OS as a numbered list of logical blocks.

Example: a 1 TB laptop disk spinning at 5,400 RPM, which the OS sees as roughly 1.95 billion blocks of 512 bytes.

Check yourself: 1. Why must all heads of one drive be over the same track number at the same moment? 2. In the worked example, how many sectors does the whole drive hold? 3. What does the OS see instead of tracks and surfaces?