Sunday, June 15, 2014

Why you should defragment your hard-disk

Have you ever asked your self what does the defragmenter really do? Does your defragmenter application tells you everything is all right with your hard-disk and you don't need to do the process at all? I like to maintain things to work on the optimum speed and  I hope I'll manage to explain you why you should do it never the less, if you haven't done it or if you think its not necessary.

When you are writing a file you are actually filling in the smallest unit for writing the file called a Sector, at least that's the name for Windows, for Linux I think its called a block.  And every sector is being placed in a Cluster. Every cluster can contain several sectors in a row. The number of this sectors in one cluster depends on the characteristics of a computer configuration.

Whenever we are filling the sectors, we always get the full size of a cluster even if the space of total number of sectors is less then the number of sectors in one cluster. For example, the file we are writing has 5 sectors and one cluster has size of 4 sectors, automatically it's been given a second cluster with another 4 sectors and the space that's left is being called an unused or slack space. Hopefully the next picture will explain this better.

However, when we are saving or writing a file on a hard-disk, the computer will always try to fill in a space in a cluster that is next in a row. If the cluster that should be next in a row is already taken with some other file's sectors then it will fill the ones that are not. A file filled in different clusters like these is being called fragmented file. Getting an unused space is kind of always there when writing or saving a file. Hopefully the next picture will explain this more precisely.

Now when files are being written or saved as shown in previous picture, the "head" or the arm of the hard-disk needs a lot more time to position in order to read the file it needs and therefore the average time to access, reading the file is drastically increased. This is the reason why the defragmentation is needed to be run once in a while in order to sort out files on hard-disk and eliminate fragmentation.

Personally, I do defragmentation once in a two months and it takes only 2-3 hours though this can depend of the size of your hard-disk and the amount of files you have. Probably this won't effect your performance in some drastic way, or maybe it will, but I hope I managed to explain main reason why you should do start defragment process once in a while, if nothing at least to release a bit of stress from your hard-disk and make it last longer.