A03 – Hard drive sector dissection in depth

Now, as we already know how the data is being stored over the platters(discribed in Chapter 2 of the HDD section) we will be looking deeper into the layers on the platters.

Gap spacing – what is this and why it`s important?

As you might have guessed, there must be free space between cylinders and free space between sectors. It is esential, because the magnetic head it not absolutely perfect in positioning and also the platter is not absolutely perfect in retaining data. Or simply said, to avoid overwriting the next sector, the hard drive must leave some space between them to make sure everything is okay.

The spaces between cylinders is called intercylinder gap and the space between sectors is called intersector gap. Take a look at the picture below:

Interspace gaps

Illustrated interspace gaps on a hard drive platter – for cylinders and sectors

So the space between cylinders is very essential thing to understand. While a head is positioning not so perfectly over a cylinder, there is a slight chance it may not write over the exact same spot, where the cylinder was. Same goes for erasing data, rewriting data and restoring data. The last one is the place where you are hearing myths and legends for restoring a deleted and overwrited data.

Let`s say you have written something on Cylinder 1, Head 1, forming Track 1. This file is essential and you don`t want it to go in the wrong hands. So you delete it. Once upon deletion, you are making sure, to write something over the Track 1, so it cannot be restored. Yet, there is a good chance for someone to restore your data(of course – not by a casual user):

Scenario 1: Upon overwriting, the magnetic head has not written exactly over Track 1(Cyl 1, Head 1), but a slightly on the side, nearer the intercylinder gap. Which means, there is a chance to read the original Track 1, on a few retries(repositioning the head, while it hits the wanted place again) with an apropriate tools and software.

Scenario 2: Upon overwriting, the magnetic head has written exactly over Track 1(Cyl 1, Head 1), yet there are still tiny magnetic traces of the old original data in the intercylinder gap, which was left untouched and can be read by forcing the head to reposition over the inercylinder gap with the apropriate tools and software.

So these common scenarios show how imperfect the position of the head is, and why there is gapping between sectors and cylinders. It is accepted by a common standart that a magnetic head can have up to 30 different positions over a cylinder, which basicly means you can recover up to 30 different tracks from just one cylinder/head – 37 deletions and overwrites. Insane, huh? Yet, it is not doable in home enviroment without the proper equiment.

So there`s numerous algorithms, developed in the manner of deleting the data in the way, it will not leave traces in the intergaps, and will not be recoverable. The most common method is the Gutmann method, which basicly includes 35 passes of overwriting the areas with chains of low and high impulses, thus leaving no way to catch even tiny magnetic signatures afterwards.

Let`s get back to intergaps…

On the bad side, the major efect of intergaps is that you`re loosing space. Intergaps are actually unutilized space, and therefore you are loosing possible drive capacity. So lowering the intergaps should make a drive bigger by logic, yet more risky of overwriting sectors by mistake or mispositioning the head.

One solution for this is presented as the shingled magnetic recording(SMR). A way to reduce intergaps and thus increase the capacity of a drive. How does it work exactly?

Well, as we said, the common method is to have cylinder gaps, so the head reads/writes and has free sapce to make sure it doesn`t touch the other cylinders/tracks:

Convetional Cylinder gaps on writingNow, what SMR is offering is that once a track is written, it doesn`t need any more intercylinder gaps – it will be read just fine. So we can write upon the gaps another cylinder:

SMR trimmed recordingIn this way, one track is overlapping the intergaps of the previous track, the next is overlapping the intergaps of the current track and so on.

I have to say I am not fascinated from this SMR proposal, as it seems deeply wrong and overcomplicating things. As SMR proposes 30% increase in space, I am not eager to have it on any of my hard drives, until it proves trustworthy. Why? Because I can see at least a hundred differentsituations in which it will fail. And I think it will fail so badly, that it will make the data on the drive unrecoverable. I love my data, so I will just wait and see if I am right or wait until they improve it to a point, where I will feel comfortable using it. Utilizing the intergap space was always a tempting idea, yet until now – too unsafe to be done for common solutions. And I don`t think that you will replace your 1TB hard drive, which is perfectly stable and reliable for 1.3TB drive which has 10% bigger chance, for example, to screw something up and loose your data…

Getting back on sector dissection – what does a sector consists of?

Well, if you think you are loosing space only from gaps – bad news. The hard drive actually has a lot more space occupied by some other things, which actually make it run.

Sector dissection

Sector dissection – Header, DAta, Trailer

Leaving the gaps aside, each sector consists of header, data adn trailer. Now what actually happens is that in the header you have information about the sector itself – so that when it is being read by the magnetic head, a check can be done. Something like the firmware says “Give me sector 983″, the magnetic head recieves CHS coordinates, reads it, and checks if the header of the sector says “I am sector 983″. If everything is correct, then voilla – you have succeded in fetching this sector. If not, this triggers an error procedures and so on(retires, self diagnostics, etc.).

Now the trailer is a very important thing. It performs a self checking of the sector. It is being executed everytime the sector has been read, written or so on. If the check doesn`t turn to be okay, then it replies that this sector is damaged or unreadable, meaning something bad has happened, and the data on this sector cannot be verified if it is correct or just a random stuff of magnetic impulses. Sad, sad.

And as you can see, only the data itself is what you actually need and want. Now you can better understand what si the difference between a 512 byte sector drive and 4096 byte sector drive.

If you have a lot of sectors, you will have a lot of gaps between them. Also you will have a lot of headers and trailers. So one way to reduce them is to make a drive with biggersectors. Then you will have less gaps and less headers/trailers:

Comprehation of 4096 byte sector versus 8x512 byte sectors

Comprehation of 4096 byte sector versus 8×512 byte sectors(same in size, different in density filling of a hard drive)

And you can see illustrated on the picture, that a 4096 bytes can take up different space on a platter of a hard drive, depending if it is designed into a 512 bytes per sector or 4096 bytes per sector. So for bigger sectors, a space from gaps, headers and trailers is being saved and can be put to use. You may wonder why aren`t we using 4096 byte sector drives as default, but this is something we will discuss later over various file systems. All you need to know now is that a big sector size is not always good performance choise and may have negative capacity impact depending on what type of data is being stored.