The Physics of the Hard Drive: Data Stored in Magnetism

Your files live as magnetic grains on a platter, read by a head flying nanometres above it. How writing, reading and magnetoresistance work.

Table of Contents

Reach into your pocket, open your laptop, or picture the humming racks of a data centre, and somewhere in all of them sits one of the quietest miracles of modern engineering: a machine that writes your life into the alignment of matter itself. For decades, the workhorse of that job was the hard disk drive, a device that stores your photos, documents and films not as ink, not as light, but as microscopic patterns of magnetism smeared across the surface of a spinning disk. It is a strange and beautiful idea. Everything you have ever saved to such a drive is, at bottom, billions of tiny bar-magnets, each pointing one way or the other. Learning how those magnets are set, sensed and organised is a tour through some of the most elegant physics ever put to practical use.

A Disk Made of Countless Tiny Magnets

At the heart of a hard drive is the platter, a rigid disk, usually of glass or aluminium alloy, polished to a mirror finish and coated with an extremely thin magnetic film. That film is not smooth and continuous in the way it looks to the eye. Under a powerful microscope it resolves into a mosaic of countless tiny magnetic grains, and it is in these grains that information lives. Each grain, or small cluster of grains acting together, can be magnetised in one of two opposite directions, exactly the way a compass needle can point north or point south.

This ability to hold a direction is the whole game. A magnetic material is made of regions called magnetic domains, each of which behaves like a miniature magnet with its own north and south poles. In an unmagnetised piece of iron these domains point every which way and cancel out, but apply a field and they can be persuaded to line up, locking in a chosen orientation that survives after the field is removed. That persistence is what makes magnetism such a wonderful medium for memory, and it is the same physics that runs from a fridge magnet to a magnetic-resonance scanner, as we explore in our history of magnetism from lodestones to MRI. On a hard drive, engineers exploit this to store data: magnetise a patch of film one way and you have recorded one value; magnetise it the other way and you have recorded its opposite.

Bits as Directions in a Magnetic Field

Computers speak in binary, a language of just two symbols, the zero and the one. Every number, letter, pixel and sample of sound your machine handles is ultimately a long string of these bits, and the reason two symbols suffice is that logic circuits and memories can be built from simple two-state switches, a story we tell in our piece on how transistors think with Boolean logic in silicon. A hard drive gives those two symbols a wonderfully physical home. A region magnetised in one direction stands for one value, and the same region magnetised in the reverse direction stands for the other.

You can think of each tiny magnetised patch as a compass frozen in place, its needle committed to pointing one way or the other. The direction of magnetisation is the message. This is precisely the sense of magnetic direction, of poles and the domains behind them, that governs a real compass needle finding north, described in our look at the physics of the compass. Where a compass reads the Earth’s field to tell you which way is north, a hard drive imposes its own tiny fields to write a story of zeros and ones, then reads them back later. The trick is doing this billions of times over, at blistering speed, in a space smaller than a fingernail.

Writing with a Miniature Electromagnet

To set a magnet you need a magnetic field, and the write head supplies one on demand. It is a tiny electromagnet: a microscopic loop of wire wound around a magnetic core, so small it would be lost on the head of a pin. When an electric current flows through that coil it generates a magnetic field, and by choosing the direction in which the current flows, the head chooses the direction of the field. Send the current one way and the passing patch of disk is magnetised in one orientation; reverse the current and the very next patch is magnetised the opposite way, writing the opposite bit.

This is the deep unity between electricity and magnetism at work, the discovery that a moving charge conjures a magnetic field and that the two are really facets of a single phenomenon, which we unpack in our explainer on what electromagnetism is. Because the platter is spinning beneath the head thousands of times a minute, the write head does not need to move much to record a great deal. It simply flips its current back and forth at high speed, and the moving disk carries a fresh patch of film under it for each bit, so a long stream of data is laid down along a circular path. In a fraction of a second, an entire song or photograph is stitched into the film as a ribbon of alternating magnetic orientations.

Reading Back the Story

Writing is only half the bargain; the drive must also read what it wrote. Here the head becomes a detector, flying over the surface and sensing the direction of each region’s magnetism as it rushes past. The earliest drives used the same principle in reverse: as the head passed from a region magnetised one way to a region magnetised the other, the changing magnetic field induced a tiny voltage in a coil, a flicker of electricity marking the boundary between bits. This is electromagnetic induction, the effect that also lets a spinning magnet generate current in a power station, scaled down to the whisper of a single flipped grain.

Induction works, but it grows feeble as the magnetic regions shrink, and shrinking them is exactly what engineers wanted to do in order to store more. So modern drives read with a different and more sensitive device: a magnetoresistive sensor. The word describes its behaviour plainly. Its electrical resistance changes depending on the magnetic field it happens to sit in. Run a steady current through such a sensor and pass it over the disk, and the field from each tiny region nudges its resistance up or down, altering how much current flows. The drive reads a bit not by catching a fleeting pulse but by measuring the sensor’s changing resistance directly, a far steadier and stronger way to interrogate an ever-smaller magnet.

The Quantum Leap of Giant Magnetoresistance

The story of hard-drive capacity is, to a remarkable degree, the story of one physics discovery. In the late 1980s, two physicists working independently, Albert Fert in France and Peter Grünberg in Germany, found that certain materials built from ultra-thin alternating layers, magnetic layers sandwiching non-magnetic ones, showed a dramatic change in electrical resistance when a magnetic field was applied. The effect was so large it earned a bold name, giant magnetoresistance, or GMR, and it later won its discoverers the Nobel Prize in Physics in 2007.

The essence of GMR is accessible even without the full quantum machinery. In these layered stacks the resistance depends on whether the magnetisations of neighbouring layers point the same way or in opposite directions. When they align, electrons pass through relatively easily and resistance is low; when they oppose, electrons are scattered and resistance climbs. A small external field, such as the one from a single magnetised region on a disk, is enough to swing the layers between these states and produce a large, easily measured change in current. That sensitivity was transformative. A GMR read head could pick out the field of a magnetic region far too tiny for older sensors to notice, which meant engineers could shrink each bit and pack them together far more densely. The explosion in hard-drive capacity through the 1990s and 2000s, from megabytes to hundreds of gigabytes and beyond, rode largely on this one quantum effect turned into a commercial sensor.

Flying Nanometres Above a Spinning Surface

There is a detail about the head that borders on the unbelievable. It does not touch the disk. If it did, friction and heat would destroy both surfaces within moments. Instead the head flies, riding on a cushion of air. As the platter whirls, it drags a thin boundary layer of air around with it, and the underside of the head is sculpted like the wing of a miniature aircraft so that this moving air generates lift. The head is called a slider for exactly this reason, and it floats on what engineers call an air bearing, holding itself a mere handful of nanometres above the surface.

It is worth pausing on that gap, because the scale is genuinely staggering. A human hair is tens of thousands of nanometres across; a typical speck of household dust is thousands. The flying height of a hard-drive head is a few nanometres, so the head skims the disk with a clearance hundreds or thousands of times smaller than a single mote of dust. This is why drives are sealed at manufacture, why a single trapped particle can be catastrophic, and why a sharp knock while the drive is running can slam the head into the platter in what is grimly known as a head crash, gouging the magnetic film and taking your data with it. The whole arrangement is a tightrope act of aerodynamics performed millions of times a second.

Tracks, Sectors and the Cost of Moving

For all this magnetic subtlety to be useful, the data must be organised so it can be found again. The surface of each platter is divided into concentric circular tracks, like the grooves of a record but written invisibly in magnetism, and each track is split into short arcs called sectors, the basic parcels in which data is stored and retrieved. To reach a given piece of information, an actuator arm swings the head across the platter until it hovers over the correct track, and then the drive simply waits for the spinning disk to carry the desired sector around under the head.

Those two motions explain a hard drive’s characteristic small delay. The time to move the arm to the right track is called the seek, and the time to wait for rotation to bring the right sector into position is the rotational latency. Neither is enormous, but neither is instant, and together they mean a hard drive can never respond as quickly as electronics with no moving parts. What the drive gives in return is permanence and cheap abundance. Because magnetism holds its orientation without any power, a hard drive is non-volatile: switch off the machine, and every stored bit stays exactly as it was, waiting patiently for the next time you spin the platters up.

The Rise of the Solid-State Drive

For most of us, the humming, seeking hard drive has quietly vanished from daily life, replaced by the solid-state drive, or SSD. An SSD stores information on an entirely different principle. There is no magnetism and no spinning disk; instead each bit is held as a small amount of electric charge trapped inside a specially built flash-memory transistor. The presence or absence of that trapped charge shifts the transistor’s behaviour in a way the drive can read out, and it stays put without power, so an SSD is non-volatile too. This is the physics of semiconductors and the doped-silicon devices at the heart of all modern electronics, the world we describe in our guide to the physics of semiconductors and modern electronics.

Because an SSD has no moving parts, it sidesteps every mechanical cost of the hard drive at a stroke. There is no arm to seek and no disk to wait for, so reads and writes happen dramatically faster; there is nothing to be jolted out of alignment, so it shrugs off shocks that would wreck a spinning platter; and it makes no noise and sips less power. These virtues are exactly why SSDs took over phones, tablets and the great majority of laptops. Hard drives have not disappeared, though. Where the priority is storing enormous quantities of data cheaply, in the vast archives of data centres and in bulk backup, the magnetic platter still offers more capacity per unit of cost, and so it endures. The two technologies now share the world, each suited to a different demand.

Information Written in Matter

Step back from the mechanics and a quietly astonishing picture remains. On a hard drive, the film you watched last night, the message you sent this morning and the photograph of someone you love are all the same kind of thing: a pattern of tiny magnetic regions, each committed to pointing one way or the other, spelling out zeros and ones in the alignment of matter. A miniature electromagnet set them; a quantum sensor built of layered films reads them; a slider flying nanometres above a spinning disk carries the sensor over them; and a swinging arm and rotating platter deliver each parcel to be read. It is a device that turns the abstract idea of information into something as concrete and physical as the orientation of a compass needle. That such richness of experience can be stored in the direction of countless small magnets is, when you think about it, one of the loveliest bargains physics has ever struck with the everyday world.

Frequently Asked Questions

How does a hard drive store data?

A hard drive stores data as microscopic patterns of magnetism on the surface of a rapidly spinning disk called a platter. The platter is coated with a thin magnetic film made of countless tiny grains, and each bit of information is recorded by magnetising a small region of that film in one direction or the opposite direction. Because a magnetic material can point one way or the reverse, that choice of direction encodes a binary digit: a zero or a one. The data is laid out along concentric circular tracks, and because magnetism persists without power, your files remain intact when the computer is switched off. In essence, everything you save becomes a vast field of tiny magnets, each frozen in a chosen orientation that the drive can later read back.

How does the drive read and write the bits?

Writing is done by a tiny electromagnet. A current is passed through the coil of the write head, producing a magnetic field that forces the patch of disk beneath it to align in a chosen direction; reversing the current writes the opposite bit. Because the platter spins at high speed, the head lays down a long stream of bits along a track. Reading works the other way around. Early heads sensed the small voltage induced as the magnetism flipped beneath them, an example of electromagnetic induction. Modern heads instead use a magnetoresistive sensor whose electrical resistance changes with the magnetic field it sits in, so the drive detects each bit simply by how much current flows through the sensor as the field of each region tugs on it.

Why does the read head float above the disk without touching it?

The read and write head never touches the platter. Instead it rides on a cushion of air, an air bearing, generated by the fast-spinning disk dragging a thin layer of air along with it. The head is shaped like a miniature aircraft wing so that this moving air lifts it and holds it just a few nanometres above the surface, a gap far smaller than a speck of dust or the width of a human hair. Flying this close lets the sensor read magnetic regions that are extraordinarily tiny, which is essential for packing in data densely. It also explains why hard drives are sealed against dust and why a sharp physical shock can slam the head into the surface, causing a destructive head crash that scrapes away data.

What is the difference between a hard drive and an SSD?

A hard drive stores bits in magnetism on a spinning disk, using a mechanical arm that must physically move to the right track and then wait for the disk to rotate the desired data into place. A solid-state drive, or SSD, stores bits instead as trapped electric charge inside flash-memory transistors, with no moving parts at all. Because nothing has to seek or spin, an SSD reads and writes far faster, tolerates shocks better, runs silently and draws less power, which is why phones and most laptops now use them. Hard drives survive mainly where sheer capacity at low cost matters, such as data centres and bulk backup. Both are non-volatile, keeping your data without power, but they rest on entirely different branches of physics: one magnetic, one semiconductor.

Read Next