Definitions

Cylinder-head-sector, also known as CHS, was an early method for giving addresses to each physical block of data on a hard disk drive. In the case of floppy drives, for which the same exact diskette medium can be truly low-level formatted to different capacities, this is still true.

Though CHS values no longer have a direct physical relationship to the data stored on disks, pseudo CHS values (which can be translated by disk electronics or software) are still being used by many utility programs.

## Definitions

Data is written to and read from the surface of a platter by a device called a head. Naturally, a platter has 2 sides and thus 2 surfaces on which data could be manipulated; usually there are 2 heads per platter--one on each side, but not always. (Sometimes the term side is substituted for head, since platters might be separated from their head assemblies; as is definitely the case with the removable media of a floppy drive.)

### Tracks

Are the thin concentric circular strips on a floppy medium or platter surface which actually contain the magnetic regions of data written to a disk drive.

### Cylinders

A cylinder comprises all the tracks (on every usable platter surface) that can be accessed by the read/write heads while the actuator assembly remains stationary.

### Sectors

Each usable side of a platter can also be thought of as a collection of slices called sectors. (See Blocks for an alternate definition of sector.)

### Blocks

The intersection of a track and a sector is called a block. Thus, blocks are delimitated by specifying a certain cylinder, head and sector. These blocks are the smallest geometrical breakdown of a disk, and represent the smallest amount of data which can be transferred to or from a disk (usually 512 bytes).

However, many PC engineers and technicians use the term sector (instead of block) as if it were also defined as the smallest geometrical breakdown of a disk. The UNIX/Linux communities, however, continue to employ the term block. For example, the Linux fdisk utility normally displays partition table information using 1024-byte blocks while also using sector to help describe a disk's size with its phrase, 63 sectors/track.

Note: The term block is also often used out of the context of physical disks. It is still, by convention, a multiple of 512 bytes.

Hence, each block of data can be addressed by specifying a cylinder, head, and sector. The following formulas detail the CHS geometry and addressing scheme.

The number of blocks on one side of a platter is:

`   blocksPerPlatterSide = (cylindersPerPlatter)*(sectorsPerPlatter)`

The number of blocks per platter is:

`   blocksPerPlatter = (blocksPerPlatterSide)*(sidesUsedPerPlatter)`

which is usually written in terms of the number of heads used:

`   blocksPerPlatter = (blocksPerPlatterSide)*(HeadsPerPlatter)`

This is usually expanded to:

`   blocksPerPlatter =`
`   (cylindersPerPlatter)*(sectorsPerPlatter)*(headsPerPlatter)`

and rearranged:

`   blocksPerPlatter =`
`   (cylindersPerPlatter)*(headsPerPlatter)*(sectorsPerPlatter)`

Since all the platters are the same size and hard drives usually have more than one platter, the total number of blocks on the drive can be written as:

`   totalBlocks =`
`   (cylinders)*(headsPerPlatter)*(sectors)*(numberOfPlatters)`

If the number of platters is combined with the number of heads per platter to form the single parameter Heads, the equation can be written in its final form as:

`   totalBlocks = (cylinders)*(heads)*(sectors)`

## Examples

A "1.44 MB floppy disk has 80 cylinders (numbered 0 to 79), 2 heads (numbered 0 to 1) and 18 sectors (numbered 1 to 18). Therefore, its capacity in blocks is computed as follows:

`   totalBlocks = (80)*(2)*(18) = 2880`

The 16-byte entries within an MBR or EBR Partition Table have CHS-tuples which are limited to only (1023,254,63) for a total of 1024 cylinders, 255 heads and 63 sectors (values for cylinders and heads start at zero, and sector values start at one). For computers whose BIOS code was also limited to using only these CHS values, what was the largest size hard disk on which every block could be accessed? Starting with the formula above, but also including the term, `512 bytes/block`, the hard disk could be no larger than:

`   (1024)*(255)*(63)*(512) = 8,422,686,720 bytes (about 8.4 GB)`

### LBA to CHS mapping

CHS-tuples can be mapped onto LBA addresses using the following formula:

`$A = \left(c_A cdot h_n + h_A \right) cdot s_n + s_A - 1$`

Where $A$ is the LBA address, $c_n$ is the number of cylinders on the disk, $h_n$ is the number of heads on the disk, $s_n$ is the number of sectors on the disk, and $\left(c_A, h_A, s_A\right)$ is the CHS address.

### Equivalent values for CHS and LBA

The following tables show the corresponding CHS-tuples for a select group of LBA values, and how one would sequentially count through a number of blocks which these values represent. The data listed in the first table's entries will only be valid for hard disks having 63 sectors per track and 255 heads per cylinder.

Identifying 512-byte Blocks using LBA and CHS
LBA Value CHS Tuple
0    0, 0, 1
1    0, 0, 2
2    0, 0, 3
62    0, 0, 63
63    0, 1, 1
64    0, 1, 2
65    0, 1, 3
125    0, 1, 63
126    0, 2, 1
127    0, 2, 2
188    0, 2, 63
189    0, 3, 1
190    0, 3, 2
16,063    0, 254, 62
16,064    0, 254, 63
16,065    1, 0, 1
16,066    1, 0, 2
16,127    1, 0, 63
16,128    1, 1, 1
16,450,497    1023, 254, 1
16,450,558    1023, 254, 62
16,450,559    1023, 254, 63

And as described in the previous section, this last LBA value of 16450559, being the 16,450,560th block on a drive, would indicate a capacity of: 16450560 blocks x 512 bytes/block = 8,422,686,720 bytes.

Hard disk manufacturers, however, have always used their own CHS scheme in which the number of heads never exceeds 16 (0-15), the number of sectors can be 255 (1-255; though 63 is often the largest used) and the number of cylinders can be as large as 65,536 (0-65535). Therefore the number of cylinders in this scheme must be much larger than 1024 in order to describe many of the LBA values in the table above. For an LBA of 16450559, an ATA drive may respond with the CHS tuple: (16319, 15, 63).

The following table shows some CHS-tuples for the ATA/IDE drive specifications using only 16 heads per cylinder.

LBA and CHS Equivalents for 16 Heads
LBA Value CHS Tuple
0    0, 0, 1
1    0, 0, 2
2    0, 0, 3
62    0, 0, 63
945    0, 15, 1
1007    0, 15, 63
1008    1, 0, 1
1070    1, 0, 63
1071    1, 1, 1
1133    1, 1, 63
1134    1, 2, 1
2015    1, 15, 63
2016    2, 0, 1
16,127    15, 15, 63
16,128    16, 0, 1
32,255    31, 15, 63
32,256    32, 0, 1
16,450,559    16319, 15, 63
16,514,063    16382, 15, 63

According to the ATA specifications, the last entry in the table above is the largest tuple you'll most likely ever see a drive respond with, since section 6.2.1 of the ATA/ATAPI-5 spec states in part: "If the content of words (61:60) is greater than or equal to 16,514,064 then the content of word 1 [the number of logical cylinders] shall be equal to 16,383.

## History

Older hard drives, such as MFM and RLL drives, divided each cylinder into an equal number of sectors and the CHS values matched the physical makeup of the drive. A drive with a CHS tuple of (500, 4, 32) would have 500 tracks per side on each platter, two platters (4 heads), and 32 sectors per cylinder, with a total of 32,768,000 bytes (about 32.8 MB, or 31.25 MiB).

For operating systems such as Microsoft DOS or Windows (before Vista), each partition must start and end at a cylinder boundary. Because of this, many drives still have a surplus of sectors (less than 1 cylinder in size) at the end of the drive, since the total number of sectors rarely, if ever, ends on a cylinder boundary. Only some of the most modern operating systems may disregard this rule, but doing so can still cause some compatibility issues, especially if the user wants to perform dual booting on the same drive.

ATA/IDE drives have replaced the now archaic MFM and RLL drives, since they're much more efficient at storing data. They use zone bit recording (ZBR), where the number of sectors dividing each track varies with the location of groups of tracks on the surface of the platter. Tracks nearer to the edge of the platter contain more blocks of data than tracks close to the spindle, because there is more physical space within a given track near the edge of the platter. Thus, the CHS addressing scheme cannot correspond directly with the physical geometry of such drives, due to the varying number of sectors per track for different regions on a platter.

An ATA/IDE drive can be set in the system BIOS with any configuration of cylinders, heads and sectors that do not exceed the capacity of the drive (or the BIOS), since the drive will convert any given CHS value into an actual address for its specific hardware configuration.