How do heads find the data stored on a hard disk drive?

I heard that to read or write data on a hard disk drive, we need the cylinder id and the sector id. First move the hdd's r/w heads to the cylinder specified by the cylinder id, and then to the sector specified by the sector id. Is it correct?

Do we need the platter id, and which of the two surfaces of the platter? Or equivalently, the track id (since we have the cylinder id)?

Thanks.


Solution 1:

How do heads find the data stored on a hard disk drive?

By reading (and comparing) the address information of each sector as it rotates under the head.

The details (as performed by the disk controller):

  1. The disk controller positions the R/W head assembly from its current position to the requested cylinder.
    (The time to perform this operation is called the seek time.)

  2. The disk controller selects the requested read/write head.
    (The time to perform this operation is called the head settle & select time.)

  3. The disk controller waits for the requested sector to rotate into position.
    3a. As each sector is encountered (by an interrupt triggered by finding an Address Mark on the track), the Identification record of the sector is read.
    3b. If the ID record does not match the requested cylinder or head, then a seek or controller error occurred, and an error procedure needs to be performed.
    3c. If the ID record does not match the requested sector, then continue waiting for the next sector (i.e. repeat 3a).
    3d. Otherwise the requested sector has been found, since the ID record does match the requested cylinder, head and sector (or logical sector number or LBA).
    (The time to perform this operation is called the rotational latency.)

Note: If the Index mark is encountered twice (i.e. more than one full rotation), then the entire track has been scanned, and the requested sector has not been found. An error procedure needs to be performed.

I heard that to read or write data on a hard disk drive, we need the cylinder id and the sector id.

You omitted the (read/write) head number.

First move the hdd's r/w heads to the cylinder specified by the cylinder id, and then to the sector specified by the sector id. Is it correct?

Not quite. The first part is accurate, but not the latter.

Do we need the platter id, ...

Not really.

... and which of the two surfaces of the platter?

There's one read/write head per surface.
So specifying the head number selects a surface of a platter.

Or equivalently, the track id (since we have the cylinder id)?

At the disk controller level, a "track id" is typically not used. The cylinder number and head number are more useful.

Since the original IBM PC BIOS interfaced directly with the disk controller (based on a Western Digital chip), the BIOS had to use this cylinder, head, sector (aka CHS) addressing. But as the disk controller was relocated from the ISA bus to the drive enclosure (IDE style), the ATAPI command set made CHS addressing essentially obsolete in favor of logical sector addressing.

Also see When a disk read or disk write occurs where does the data go?