Hard Disk

Even after decades of evolution in computing, the hard disk drive remains the primary means of fast data storage and retrieval in computer systems of all sizes. The disk itself consists of a rigid aluminum alloy platter coated with a magnetic oxide material. The platter can be rotated at speeds of more than 10,000 rpm. A typical drive consists of a stack of such platters mounted on a rotating spindle, with a read/write head mounted above each platter. Early hard drive heads were controlled by a stepper motor, which positioned the head in response to a series of electrical pulses. (This system is still used for floppy drives.) Today’s hard drives, however, are controlled by a voice-coil actuator, similar in structure to an audio speaker. The coil surrounds a magnet. When a current enters the coil, it generates a magnetic field that interacts with that of the permanent magnet, moving the coil and thus the disk head. Unlike the stepper motor, the voice coil is continuously variable and its greater precision allows data tracks to be packed more tightly on the platter surface, increasing disk capacity. The storage capacity of a drive is determined by the number of platters and the spacing (and thus number) of tracks that can be laid down on each platter. Capacities have steadily increased while prices have plummeted: In 1980, for example, a hard drive for an Apple II microcomputer cost more than $1,000 and held only 5 MB of data. As of 2007 internal hard drives with a capacity of 500 GB or more cost around a $150.00.

Data is organized on the disk by dividing the tracks into segments called sectors. When the disk is prepared to receive data (a process called formatting), each sector is tested by writing and reading sample data. If an error occurs, the operating system marks the sector as unusable (virtually any hard disk will have at least a few such bad sectors). The set of vertical corresponding tracks on the stack of platters that make up the drive is called a cylinder. Since the drive heads are connected vertically, if a head is currently reading or writing for example sector 89 on one platter, it is positioned over that same sector on all the others. Therefore, the operating system normally stores files by filling the full cylinder before going to a new sector number.
Another way to improve data flow is to use sector interleaving. Because many disk drives can read data faster than the operating system can read it from the disk’s memory buffer, data is often stored by skipping over adjacent sectors. Thus, instead of storing a file on sectors 1, 2, and 3, it might be stored on sectors 1, 3, and 5 (this is called a 2:1 interleave). Moving the head from sector 1 to sector 3 gives the system enough time to process the data. (Otherwise, by the time the system was ready to read sector 2, the disk would have rotated past it and the system would have to wait through a complete rotation of the disk.) Newer CPUs are often fast enough to keep up with contiguous sectors, avoiding the need for interleaving. Data throughput tends to decrease as a hard drive is used. This is due to fragmentation. The operating system runs out of sufficient contiguous space to store new files and has to write new files to many sectors widely scattered on the disk. This means the head has to be moved more often, slowing data access. Using an operating system (or Parts of a typical hard disk drive. Many hard drives have multiple heads and platters to allow for storage of larger amounts of data. Users can periodically reorganize their hard drive so that files are again stored in contiguous sectors. Files can also be reorganized to optimize space rather than access time. If an operating system has a minimum cluster size c4K, a single file with only 32 bytes of data will still consume 4,096 bytes. However, if all the files are written together as one huge file (with an index that specifies where each file begins) that waste of space would be avoided. This is the principle of disk compression. Disk compression does slow access somewhat (due to the need to look up and position to the actual data location for a file) and the system becomes more fragile (since garbling the giant file would prevent access to the data in perhaps thousands of originally separate files). The low cost of high capacity drives today has made compression less necessary.

Leave a Reply