Jump to content

Cylinder-head-sector

From Alfawiki
Cylinder-head-sector (CHS)
Company typeConcept / Addressing scheme
IndustryComputer storage

Cylinder-head-sector (CHS) represents an early scheme for pinpointing physical data blocks on a hard disk drive through a three-dimensional coordinate approach: the vertical head, the horizontal cylinder, and the angular sector. The head designates a specific platter surface, while the cylinder corresponds to a vertical alignment of tracks centered around the spindle; together, these define a particular track. The sector identifies a data segment within that track, which is divided into uniform arcs.

This addressing method was essential in early drives that lacked integrated disk controllers; instead, generic controllers depended on the operating system possessing precise knowledge of the drive's geometry to access data accurately. Conventional limitations consisted of 512 bytes per sector × 63 sectors per track × 255 heads × 1024 cylinders, restricting total disk size to approximately 8032.5 MiB.

As disk geometries evolved and became more intricate with advances such as zone bit recording, CHS addressing proved increasingly inadequate. Starting in the late 1980s, drives incorporated built-in controllers that reported logical CHS parameters—often artificial geometries with exaggerated head counts—to maximize usable address space. These logical values frequently diverged from the actual physical layout.

By the mid-1990s, hard drive interfaces shifted from CHS to logical block addressing (LBA). Nonetheless, many master boot record (MBR) partitioning utilities continued to align partitions along cylinder boundaries well into the late 2000s. The early 2010s marked widespread adoption of GUID Partition Table (GPT) to overcome MBR size constraints; contemporary systems running UEFI firmware have completely abandoned CHS concepts.

Definitions

CHS addressing locates individual sectors—the smallest units of data storage on a disk—based on their position within a track, which is determined by the combination of head and cylinder numbers. Disk controllers frequently translate between logical and physical locations; for instance, zone bit recording allocates fewer sectors to shorter (inner) tracks, and physical disk layouts may deviate from strict cylindrical geometry.

Sectors

Historically, floppy disks employed sector sizes of 128, 256, 512, and 1024 bytes, with 512 bytes becoming the dominant standard during the 1980s. Currently, 512 bytes remains the prevalent physical sector size for hard drives, although some non-IBM compatible systems utilize 520-byte sectors. In 2005, certain Seagate models featured sectors sized at 1024 bytes. Since 2010, Advanced Format hard drives have adopted larger 4096-byte sectors (4Kn) but maintain compatibility by emulating 512-byte sectors (512e) during transition periods.

Magneto-optical drives typically use sector sizes of either 512 or 1024 bytes on 5.25-inch formats and either 512 or 2048 bytes on 3.5-inch formats.

Within CHS addressing, sector numbering begins at 1; there is no sector zero—this contrasts with logical addressing methods such as logical block addressing (LBA), which start counting from zero. The maximum number of sectors per track is defined by the disk’s low-level formatting; however, IBM-PC BIOS encodes sector numbers in six bits, capping tracks at a maximum of 63 sectors—a limitation still enforced in virtual CHS geometries.

Tracks

Tracks consist of narrow, concentric rings of sectors on a disk surface. Each track requires at least one read/write head for data access. Within disk geometry terminology, the terms track and cylinder are interconnected: for single- or double-sided floppy disks, the term track is typically used, whereas drives equipped with more than two heads refer to cylinders. A track designates a particular C/H (Cylinder/Head) pair containing SPT (Sectors Per Track) sectors, while a cylinder includes all sectors across heads at the same cylinder number, calculated as SPT×H.

Cylinders

In disk drive architecture, a cylinder represents a set of tracks aligned vertically across all platters sharing the same track number, serving as a fundamental unit in CHS addressing. The total number of cylinders corresponds to the count of tracks on a single platter surface. Cylinders group these tracks together irrespective of any defective sectors present. Additionally, some direct access storage devices employ cylinder addressing without tying it to physical geometry.

Heads

A head functions as the component that reads from and writes data onto the magnetic surface of disk platters. Generally, each platter contains two heads—one per side. In certain contexts, particularly with removable media such as floppy disks, the term side is used synonymously with head.

The IBM-PC BIOS implements CHS addressing supporting up to 256 heads (numbered 0–255). However, MS-DOS and PC DOS versions up to 7.10 encounter crashes when handling volumes with 256 heads, effectively restricting practical usage to 255 heads (0–254). This constraint influences maximum disk size calculations within legacy BIOS INT 13h routines and older operating systems:

(512 bytes per sector) × (63 sectors per track) × (255 heads) × (1024 cylinders) = 8032.5 MiB, which approximates an 8 GB ceiling rather than the theoretical 8064 MiB.

CHS addressing counts cylinders and tracks starting from zero; track 0 corresponds to the outermost track. BIOS supports up to 1024 cylinders (10 bits), 256 heads (8 bits), and 63 sectors per track (6 bits), totaling a 24-bit address space for INT 13h operations. These limitations cap disk size at approximately 8 GB when using 512-byte sectors.

The introduction of Extended CHS addressing in EIDE/ATA-2 expanded these limits to 28 bits: allocating 16 bits for cylinders (up to 65535), 4 bits for heads (up to 15), and 8 bits for sectors (ranging from 1 to 255). This enhancement increased the maximum addressable size to around 128 GB (~130560 MiB).

Early system BIOS limitations combined with ATA constraints restricted maximum volumes to roughly 504 MiB. To overcome these restrictions, BIOS translation methods such as ECHS and improved ECHS adjusted head and sector counts dynamically, enabling accessible disk sizes up to approximately 7.5 GB.

These historical constraints on addressing have shaped disk geometry conventions and influenced maximum drive capacities within PC-compatible hardware and software ecosystems.

Blocks and clusters

Within Unix environments, a block typically denotes a single sector or a group of sectors; for instance, the Linux fdisk tool (prior to version 2.25) represented partition sizes using blocks sized at 1024 bytes.

Clusters, on the other hand, serve as allocation units in file systems like FAT and NTFS, primarily structuring how files are stored. Clusters operate independently from physical or logical disk geometry, meaning they may span multiple sectors that lie across different tracks.

CHS to LBA Conversion

The 2002 release of the ATA-6 specification introduced optional 48-bit Logical Block Addressing (LBA) and marked the phase-out of CHS addressing, although ATA-5 CHS translation remained supported. ATA-5 required CHS compatibility for devices up to 16,514,064 sectors (approximately 8.4 GB), which corresponds to a CHS value of 16383 16 63, necessitating a 24-bit addressing scheme.

The conversion from CHS to LBA follows the formula:

<math display=block>A = (c \times N_\mathrm{heads} + h) \times N_\mathrm{sectors} + (s-1),</math>

where represents the LBA address, is the total number of heads, denotes sectors per track, and indicates the CHS coordinate set.

This equation complies with standards such as ECMA-107 and ISO/IEC 9293:1994 applicable to FAT file systems, where Logical Block Address and Logical Sector Number (LSN) are equivalent terms. The calculation depends on the number of heads and sectors per track but not directly on cylinders, since CHS tuples correspond to varying LBAs depending on the disk’s geometry.

Illustrations:

  • Given geometry 1020 16 63 (totaling 1,028,160 sectors), CHS 3 2 1 converts to LBA ;
  • For geometry 1008 4 255, CHS 3 2 1 converts to LBA ;
  • With geometry 64 255 63, CHS 3 2 1 converts to LBA ;
  • For geometry 2142 15 32, CHS 3 2 1 converts to LBA .

Important considerations regarding sector ordering in LBA:

  • The initial LBA sector is zero-based, while in CHS sector numbering begins at one.
  • Sectors within each head/track are sequentially counted before moving on.
  • All head/track combinations within a cylinder are enumerated prior to advancing cylinders.
  • The outer half of a disk corresponds to the first half in sequential LBA numbering.

Historical Background

The Cylinder Head Record format has been utilized by Count Key Data (CKD) hard drives on IBM mainframes since the 1960s. This format closely resembles the Cylinder Head Sector structure found in PCs, except that sector sizes varied by track to accommodate specific application requirements. Modern mainframe storage emulates disk geometry through firmware rather than reflecting actual physical layouts.

Early PC hard disks such as those using MFM and RLL encoding partitioned cylinders into uniform sectors, so CHS values directly represented physical drive characteristics. For instance, a CHS value of 500 4 32 signified 500 tracks per side, four heads (equivalent to two platters), and 32 sectors per track—yielding a total capacity of approximately 32,768,000 bytes (31.25 MiB).

With the advent of ATA/IDE drives, MFM and RLL were supplanted by more advanced zone bit recording (ZBR). This method varies the number of sectors per track according to their position on the platter; outer tracks contain more sectors due to increased circumference compared to inner tracks. As a result, CHS addressing no longer aligns precisely with physical disk geometry, often leaving residual sectors smaller than one cylinder at the drive’s end.

ATA/IDE drives allow BIOS configuration with arbitrary CHS values within capacity constraints because they internally translate CHS inputs into actual hardware addresses. However, this flexibility may lead to compatibility challenges.

Operating systems such as Microsoft DOS and earlier versions of Windows require that partitions begin and end on cylinder boundaries. Although some newer OS versions (including Windows XP) might disregard this guideline, doing so can introduce compatibility risks—particularly in dual boot environments. Starting with Windows Vista, Microsoft’s built-in disk partitioning utilities have ceased enforcing strict cylinder boundary alignment.

See also

Notes

1. This is relevant for formats where physical sectors commence at 1; nonetheless, certain floppy disk formats (such as the 640 KB BBC Master 512 running DOS Plus 2.1) initiate sector numbering from "0".
2. In DOS, head counting starts at 1 by incrementing the zero-based index without increasing the integer size, which results in an overflow from 255 (0xFF) back to 0 (0x00). Although this issue was resolved in DOS 8, the convention of avoiding head number 255 remained.