# How a hard disk works

This post is going to explain the fundamental part of how the hard drive in your old computer works. Modern solid state disks work completely differently, so this applies only to the older type that have been common for several decades. Specifically, when your computer writes something to the drive, it has to turn the sequence of zeroes and ones which make up the binary data into something physical on the disk. Then, when it needs to read this information later, it can go back and look at that part of the disk and recover the zeroes and ones from whatever material they were written to. But how do you tell the difference between a one and a zero? That’s the question I’ll try to answer.

### Spin

But before we can get to that point, I have to explain a really important concept in quantum mechanics called “spin”. This is a quantity which is carried by all quantum mechanical particles, and is linked in a loose way to the rotational symmetry of the particle. Look at the right-pointing arrow in the picture. Hopefully it’s easy to see that the only way you can rotate the arrow so that it looks exactly the same as it does when you start (this is called a symmetry operation) is to rotate it through 360°. A particle that has this rotational symmetry is said to have a spin of 1. Now look at this double-headed arrow. If you rotate around the axis indicated by the red dot, you only have to rotate it by 180° to get back to where you started. This has a spin of 2 because you have to rotate half a turn to get the first symmetry operation. The other pictures show a few different spins.

But what about electrons? Well, they have spin of ½. Just to be clear about what that means, using the same analogy it implies that you have to rotate by 720° before the electron “looks” like it did when you started. There isn’t a good way to draw that so I can’t give you a picture of a spin-½ particle, so this is one of those places where quantum mechanics is weird and counter-intuitive and we just have to get on with it. The other building blocks of atoms (protons and neutrons) also have spin-½ so in this post I’ll focus on that strange case. The crucial thing about spin-½ particles is that their spin can exist in one of two states, usually called ‘up’ and ‘down’, and typically are represented by arrows pointing in those two directions.

But why does this matter? Well, individual spins generate a magnetic field. The reason that iron is a magnetic material is that the interaction between the spins in the iron atoms makes their spins all line up in the same direction. Therefore, the tiny magnetic fields associated with each of the spins all add up to make a large field. Non-magnetic materials don’t have this alignment (in fact, their spins are all randomly aligned) and so the tiny magnetic fields all cancel each other out because they are pointing in opposite directions. Materials like iron which have this alignment are called ‘ferromagnetic’.

### Reading and writing in a hard disk

But, what does this have to do with your laptop? Well, in a hard disk, the part where the zeroes and ones are stored is made from two small pieces of ferromagnetic material. Then, the difference between a one and a zero is made by manipulating the spins of the atoms in one of the ferromagnetic layers. When an electric current is passed through this region, the electrons behave differently depending on the spins. Specifically, if the electrons have the same spin as the atoms, then they don’t interact very strongly and the electrical resistance is quite low. But if they have opposite spins, the electrons interact strongly with the atoms so they bounce off the atoms (or “scatter” in the technical language), their progress is impeded, and the electrical resistance is high.

The way to encode a one or a zero is shown in the picture below. A one is encoded by aligning the ferromagnets (the pink layers) so that their spins point in the same direction. In the left-hand picture, I show this with both layers having up-spins. A current of electrons (shown by the red arrows) has a half-and-half mix of electrons with up-spin and down-spin. When it is passed through the stack, the up-spin electrons interact weakly with the ferromagnet up-spins in both layers (black arrows) and encounter low resistance. This means that some of the current put in at the top of the stack emerges from the bottom and this characterises the one state. Note that the down-spin electrons are blocked from getting to the bottom of the stack because they scatter strongly off the up-spin atoms in the first ferromagnet layer and so the resistance for them is high.

For the zero state, one of the ferromagnetic layers has its spins reversed. In the right-hand picture, this is shown by the lower layer now having a down-spin black arrow. For electric current, the down-spin electrons still scatter strongly from the up-spin atoms in the top layer. The up-spin electrons still pass through this layer, but then they encounter the down-spin atoms in the lower layer where the electrons and the atoms have opposite spin, so they scatter strongly. This means that no current emerges at the bottom of the device, and so this defines the zero state.

This means that, for the hard disk to work, it needs to be able to do two things. Firstly, the “write head”, which is the part that encodes the zeroes and ones when data is written to the disk, needs to be able to flip the spins of one of the ferromagnetic layers. Then, to recover the information at a later time, the “read head” tries to pass current through a specific piece of the disk material. If current flows (because the ferromagnet spins are the same) then this is a one. If current does not flow (because the ferromagnet spins are opposite) then it is a zero.

And this works entirely because of the quantum-mechanical property of particles called spin: aligned spins is a one, opposite spins is a zero. And as a bonus, it also explains why you have to be careful with hard drives and strong magnetic fields, because a magnet can change the alignment of all the ferromagnetic areas in the hard disk and destroy the encoded ones and zeros. Don’t say you weren’t warned!

## 5 thoughts on “How a hard disk works”

1. Interesting post , but does the external HDD works on the same principal.

Liked by 1 person

1. It doesn’t really matter if a drive is internal or external. For both types, the older magnetic disk ones work like this while the newer SSDs don’t.

Liked by 1 person

1. Okay, thank you for your valuable time . looking forward to your further posts .😊👍.

Like

2. Timoy says:

Thanks for the good explanation!

Like