This article is meant to describe in a simple way how data is stored upon a hard disk drive.
As I have already describe before in the hard drive introduction arctile, the actual thing that happens upon sotring data is that the magnetic heads are writting it on the platter(s). As you might have figured it out, there has to be some kind of mapping, so the hard drive actually knows where and what to read or write. This is NOT the FAT/NTFS/ext file system structure. This is all about physicly storing random data, regardless of the file system or operating system. All this actions are performedby the HDD firmware.
The most basic way a hard dirve can orient itself is the CHS method. This stands for Cylinder, Head, Sector. You must have a good inderstanding of this concept.
What the hell is Cylinder?
Imagine the hard drive heads are staying still, and the platters are rotating. All the data they can read across platters equals a cylinder. It doesn`t matter if you have one platter, two platters or four – it`s all one cylinder. This is a particular position of the heads. The entire hard drive is sliced into cylinders, which are numbered(e.g. 1st, 2nd, 3rd, 4th, etc). So when the hard drive wants the info from Cylinder 671, it knows where to position the heads across the platters.
What does Head means in all this?
So now, when the hard drive knows where to position the heads over the platters, it must know for which head exactly it is aiming to read from. You can have like 16 heads, or 64 heads. So the HDD needs to know which one exactly should get the data. On the picture you can see how the hard drive pinpoints that it should read from let`s say head 1, which is over platter 1. In the same way it could say it needed the data from head 5, over platter 3 or so.
And where does Sector kick in?
Well, currently the hard drive has pointed the Cylinder and Head, but this is not enough – there is a lot of data that matches this criteria. So the space is cut into smaller pieces – Sectors. Each Cylinder/Head section consists of sectors, which are different number, depending on how big the cylinder is(the outter cylinders are bigger than the inner cylinders, as you can imagine yourself). By specifying a sector, for exapmple 983, it`s the last thing that a hard drive needs to locate the exact piece of the platter it has been sent to read or write.
So now we have our addres – Cylinder 671, Head 1, Sector 983. The hard drive can easily position the heads, select the head and get to that specific place. And this specific CHS codordinates are sometimes called a block. A block`s adress for our example would look like 671/1/983.
The C/H/S method has been developed do cover the needs only for hard drives. Therefor it was not very suitable to cover other storage devices and this complicated things more than needed. So a new method was developed – the LBA: Logical block adressing
How is LBA different than a CHS?
Now, when you know what is CHS, it is quite simple to explain what is LBA. Look at the picture below:
As you can see, on the CHS adressing, for each cyinder/head the sector count starts from 0. In general differense of that, the LBA adressing has only Sector counter, where every sector has a unique number, starting from 0.
In LBA adressing mode, the hard drive doesn`t need Cylinder or Head attribute, to find the specific sector, as it uses a prespecified table, knowing ranges for cylinders and heads. So the drive could understand if you tell it you need sector 983, that it belongs to platter 1, where should be read by head 1. This simplifies the comunication and makes it more ocmfortable for non-hard drive devices to operate in the same way, such as SSD disks, Flash drives and so on.
Now, knowing the major principles on logical storage and access of data on a hard drive, you can keep on readin to the interesting stuff in the next articles from this category ; )