Search This Blog

Monday, 3 November 2014

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 gen-erates a magnetic field that interacts with that of the perma-nent 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 microcom-puter 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 cur-rently 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 sec-tor number.

Another way to improve data flow is to use sector inter-leaving. 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 sec-tors. 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 third party) defragmentation utility, 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 spec-ifies 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.

Interfacing Hard Drives

When the operating system wants to read or write data to the disk, it must send commands to the driver, a pro-gram that translates high-level commands to the instruc-tions needed to operate the disk controller, which in turn operates the motors controlling the disk heads. The two most commonly used interfaces for PC internal hard drives today are both based on the ATA (Advanced Technology Attachment) standard. The older standard is PATA (par-allel ATA), also called IDE (Integrated Drive Electronics) or EIDE (Enhanced IDE). Increasingly common today is SATA, or serial ATA. Another alternative, more commonly used on servers, is SCSI (Small Computer System Interface). SCSI is more expensive but has several advantages: It has the ability to organize incoming commands for greater effi-ciency and also features greater flexibility (an EIDE control-ler can connect only two hard drives, while SCSI can “daisy chain” a large number of disk drives or other peripherals). In practice, the two interfaces perform about equally well. USB (Universal Serial Bus) is frequently used to interface with external hard drive units (see usb).

The capacity continues to increase, with data able to be written more densely or perhaps in multiple layers on the same disk surface. Denser storage also offers the ability to make drives more compact. Already hard drives with a diameter of about an inch have been built by IBM and oth-ers for use in digital cameras.

The proliferation of multimedia (including video) and the growth of databases has fed a voracious appetite for hard drive space. Disks with a capacity of 1 TB (terabyte, or trillion bytes) were starting to come onto the market by 2007. For larger installations, disk arrays (see raid) offer high capacity and data-protecting redundancy.

Perpendicular hard drive recording technology recently developed by Hitachi aligns the magnetic “grains” that hold bits of data vertically instead of horizontally, allowing for a considerably higher data density (and thus capacity, for a given size disk). Hitachi suggests that eventually 1 TB can be stored on a 3.5" disk.

Drive speeds (and thus data throughput) have also been increasing, with more users choosing 7200 rpm rather than the formerly standard 5400 rpm drives. (There are drives as fast as 15,000 rpm, but for most applications the benefits of higher speed drop off rapidly.)

Another factor in data access time and throughput is the use of a dedicated memory device (see cache) to “pre-fetch” data likely to be needed. Windows Vista allows memory from some USB memory sticks (see flash drive) to work as a disk cache. “Hybrid” hard drives directly integrating RAM and drive storage are also available.

No comments:

Post a Comment