Monday, April 30, 2007

CHS-Cylinder,Head,Sector

From Wikipedia, the free encyclopedia

Jump to: navigation, search
Cylinder, head, and sector of a hard drive.

Cylinder-head-sector, also known as CHS, was an early method for giving addresses to each physical block of data on a hard 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.

Contents

[hide]

[edit] Definitions

[edit] Platters and Tracks

Every disk drive consists of one or more platters. A platter can be thought of as a collection of concentric, flat rings. Data is stored on the surface of a platter inside these rings, or circular strips; which are called tracks. These tracks, which may exist on either side of a platter, can be delineated by specifying certain cylinder and head values.

[edit] Heads

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 can be manipulated; usually there are 2 heads per platter--one on each side. (Sometimes the term side is substituted for head, since platters may be separated from their head assemblies; as is definitely the case with the removable media of a floppy drive.)

[edit] Cylinders

A cylinder comprises all the tracks that can be accessed by the read/write heads while their access arms remain stationary. If drives used only one side of a single platter, the term "track" would always be used instead of "cylinder."

[edit] Sectors

A platter can also be thought of as a collection of slices called sectors.

[edit] Blocks

The intersection of a cylinder and a sector is called a block. These blocks are the smallest geometrical breakdown of a disk, and they represent the smallest amount of data with which a disk can deal (each block usually contains 512 bytes of data).

Note: Many PC engineers and technicians now use the term sector to speak of the smallest amount of data a disk drive can access. The UNIX/Linux communities, however, still employ the term block in the sense described above, for 512-byte chunks of data, or various multiples thereof. For example, the Linux fdisk utility normally displays partition table information using 1024-byte Blocks while also using the term sector in describing the disk's size in the phrase, "63 sectors/track" (though technically, the phrase "63 sectors/cylinder" should be used).

[edit] CHS Addressing

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)

then finally rewritten as:

   blocksPerPlatter = (Cylinders)*(Heads)*(Sectors)

[edit] Examples

A "1.44 MB"[1] 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:

   blocksPerPlatter = (80)*(2)*(18) = 2880

The four 16-byte entries within an MBR's Partition Table limit the values of their CHS tuples to: 1024 cylinders, 255 heads and 63 sectors. For computers whose BIOS code was also limited to using only these CHS values, what was the largest size hard disk they could handle? Starting with the formula above, but also multiplying by 512 bytes/block, the hard disk could be no larger than:

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

[edit] 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 value of 500 x 4 x 32 would have 500 tracks per side on each platter, two platters, and 32 sectors per cylinder, with a total of 32,768,000 bytes (about 32.8 MB, or 31.25 MiB). Most modern drives have a surplus space that doesn't make a cylinder boundary. Each partition should always start and end at 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 boot more than one OS on the same drive.

ATA/IDE drives have replaced the MFM and RLL drives, and are much more efficient at storing data. They use Zone Bit Recording (ZBR), where the number of sectors in a cylinder varies with its location on the drive. Cylinders nearer to the edge of the platter contain more sectors than cylinders close to the spindle, because there is more space in a given track near the edge of the platter. The CHS addressing scheme does not work on these drives because of the varying number of sectors per cylinder. An 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 since the drive will convert any given CHS value into an actual address for its specific hardware configuration.

[edit] Notes

  1. ^ This popular label for the usual format of a 3.5-inch floppy diskette is a misnomer, since its actual capacity is 1440 KiB; or: 1440 binaryKilo-bytes x 1024/binaryKilo = (exactly) 1,474,560 bytes (which is neither 1,440,000 bytes nor the equivalent of 1.44 MiB).

[edit] See also

[edit] External links

No comments: