A hard disk drive keeps programs and files with the power off, and costs little per gigabyte. Bits are
stored as magnetized regions on spinning platters. The price is speed: a read from main memory takes
about 100 ns, a read from a hard drive about 10 ms. Almost all of that time is spent moving parts. This
page shows where it goes.
RPM
What you are looking at
A hard drive with its lid off. Three platters sit on one spindle, and a motor spins them all together.
Each surface is coated with magnetic material and has its own read/write head. The heads hang from an
arm comb on a pivot, so they all move together. A voice coil on the tail of the comb swings it in and out.
The top platter shows its layout. The rings are tracks, 8 here, track 0 outermost. Each track is
cut into 16 sectors. A sector is the smallest thing the drive reads or writes, 512 bytes here, 4096
on most drives made since 2011. Sector 0 starts at the dark mark on the edge. The same track on every
surface is a cylinder: all of it can be read without moving the arm.
Click a sector and the drive reads it. The motion is slowed down 180 times. The arm moves with a simple
rule: 1 ms plus 2 ms per track crossed.
Capacity
capacity = surfaces × tracks per surface × sectors per track × bytes per sector
Example. This drive has 3 platters, so 6 surfaces, each with 8 tracks of 16 sectors of
512 bytes. Capacity = 6 × 8 × 16 × 512 = 393,216 bytes, which is 384 KiB. A real drive has hundreds of
thousands of tracks per surface, which is why it holds terabytes.
Access time
Every read pays three delays in order:
access time = seek time + rotational latency + transfer time
Seek time is the time to move the head to the right track. The arm has to speed up, slow down and
settle over a track a few dozen nanometres wide, so even a short move takes about a millisecond. A desktop
drive's average seek is 8 to 10 ms. If the head is already over the track, the seek is 0.
Rotational latency is the wait for the sector to come round under the head. At best it is arriving
now, at worst it has just gone past. On average the drive waits half a turn:
one revolution = 60 / RPM secondsaverage rotational latency = ½ × 60 / RPM seconds
5400 RPM: 11.11 ms a turn, 5.56 ms average wait.
7200 RPM: 8.33 ms a turn, 4.17 ms average wait.
15,000 RPM: 4.00 ms a turn, 2.00 ms average wait.
This is why fast server drives spin at 15,000 RPM. Try the three speeds under the figure.
Transfer time is the time for the sector itself to pass under the head. A track of n
sectors passes one sector in 1/n of a turn:
transfer time for one sector = (60 / RPM) / sectors per track
Here that is 8.33 / 16 = 0.52 ms. A real track holds over a thousand sectors, so one passes in under
0.01 ms. Next to the seek and the wait, the transfer is tiny.
A worked example
Example. A 7200 RPM drive has an average seek of 9 ms and 1000 sectors per track. How
long is an average random read?
Seek: 9 ms.
Rotation: half of 8.33 ms = 4.17 ms.
Transfer: 8.33 / 1000 = 0.008 ms.
Access time: 9 + 4.17 + 0.008 ≈ 13.18 ms.
Seek and rotation are more than 99.9% of the time. The drive spends almost all of it waiting for parts
to move.
Sequential and random access
The seek and the wait are paid once. If the next sector wanted is the next one on the same track, the
head is already in place and the sector arrives right away. Press 4 sectors in a row: the first
read pays a seek and a wait, the next three only 0.52 ms each.
Example. With the drive above, read 1000 sectors that fill one track, then 1000 sectors
scattered at random.
One full track: 9 + 4.17 + 8.33 (one whole turn) ≈ 21.5 ms.
1000 random sectors: 1000 × 13.18 ms ≈ 13.2 s.
The same data takes about 600 times longer when it is scattered.
So file systems keep the blocks of a file next to each other, operating systems read ahead in large
chunks, and drives reorder waiting requests so the arm sweeps across the platter instead of jumping back
and forth.
Real drives
Zoned recording. Outer tracks are longer, so real drives put more sectors on them. Here every track has 16.
Block addresses. The operating system asks for block k, and the drive's controller maps it to a surface, track and sector. Consecutive blocks are placed so they can be read in a row.
A cache. The controller keeps recently read sectors in RAM and reads the rest of a track ahead of time.
Solid state drives. An SSD has no moving parts, so no seek and no wait: a random read takes about 0.1 ms. Hard drives remain where cost per terabyte matters more than speed.
Check your understanding
A laptop drive spins at 5400 RPM. What is its average rotational latency? Check with the 5400 button.
The head is over track 1 and the next request is for track 6. With the figure's rule, how long is the seek?
The drive in the figure is changed to 4096 byte sectors. What is its capacity now?
A 15,000 RPM drive has an average seek of 4 ms and 500 sectors per track. Find the average time to read one random sector.
Press Random read ten times and note the rotation each time. Why is it never more than 8.33 ms at 7200 RPM?
Why can the head reach every track even though the arm only swings around a pivot?
Summary
Takeaways
Each surface is divided into tracks, each track into sectors. The same track on every surface is a cylinder.
Capacity = surfaces × tracks × sectors per track × bytes per sector.
Access time = seek time + rotational latency + transfer time.
Average rotational latency is half a turn: 4.17 ms at 7200 RPM.
Seek and rotation dominate. Reading in a row is hundreds of times faster than reading scattered.