Cylinder-head-sector
Encyclopedia
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
Disk formatting
Disk formatting is the process of preparing a hard disk drive or flexible disk medium for data storage. In some cases, the formatting operation may also create one or more new file systems...

to different capacities, this is still true.

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

Definitions

CHS
Cylinder-head-sector
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...

 addressing is the process of identifying individual sectors on a disk by their position in a track, where the track is determined by the head and cylinder numbers. The terms are explained bottom up, for disk addressing the sector is the smallest unit. Disk controllers can introduce address translations to map logical to physical positions, e.g., zone bit recording
Zone bit recording
Zone Bit Recording is used by disk drives to store more sectors per track on outer tracks than on inner tracks. It is also called Zone Constant Angular Velocity ....

 stores fewer sectors in shorter (inner) tracks, physical disk formats are not necessarily cylindrical, and sector numbers in a track can be skewed.

Sectors

A sector
Disk sector
In computer disk storage, a sector is a subdivision of a track on a magnetic disk or optical disc. Each sector stores a fixed amount of user data. Traditional formatting of these storage media provides space for 512 bytes or 2048 bytes of user-accessible data per sector...

 is the smallest storage unit that is addressable
Memory address
A digital computer's memory, more specifically main memory, consists of many memory locations, each having a memory address, a number, analogous to a street address, at which computer programs store and retrieve, machine code or data. Most application programs do not directly read and write to...

 by a hard drive, and all information stored by the hard drive is recorded in sectors. Common sector sizes are 512 bytes for hard disks and 2048 bytes for CDs and DVDs, but other sizes such as 128 and 1024 were also used. Vendors of hard drives and software developers have created Advanced Format
Advanced Format
Advanced Format is a generic term pertaining to any sector format used to store data on the magnetic disks in hard disk drives that exceeds 512 to 520 bytes per sector. Advanced Format is also considered a milestone technology in the history of hard-drive storage, where data has been processed in...

, a standard for data stored in physical sectors of 4096 bytes, while still permitting access on logical sectors of 512 bytes in a scheme known as 512e.

In CHS addressing the sector numbers always start at 1, there is no sector 0. For physical disk geometries the maximal sector number is determined by the low level format of the disk. However, for disk access with the BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

, the sector number was encoded in six bits, resulting in a maximal number of 63=64-1 sectors per track, where 64=2**6 corresponds to six bits. The maximum 63 is still in use for virtual CHS
Cylinder-head-sector
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...

 geometries.

Heads

A device called a head
Disk read-and-write head
Disk read/write heads are the small parts of a disk drive, that move above the disk platter and transform platter's magnetic field into electrical current or vice versa – transform electrical current into magnetic field...

 reads and writes data in hard drive by manipulating the magnetic medium that composes the surface of an associated disk platter. Naturally, a platter has 2 sides and thus 2 surfaces on which data can be manipulated; usually there are 2 heads per platter, one on each side. (Sometimes the term side is substituted for head, since platters might be separated from their head assemblies, as with the removable media of a floppy drive.)

The CHS addressing supported in old BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 code used eight bits for up to 256 heads counted as head 0 up to 255 (hex. FFh). However, some long-forgotten software supported only 255 heads, causing no problems for physical disks at this time with fewer heads. In essence erroneous 255 is still in use for virtual 255×63 geometries. This historical oddity can affect the maximum disk size in old BIOS INT 13h code as well as old PC DOS or similar operating systems:

(512 byte/sector)×255×63=8032.5 MB, but actually (512 byte/sector)×256×63=8064 MB yields what is known as 8 GB limit. In this context relevant definition of 8 GB = 8192 MB is another incorrect limit, because it would require CHS 1024×256×64 with 64 sectors per track.

Tracks

The track
Track (disk drive)
A disk drive track is a circular path on the surface of a disk or diskette on which information is magnetically recorded and from which recorded information is read....

s are the thin concentric
Concentric
Concentric objects share the same center, axis or origin with one inside the other. Circles, tubes, cylindrical shafts, disks, and spheres may be concentric to one another...

 circular strips of sectors. At least one head is required to read a single track. With respect to disk geometries the terms track and cylinder are closely related. For a single or double sided floppy disk
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

 track is the common term; and for more than two heads cylinder is the common term. Strictly speaking a track is a given CH combination consisting of
SPT sectors, while a cylinder consists of
SPT×H sectors.

Tracks and cylinders are counted from 0, i.e., track 0 is the first (outer-most) track on floppy
Floppy disk
A floppy disk is a disk storage medium composed of a disk of thin and flexible magnetic storage medium, sealed in a rectangular plastic carrier lined with fabric that removes dust particles...

 or other cylindrical disks. Old BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 code supported ten bits in CHS addressing with up to 1024 cylinders (1024=2**10). Adding six bits for sectors and eight bits for heads results in the 24 bits supported by BIOS interrupt 13h. Subtracting the disallowed sector number 0 in 1024×256 tracks corresponds to 128 MB for a sector size of 512 bytes (128 MB=1024×256×(512 byte/sector)); and 8192-128=8064 confirms the (roughly) 8 GB limit.

Cylinders

A cylinder
Cylinder (disk drive)
A disk drive cylinder is a division of data in a disk drive, as used in the CHS addressing mode of a Fixed Block Architecture disk or the cylinder–head–record addressing mode of a CKD disk. The concept is concentric, hollow, cylindrical slices through the physical disks , collecting the respective...

 comprises the same track number on each platter, spanning all such tracks across each platter surface that is able to store data (without regard to whether or not the track is "bad"). Thus, it is a three-dimensional structure. Any track comprising part of a specific cylinder can be written to and read from while the actuator assembly remains stationary, and one way in which hard drive manufacturers have increased drive access speed has been by increasing the number of platters which can be read at the same time.

CHS addressing starts at 0 0 1 with a maximal value 1023 255 63 for 24=10+8+6 bits, or 1023 254 63 for 24 bits limited to 255 heads. CHS values used to specify the geometry of a disk have to count cylinder 0 and head 0 resulting in
a maximum 1024 256 63 or 1024 255 63 for 24 bits with 256 or 255 heads. In CHS tuples specifying a geometry S actually means sectors per track, and where the (virtual) geometry still matches the capacity the disk contains C×H×S sectors. As larger hard disks have come into use, a cylinder has become also a logical disk structure, standardised at 16 065 sectors (16065=255×63).

CHS addressing with 28 bits (EIDE and ATA-2) permits eight bits for sectors still starting at 1, i.e., sectors 1…255, four bits for heads 0…15, and sixteen bits for cylinders 0…65535. This results in a roughly 128 GB limit; actually 65536×16×255=267386880 sectors corresponding to 130560 MB for a sector size of 512 bytes. The 28=16+4+8 bits in the ATA-2 specification are also covered by Ralf Brown's Interrupt List
Ralf Brown's Interrupt List
Ralf Brown's Interrupt List or RBIL is a comprehensive list of interrupts, calls, hooks, interfaces, data structures, memory and port addresses, and processor opcodes for x86 for machines from the very start of the PC era in 1981 up into the year 2000, most of it still applying to PCs today as well...

, and an old working draft of this now expired standard was published.

With an old BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 limit of 1024 cylinders and the ATA limit of 16 heads the combined effect was 1024×16×63=1032192 sectors, i.e., a 504 MB limit for sector size 512. BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 translation schemes known as ECHS and revised ECHS mitigated this limitation by using 128 or 240 instead of 16 heads, simultaneously reducing the numbers of cylinders and sectors to fit into 1024 128 63 (ECHS limit: 4032 MB) or 1024 240 63 (revised ECHS limit: 7560 MB) for the given total number of sectors on a disk.

Blocks and Clusters

The Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 communities employ the term block to refer to a sector or group of sectors. For example, the Linux fdisk
Fdisk
On personal computer operating systems, fdisk is a commonly used name for a command-line utility that provides disk partitioning functions...

 utility normally displays partition table information using 1024-byte blocks, but also uses the word sector to help describe a disk's size in the phrase, 63 sectors per track.

Clusters are allocation units for data on various file systems (FAT
File Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

, NTFS
NTFS
NTFS is the standard file system of Windows NT, including its later versions Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7....

, etc.), where data mainly consists of files. Clusters are not directly affected by the physical or virtual geometry of the disk, i.e., a cluster can begin at a sector near the end of a given CH track, and end in a sector on the physically or logically next CH track.

CHS to LBA mapping

CHS tuple
Tuple
In mathematics and computer science, a tuple is an ordered list of elements. In set theory, an n-tuple is a sequence of n elements, where n is a positive integer. There is also one 0-tuple, an empty sequence. An n-tuple is defined inductively using the construction of an ordered pair...

s can be mapped onto LBA
Logical block addressing
Logical block addressing is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disks....

 (Logical Block Addressing) addresses using the following formula:



Where is the LBA address, is the number of heads on the disk, is the number of sectors per track, and is the CHS address.

A Logical Sector Number  formula in the ECMA
Ecma International
Ecma International is an international, private non-profit standards organization for information and communication systems. It acquired its name in 1994, when the European Computer Manufacturers Association changed its name to reflect the organization's global reach and activities...

-107 standard for FAT
File Allocation Table
File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

 file systems matches exactly the LBA formula given above: Logical Block Address and Logical Sector Number (LSN) are synonyms. The formula does not use the number of cylinders, but requires the number of heads and the number of sectors per track in the disk geometry, because the same CHS tuple addresses different logical sector numbers depending on the geometry. Examples:
For geometry 1020 16 63 of a disk with 1028160 sectors CHS 3 2 1 is LBA  3150=(3* 16+2)* 63
For geometry 1008 4 255 of a disk with 1028160 sectors CHS 3 2 1 is LBA  3570=(3*  4+2)*255
For geometry  64 255 63 of a disk with 1028160 sectors CHS 3 2 1 is LBA 48321=(3*255+2)* 63
For geometry 2142 15 32 of a disk with 1028160 sectors CHS 3 2 1 is LBA  1504=(3* 15+2)* 32


In 2002 the ATA-6 specification introduced an optional 48 bits logical block addressing
Logical block addressing
Logical block addressing is a common scheme used for specifying the location of blocks of data stored on computer storage devices, generally secondary storage systems such as hard disks....

 and declared CHS addressing as obsolete, but still allowed to implement the ATA-5 translations. Unsurprisingly the CHS to LBA translation formula given above also matches the last ATA-5 CHS translation. In the ATA-5 specification CHS support was mandatory for up to 16 514 064 sectors and optional for larger disks. The ATA-5 limit corresponds to CHS 16383 16 63 or equivalent disk capacities (16514064=16383×16×63=1032×254×63), and requires 24=14+4+6 bits (16383+1=2**14).

History

Earlier hard drives used in the PC, such as MFM
Modified Frequency Modulation
Modified Frequency Modulation, commonly MFM, is a line coding scheme used to encode the actual data-bits on most floppy disk formats, hardware examples include Amiga, most CP/M machines as well as IBM PC compatibles. Early hard disk drives also used this coding.MFM is a modification to the original...

 and RLL
Run Length Limited
Run length limited or RLL coding is a line coding technique that is used to send arbitrary data over a communications channel with bandwidth limits. This is used in both telecommunication and storage systems which move a medium past a fixed head. Specifically, RLL bounds the length of stretches ...

 drives, divided each cylinder into an equal number of sectors, so the CHS values matched the physical properties 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 track, with a total of 32 768 000 bytes (31.25 MB).

ATA/IDE drives were much more efficient at storing data and have replaced the now archaic MFM and RLL drives. They use zone bit recording
Zone bit recording
Zone Bit Recording is used by disk drives to store more sectors per track on outer tracks than on inner tracks. It is also called Zone Constant Angular Velocity ....

 (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. 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.

An ATA/IDE drive can be set in the system BIOS
BIOS
In IBM PC compatible computers, the basic input/output system , also known as the System BIOS or ROM BIOS , is a de facto standard defining a firmware interface....

 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. This however can cause compatibility problems.

For operating systems such as Microsoft
Microsoft
Microsoft Corporation is an American public multinational corporation headquartered in Redmond, Washington, USA that develops, manufactures, licenses, and supports a wide range of products and services predominantly related to computing through its various product divisions...

 DOS
DOS
DOS, short for "Disk Operating System", is an acronym for several closely related operating systems that dominated the IBM PC compatible market between 1981 and 1995, or until about 2000 if one includes the partially DOS-based Microsoft Windows versions 95, 98, and Millennium Edition.Related...

 or older version of Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...

, each partition must start and end at a cylinder boundary. Only some of the most modern operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

s (Windows XP included) may disregard this rule, but doing so can still cause some compatibility issues, especially if the user wants to perform dual boot
Dual boot
Multi-boot or Multi-booting is the act of installing multiple operating systems on a computer, and being able to choose which one to boot when starting the computer. The term dual-booting refers to the common configuration of exactly two operating systems...

ing on the same drive. Microsoft does not follow this rule with internal disk partition tools since Windows Vista.

See also

  • Cylinder (disk drive)
    Cylinder (disk drive)
    A disk drive cylinder is a division of data in a disk drive, as used in the CHS addressing mode of a Fixed Block Architecture disk or the cylinder–head–record addressing mode of a CKD disk. The concept is concentric, hollow, cylindrical slices through the physical disks , collecting the respective...

  • CD-ROM format
  • Block (data storage)
    Block (data storage)
    In computing , a block is a sequence of bytes or bits, having a nominal length . Data thus structured are said to be blocked. The process of putting data into blocks is called blocking. Blocking is used to facilitate the handling of the data-stream by the computer program receiving the data...

  • Disk storage
    Disk storage
    Disk storage or disc storage is a general category of storage mechanisms, in which data are digitally recorded by various electronic, magnetic, optical, or mechanical methods on a surface layer deposited of one or more planar, round and rotating disks...

  • Disk formatting
    Disk formatting
    Disk formatting is the process of preparing a hard disk drive or flexible disk medium for data storage. In some cases, the formatting operation may also create one or more new file systems...

  • File Allocation Table
    File Allocation Table
    File Allocation Table is a computer file system architecture now widely used on many computer systems and most memory cards, such as those used with digital cameras. FAT file systems are commonly found on floppy disks, flash memory cards, digital cameras, and many other portable devices because of...

  • Disk partitioning
    Disk partitioning
    Disk partitioning is the act of dividing a hard disk drive into multiple logical storage units referred to as partitions, to treat one physical disk drive as if it were multiple disks. Partitions are also termed "slices" for operating systems based on BSD, Solaris or GNU Hurd...


External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK