Hard disk drives are a form of magnetic storage, and they are one of the only mechanical parts of a computer, besides the floppy drive, CD-rom and user input controls. Hard drives can be internal or external, but both implementations contain almost the exact same structure.
Construction
A hard drive is made out multiple flat disks called platters which magnetically store the data. The platters are connected to, and rotate around an axis, called the spindle. The spindle is used to rotate the platters so that an electromagnetic sensor can read to or write to the platter while it spins underneath it. This electromagnetic sensor is called a head, and both surfaces of each platter has their own head. This head can move 1 dimensionally toward or away from the spindle on what is called an actuator arm. Each head sensor is connected to the hard drive's logic circuitry which controls disk rotation, buffering, and interfacing with the rest of the computer. This whole assembly is enclosed in an air tight case to prevent particles from scratching the disk surface.Platters
Platters are made out what is called a substrate, and this is usually an aluminum alloy. The substrate has to be durable, lightweight, inflexible, and heat resistant. It has be able to withstand constant rotation without warping do to heat, or vibrating. To store the magnetic information, platters are coated with a magnetic material, which is less than a millimeter thick. This magnetic material will retain an electrical charge much like what is used in a cassette tape or floppy drive. When the material is in contact with a magnetic field, it causes the material's atoms to align like a magnet. This stores the magnetic field, to be read or written overtop of. The magnetic material is bonded to the platters either through electroplating or a technique called sputtering. On top of the magnetic material, a protective layering is added to both lubricate the platter and protect the disk from scratches.Most modern hard drives contain between 1 and 5 platters. Platters are usually 3.5" in diameter to maximize the efficiency of the 3.5" drive bay. Some hard drives use 5.25" drive bays so their platters would be up to 5.25" in diameter. In laptops, where space is a major concern, hard drive platters can be as small as 1" in diameter. The advantages of large platters are their extra surface area which can increase capacity. The down sides to large platters are that they are more susceptible to damage due to vibration. More down sides are that they require more power to turn the spindle, resulting in needed and larger motor which in turn creates more head. The largest concern though is that it is harder to manufacture large platters that are uniformly flat.
Connectors
On the back of the hard drive there are multiple connectors which are used to by the hard drive. These usually include power, data interface, jumpers, and LED connection.The power interface is used to supply power to the hard drive. The power cord is directly from the power supply to the hard drive, and supplies the hard drive with both +5 volts and +12 volts.Read / Write HeadsThe data interface is used by the hard drive to exchange data with the system. This connection runs either to the motherboard or to a controller card. There are multiple interface formats that can be used.
Jumpers are located on the back of the hard drive to set specific settings for the hard drive which are needed during detection.
Some older hard drives have an LED connection that will plug into the hard drive activation LED at the front of the computer case. Most newer hard drives do not have this feature because it is built into the interface controller.
Read / Write are electromagnetic sensors which run very closely over the surface of the hard drive. These heads detect the magnetic field around the specific locations on the platters, and sense whether a certain area has a magnetic charge or not. They convert this pattern into a series of pulses which are sent to the logic circuitry to be converted to binary and processed by the rest of the system. To store information, the hard drive logic circuitry sends the heads a series of electronic pulses, and instead of detecting magnetic fields, the heads create an electromagnetic which realigns the atoms in the magnetic material.Actuator Arms
Actuator arms have two main parts. The arm, which is attached to the read/write heads, which is suspended over the platters, and the actuator. The actuator positions the arm and heads in the correct location over the platters so that information can be accessed. Changing locations on the hard drive is very important to hard drive performance, so the fast the actuator is, the lower the latency. Both sides of each platter have a head and actuator arm and all of the actuator arms for each of the platters in a hard drive are connected.Actuators are made out of what is called a voice coil. A voice coil works on the principles of electromagnetic repulsion and attraction. When the coil is powered, it causes the actuator arm to move either in or out depending on the strength of the current. The voice coil is a part of a closed loop feedback system, it will monitor its own performance and accuracy, and make adjustments when necessary. This closed-loop system used for dynamic placement is called the servo control.
Servo Control
The servo control is part of the actuator. It can dynamically position the read/write heads to compensate for thermal expansion of the platters. When the read/write heads are moved, they will periodically check their position to see if they are in the right spot. They do this by reading special data areas called servo codes. Servo codes can be scattered among the data in non-writeable and engineered positions, or written completely on one side of each platter. When servo codes are scattered amongst the data, it is called embedded servo. This practice is most common because it doesn't effect storage capacity as much. When one side is all servo codes, it is called dedicated servo. This is used in some high end hard drives because the servo codes are always accessible, resulting in more precise and reliable for high density drives. The downside to dedicated servo is that half of the capacity of the hard drive is lost. Servo codes are embedded into the hard drive during manufacturing and can not be changed.During thermal recalibration, when the servo information is being read, the hard drive is inaccessible to other read/write functions. This is not a problem for most situations because hard drive access is delayed for an insignificant amount. In some situations, such as real-time audio or video recording this pause in hard drive accessibility will cause an error. Some hard drives have found ways to work around this problem, whether through using large buffers, not using servo control, or by the use of a more efficient servo method. These hard drives are usually more expensive and are marketed under the "audio/visual" or "A/V" name.
Control Circuitry
All hard drives contain simple logic that controls normal hard drive operation. This saves the rest of computer from having to control all of the simple tasks of the hard drive. Of these tasks, one is to process the data which is read off of the platters. Data is stored on hard drive platters in magnetic fields, and it is the control logic's job to convert the magnetic information read from the platters into binary information, and vise versa. Another basic task that the hard drive control logic is responsible for is finding the correct data on the hard disk. These means converting the memory address which is sent to it by the computer into the correct location on the disk, and moving the heads to that area for access. Also involved in finding the correct location on the disk, the control circuitry has to make head skew and cylinder skew adjustments. The higher level functions that the control circuitry are responsible for are the processing of servo control, data caching, and interfacing with the rest of the computer. Control circuitry is controlled by its firmware, which is stored in a ROM on the hard drive. This contains the software which is necessary for the hard drive to perform basic functions.Cache
This is a memory buffer which is used to store the data read from or written to the hard drive so that it can be transferred to and from the computer in large packets rather then at the speed it is accessed by the hard drive. Most hard drives contain 512k to 2MB of cache.
The geometry of different hard disks varies, but always follows the same layout, no matter what the size or storage capacity. In each hard drive, each platter has 2 sides, and both of these sides are the same throughout each platter.Tracks
Tracks are concentric circles of information on the disk. Unlike CD's, which has only one track that spirals out from the center, hard drives have many tracks. And unlike CD's, hard drive tracks start at the outer edges of the hard drive and work their way in. Tracks are read by placing the actuator arm and heads over the correct track, and the hard drive rotation will move the complete track under the head. There are many thousand tracks on each side of each platter in today's hard drives. Tracks are not referred to by themselves, instead they are part of cylinders, and broken down into sectors. The number of sectors in a track is dependent on which zone the track is part of.Sectors
Are the smallest geometry that a hard drive has. Each sector is 512 bytes of user data, plus a few additional bytes are used for servo control, error detection and error correction. Sectors are sections of each track. Sectors are responsible for the storage of individual files.Cylinders
Cylinders are grouping of the corresponding tracks on all of the platters. Because each platter's actuator arm is connected to the other actuator arms, all of the different platter's heads will always be on the same tracks. It is only logical that tracks be organized in cylinders. For example, track 3 on each platter compose the number 3 cylinder. This organization forms what can be visualized as an imaginary cylinder. Cylinders aren't needed for operation, but are used in all hard drives to make sector location easier.Zones
Tracks are concentric circles on the platters, so the outer tracks will naturally have a larger circumference than the inner tracks. Because the outer tracks are bigger than the inner ones, they are able to hold more data. To handle this, a feature called zoned bit recording (ZBR) is used. ZBR is often referred to as multiple zone recordering or zone recording. Zoned bit recording is where outer tracks are grouped into different zones. These zones start on the outside tracks and are numbered in ascending order until it reaches the inner track.Every track in a certain zone has the same number of sectors as every other track in that zone. Each zone can have a random number of tracks, and use a random number of sectors per track, it is up to the manufacturer to find the optimum numbers. Hard drive manufacturers can also add as many zones as they wish, with no set patterns to them because it is the internal control logic's responsibility for making zone conversions, so the feature is transparent to the rest of the computer.
Partitions
Partitions are when a drive is broken up into different portions. Each portion, or partition, has its own boot record and FAT. This allows a single hard drive to be partitioned to support different file structures.

Fat12
Hard Disk Size FAT16 Cluster Size FAT32 Cluster Size 32MB 2 KB (4 sectors/cluster) - 128MB 2 KB (4 sectors/cluster) - 256MB 4 KB (8 sectors/cluster) - 512MB 8 KB (16 sectors/cluster) 4 KB (8 sectors/cluster) 1GB 16 KB (32 sectors/cluster) 4 KB (8 sectors/cluster) 2GB 32 KB (64 sectors/cluster) 4 KB (8 sectors/cluster) 7GB - 4 KB (8 sectors/cluster) 16GB - 8 KB (16 sectors/cluster) 32GB - 16 KB (32 sectors/cluster) 32GB - 2 TB - 32 KB (64 sectors/cluster)
An early FAT structure that used only 12 bits for cluster addressing. This was soon replaced by FAT16.Fat16
Fat16 uses 16bit locations to reference files. This imposed some limitations. There could be only 216 clusters, or exactly 65536 files. FAT16 used a dynamic size for each cluster depending on the hard disk capacity. Because of the 65536 limitation, FAT16 tried to get the most out of the hard drive. Larger hard drives would waste large portions of their space because even the smallest 1 byte file would consume an entire 32k cluster. Fat16 was limited to files only 2 GB's or less. Hard drives over 2 GB's would have to be partitioned into multiple drives to overcome this limitation.Fat32 and VFAT
Fat32 uses 32bit locations to reference files. It was first introduced with Windows95and it allows for addressing of 4294967296 clusters, a yields a storage capacity of 2 terabytes. VFAT is short for Virtual File Allocation Table, which is another name for FAT32.New Technology File System
NTFS is used exclusively with Windows NT and Windows NT based Operating Systems. It offers 32-bit file storage like VFAT, but offers data encryption and cluster compression.High Performance File System
HPFS first appeared is IBM's OS/2 Operating system. It is no longer used by any other OS, but it did feature support for 2TB disks and filenames up to 256 characters.
For binary information to be stored magnetically, it has to go through some sort of a conversion. This conversion is know as encoding. Each bit which is stored on the hard drive is saved in a pattern of magnetic fluxes. A flux is whenever the polarity is switched, like from north to south, and each flux requires 2 areas. For storage, the most rational storage would be north orientation for 1's and south orientation for 0's. A little problem arises in that when there are groups of similarly polar fields, they strengthen each other to become more powerful and potentially destructive to nearby areas. This would occur mostly at the end of the drive when the drive is not full of information. The similar polarity of all of the zeros would disrupt the information around it. To prevent this, information is stored on the hard drive as a series of fluxes, using specific formats that govern the method in which this is accomplished.Floppy Disk ConstructionFrequency Modulation
The very first hard drives and floppy disk drives used frequency modulation. Frequency modulation was accomplished by using a flux followed by another data bit. The data bit would be a flux for a 1, and no flux for a 0. This scheme would neutralize the additive nature of the magnetic fields. This required that 4 magnetic areas were used, and this proved to be a real waste of space.Modified Frequency Modulation
MFM improved on the frequency modulation in that it added an extra flux only between 2 consecutive zeros, where frequency modulation would add one before ever piece of data.
DATA - Frequency Modulation - Modified FM 1111 FFFFFFFF FFFF 0000 FNFNFNFN NFNFNFN 1010 FFFNFFFN FNFN F=flux, N=no flux MFM almost cut the average usage down by half, but there were still problems in that the amount of data that a disk could hold would change depending on the binary patterns. MFM is still used with floppy disks because changing them to another format would make them incompatible with older versions.
Run Length Limited
RLL is what is used on most hard drives. There are many different variations to this format, which are chosen to best optimize the hard drive usage. This format only specifies the use of two parameters, run length and run limit. Run length is the minimum space that is allowed between two fluxes. Run limit is the maximum space allowed between two fluxes. Data is analyzed in chunks, rather than bit by bit. RLL follows set of patterns for certain data sequences which are defined by the type of RLL being used. This optimizes the storage of data to use the least amount of space possible, increasing hard drive capacity. The types of RLL are expressed as "X,Y RLL". The most commonly used pattern is "1,7 RLL".Partial Response Maximum Likelihood
PRML was designed by the Quantum Corporation, and is used solely on their hard drives. This format was designed to allow a higher areal density without corrupting the data. Instead of translating fluxes directly to bits, the flux pattern is analyzed, an the most likely data pattern is extracted. This allows the magnetic storage to be 30-40% more compact, but still remain readable.
Floppy disk drives operate in almost the exact same way as hard disk drives do. The only difference is in their construction. Floppy disks use a flexible medium, it is basically the same magnetic coating which is used in hard drives, but only it is affixed to a pliable plastic instead of a metal platter.Floppy disks do not rotate as fast, and only have one storage layer. This layer is double sided to increase storage capacity. Floppy drives use the same technology as the older hard drives did, and were never upgraded because it wasn't necessary. Floppy disks were never made to store great volumes of information, that is what a CD-R is for.
Floppy disk actuator arms are controlled by a stepper motor. This is a lot less precise than a voice coil, but more inexpensive to manufacture. A stepper motor turns rotates, spinning the actuator arms. The motor is capable at stopping in predefined spots, and each time the stepper makes one complete revolution, the actuator changes one track position. A 1.44MB floppy disk has a track density of only 135 tracks per inch, while a modern hard drive has an upwards of 7500 tracks per inch.