How Do Modern Hard Drive Store, Access Data? What is the inter- face? How is the data actually laid out and accessed?
Let’s start by understanding the interface to a modern disk drive. The basic interface for all modern drives is straightforward. The drive consists of a large number of sectors (512-byte blocks), each of which can be read or written. The sectors are numbered from 0 to n − 1 on a disk with n sectors. Thus, we can view the disk as an array of sectors; 0 to n − 1 is thus the address space of the drive.
Let’s start to understand some of the components of a modern disk. We start with a platter, a circular hard surface on which data is stored persistently by inducing magnetic changes to it. A disk may have one or more platters; each platter has 2 sides, each of which is called a surface. These platters are usually made of some hard material (such as aluminum), and then coated with a thin magnetic layer that enables the drive to persistently store bits even when the drive is powered off.
The platters are all bound together around the spindle, which is connected to a motor that spins the platters around and around (while the drive is powered on) at a constant fixed rate. The rate of rotation is often measured in rotations per minute (RPM), and typ- ical modern values are in the 7,200 RPM to 15,000 RPM range. Note that we will often be interested in the time of a single rotation, e.g., a drive that rotates at 10,000 RPM means that a single rotation takes 6 milliseconds (6 ms).
Data is encoded on each surface in concentric circles of sectors; we call one such concentric circle a track. A single surface contains many thousands and thousands of tracks, tightly packed together, with hundreds of tracks fitting into the width of a human hair.
To read and write from the surface, we need a mechanism that allows us to either sense (i.e., read) the magnetic patterns on the disk or to induce a change in (i.e., write) them. This process of reading and writing is accomplished by the disk head; there is one such head per surface of the drive. The disk head is attached to a single disk arm, which moves across the surface to position the head over the desired track.
Tracks and Seek Time
In the figure, the head is currently positioned over the innermost track (which contains sectors 24 through 35); the next track over con- tains the next set of sectors (12 through 23), and the outermost track contains the first sectors (0 through 11).
To understand how the drive might access a given sector, we now trace what would happen on a request to a distant sector, e.g., a read to sector 11. To accomplish this read, the drive has to first move the disk arm to the correct track (in this case, the outermost track), in a process known as a seek. Seeks, along with rotations, are one of the most costly disk operations.
The seek, it should be noted, has many phases: first an acceleration phase as the disk arm gets moving; then coasting as the arm is moving at full speed, then deceleration as the arm slows down; finally settling as the head is carefully positioned over the correct track. The settling time is often quite significant, e.g., 0.5 to 2 ms, as the drive must be certain to find the right track (imagine if it just got close instead!).
After the seek, the disk arm has positioned the head over the right track. Thus, the state of the disk might look like this (Figure 36.4).
As we can see in the diagram, during the seek, the arm has been moved to the desired track, and the platter of course has rotated, in this case about 3 sectors. Thus, sector 9 is just about to pass under the disk head, and we must only endure a short rotational delay to complete the transfer.
When sector 11 passes under the disk head, the final phase of I/O will take place, which is known as the transfer, where data is either read from or written to the surface. And thus, we have a complete picture of I/O time: first a seek, then waiting for the rotational delay, and finally the transfer.