Wednesday, February 8, 2012

HDD Defragmentation - How it works and Why it works!

Many of us have come across the term "De Fragment your Hard for increased speed" or  "you have to De Frag your drive to keep it fast" and even "A full drive makes your computer slower" (a fuller drive worsens fragmentation)

SO WHY DOES IT WORK? - Think about Tetris!... sorta
Our hard drives are Spacious big entities where we dump our Operating system, data, pictures videos and other personal files, each file has a certain size, data is written onto the hard drive in blocks of information, small files take 1 or few blocks, while big and larger file take much many blocks, Have you ever played TETRIS? well, your computer plays Tetris too every time it saves files!
Each color represents a file, new big files will be split inside 
those empty spaces! Fragmentation in a nutshell!
 You know how difficult tetris can be, and even on later stages, where the pieces (files) are coming at you (hard drive) at a fast rate, and you want to properly lay them down nicely and leave no gaps, and you reach a point where you cant place down any more pieces, lucky our hard drive can split (fragment) files and separate the pieces into blocks putting them down into the remaining gaps. until there are no more spaces left (a full drive), to make matters even worse, if you delete a file, the space is available for more files or blocks, further fragmenting the drive.

How fragmentation affects computer speed - Mechanical drive head moves all over the place!
We are still bound to the use of mechanical hard drives, where a metal platter is segmented in tracks and each track has little spaces to save information, and these discs spin, and while they are spinning a mechanical head glides over , switching from track to track, and reading data as needed.

 In a perfect world, our files are laid down on the drive in sequential order, such that the heads just glide from one side to the other as we boot into our system and as we load our programs, never having to switch back to a previous track.

The reality is that each second that passes our computer is reading and writing onto the hard drive, System logs, internet cache, Documents, save game files, we also load programs and personal files in complete random order, and create and delete documents at any given time, and if our hard drive tried to keep up and play a perfect Tetris game with our habits, its mind would explode!...

It would take so much work and time to have the hard drive re-arrange files on the go in sequential order, it is much faster to just write down information as it comes, wherever the heads are positioned at the moment on the hard drive, if the file its big, it gets laid down sequentially as possible, small files just get bunched up together, Think of tetris again, dropping the pieces from left to right as they come, trying to fit  as many as you can leaving gaps!

SO HOW DOES IT WORK - Tetris Cheatmode
Well, since our mechanical drives do fragment over time as we create delete and modify files, its clear we have sometimes to stop and force our drive to Re arrange files, to avoid delays due to the heads looking all over the platters for blocks of information, most programs  put smaller and or most read files near the outer faster tracks of the drive, and try to put bigger or heavily modified files near the slower center tracks, IMAGINE if you could do this in tetris!

De-Fragmentation in a nutshell!

So there you go, i know i skipped a lot of technical info, because in reality it is much more complex than a simple game of tetris, but i hope the somewhat simplified analogy did the trick!  a good nice defrag comes well right after a deep clean out of your system, uninstalling  unused programs, or deleting files we no longer use, it may or not give you a big boost, but its always nice to know things are  organized within our hard drives :O

Also take note, that since Solid State Hard Drives do not have mechanical moving parts, they store data in cells that DO NOT NEED to be defragmented, they work in a different manner, where data is available to be copied instantly, if you actually tried to defragment a SSD drive, you would just be wearing down the cells with the uneeded rewrites!

 Take good care of yourselves  and see you next time, int he mean time enjoy some public domain tetris! at TETRISFRIENDS :D

Goodnight and see you next time =)


  1. One of the most important tasks when taking care of our computers and many people are oblivious on the who to do it!

  2. It's not that easy to explain complicated problems in a simple way. Great post man:) I'm defragmenting my hard drive every month

  3. I defragment my HDD often and I notice difference in my laptop's performance. Great post!

  4. I really loved that comparison with Tetris, very good!

  5. I never quite understood how defragmentation worked up to today. Nice job comparing it to Tetris, it's much clearer now :D

  6. Informative Post.. Most of people defragment the HDD without know what it means!