Sub topic 3
How a Magnetic Disk Is Organized
A magnetic disk, or hard disk drive (HDD), stores data by changing the magnetization of small regions on rotating platters. This chapter assumes you understand processes, system calls, kernel and user mode, binary units, interrupts, and simple arithmetic with averages and ratios.
Physical structure
A hard disk contains one or more circular platters mounted on a spindle. The spindle rotates the platters at a constant speed, such as 7,200 revolutions per minute. Each platter has two magnetic surfaces. A read/write head accesses each surface.
A surface is divided into concentric tracks. Each track is divided into sectors, which are fixed-size regions that store data. A common sector size is 512 bytes, although 4,096-byte sectors are also common.
A cylinder is the collection of tracks at the same radius across all platter surfaces. The heads move together, so selecting a cylinder changes the radial position of every head at once.
The disk controller translates operating-system requests, often expressed as logical block addresses, into physical locations. Logical block addressing hides most physical details from the operating system. The controller also handles error correction, bad-sector remapping, and the transfer of sectors to memory.
Tracks, sectors, and blocks
The operating system normally works with file-system blocks rather than individual physical sectors. A file-system block may contain several sectors. For example, with 512-byte sectors and 4-KiB blocks:
- 1 block = 4,096 bytes
- 1 block = 8 sectors
The disk may reserve some sectors for metadata, spare replacement sectors, and partition structures. Therefore, the advertised capacity is not exactly the same as the space available to files.
| Term | Meaning | Scheduling relevance |
|---|---|---|
| Sector | Small physical storage region | Basic transfer unit |
| Track | Circular path containing sectors | Requests on one track avoid head movement |
| Cylinder | Same-radius tracks on all surfaces | Requests in one cylinder need little seek |
| Platter | Rotating magnetic disk surface pair | Provides storage surfaces |
Why organization affects access time
To read a sector, the head may first move to the correct track. This movement is the seek. Afterward, the platter must rotate until the requested sector reaches the head. This delay is rotational latency. Finally, the data is transferred.
A simplified access-time model is:
Access time = seek time + rotational latency + transfer time
For a disk rotating at 7,200 RPM, one rotation takes:
60,000 / 7,200 = 8.33 milliseconds
If the requested sector arrives at a random point, the average rotational latency is half a rotation, or about 4.17 milliseconds. Disk scheduling mainly reduces seek time by ordering requests so that the head travels less distance.
Exercise
A disk has 512-byte sectors. How many sectors are needed for one 4-KiB file-system block, and what is the average rotational latency at 7,200 RPM?
Show answer
Eight sectors are needed because 4,096 / 512 = 8. One rotation takes 60,000 / 7,200 = 8.33 milliseconds, so average latency is about 4.17 milliseconds.