UNIX System Administration Handbook - Evi Nemeth [83]
Exhibit B Disk geometry lesson
A typical hard drive consists of spinning platters coated with a magnetic film. Data is read and written by a small head that changes the orientation of the magnetic particles on the surface of the platters. The data platters are completely sealed so that no dust or dirt can get in. This feature makes fixed hard disks far more reliable than removable media.
In the very early days of computer hardware, disk drives usually had one platter. An increase in storage capacity was provided by an increase in the diameter of the platter. On the wall of one of our user areas is an ancient disk over four feet in diameter that held approximately 280K of data. That’s less than 10% of the capacity of a modern extended density floppy.
Today, hard disks usually have several small platters stacked on top of one another rather than having a single large platter. Both sides of the platters are used to store data, although one side of one platter usually contains positioning information and cannot be used for storage. Single-platter densities are currently up around 10GB, with no end to Moore’s Law5 in sight.
Platters rotate at a constant speed. They are read from and written to by little skating heads that move back and forth like the needle on a record player. The heads float very close to the surface of the platters but do not actually touch them. The distance between the head and the spinning platter can be compared to an F-16 fighter jet flying at full speed 10 feet above the ground. If a head does touch a platter, this event is called a head crash; it can be very destructive.
Rotational speeds have increased dramatically over time. Older disks ran at 3,600 RPM or 5,400 RPM. 7,200 RPM is currently the upper-mass-market standard, and 10,000 RPM and 15,000 RPM drives are becoming popular at the high end. Higher rotational speeds decrease latency and increase the bandwidth of data transfers but may potentially introduce thermal problems stemming from increased heat production. Be sure you have adequate air circulation if you plan to purchase a cutting-edge drive.
At least one head is required for each surface. The heads on early drives had to move huge distances, but the modern geometry of small, stacked platters is more efficient. The diameter of disks continues to decrease, from a standard of 14 inches 20 years ago, to 5 1/4 inches 10 years ago, to 3 1/2 inches and smaller today.
Moving the head to the correct position to read a particular piece of data is called seeking. Each position that a head can occupy as the disk spins under it is called a track. Tracks are further divided into sectors, which are usually 512 bytes long.
A set of tracks on different platters that are the same distance from the spindle is called a cylinder. If all the heads move together, as is typical on most mass-market drives, the data stored in a single cylinder can be read without any additional movement. Although heads move amazingly fast, they still move much slower than the disks spin around. Therefore, any disk access that does not require the heads to seek to a new position will be faster.
The UNIX filesystem attempts to exploit this fact to improve efficiency. Unfortunately, the original BSD filesystem code is thwarted by a now-universal practice known as zone sectoring, in which tracks on the outside of a platter contain more sectors than inner tracks. To fully optimize the internal workings of the drive, the layout information is not shared with the software. Instead, an artificial cylinder-head-sector (CHS) addressing scheme is made up to fit the size of the disk. Even today, many filesystem optimizations are based on complete fiction.
Although almost any CHS values that multiply out to match the size of the disk can be used, the manufacturer will typically have some suggested values. Some configurations—such as those with more than 1,024 cylinders or more than 255 heads—may cause problems with some operating