One of the age-old solutions to fix a slow computer is to defragment its hard drive. This is easy enough to do: Simply run the defragmenter and wait for it to finish its job. Have you ever wondered, however, what defragmenting means exactly? It may sound like a complex procedure by its name, but it’s actually quite simple. Let’s take a look at how disks store data, and how they become fragmented in the first place.
How Hard Drives Store Data
One way to understand how a disk becomes fragmented is to imagine a man who’s in charge of filing reports within several filing cabinets. Whenever you, a worker at this office, need to file or take out a report, you go through him. While a hard worker, this man’s organisation method is very strange.
If he’s given a report, he’ll go through the drawers starting from A to L looking for an empty spot to put the report. If he finds a spot, he places the report into it. Otherwise, he puts it at the very end. When a report is removed, the gap it leaves behind stays there. The sorter doesn’t make any effort to “shunt up” reports to fill the gap – he just leaves the gap as it is.
For example: if he fills all the drawers from A to F, and then a 100-page report from C is removed, the 100-page gap will stay in C. Then, if the man receives another 100-page report to file, he’ll go through each drawer looking for a gap. He’ll find the 1oo-page gap in C which he fills snugly with the report he just received.
So far so good, right? However, imagine if we had a gap left in a drawer, and the man receives a report larger than the size of the gap. In the above example, picture if the man received a 200-page report rather than a 100-page one. In this case, in an attempt to fill the 100-page gap in C, he’ll split the report in two. He’ll put 100 pages into C, then the other 100 pages at the very end, assuming there are no more gaps. This means the report is now “fragmented” into two halves.
All it takes is for several small reports to be removed over a long period of time, and you find yourself in a real problem. After some time has passed, if you asked him to file a 250-page report, he may find a 50-page-sized gap in Cabinet B, then a 25-page gap in Cabinet C, then another 25-page gap in F, a 100-page gap in G, and a 50-page gap in K. To fill all the gaps, he splits the 250 pages amongst them. This means, when you ask him to get the report out, he has to go through Cabinet B, C, F, G, and K in order to get all the pieces of the report, which takes a lot of time to do. What a hassle!
What Defragmenting Does
It doesn’t take a genius to realise the man should take some time at the end of the week to sort the reports into consecutive order. By shuffling pages in and out of the main filing system, he can arrange the cabinets so that each report has their pages all together in the right order. That way, when you ask for a report, he doesn’t have to open several scattered drawers to get it, and it saves time as a result.
Of course, there’s no little man on your hard disk drive who fetches your data. The “man” in this example is the hard disk’s read head. If you save a large chunk of data (such as installing a 1GB piece of software), the hard drive will fragment it amongst the gaps it finds in the hard drive. When you go to load the software, it takes a long time for the hard drive’s head to move around the scattered parts of the platter to read all the data. By using a defragmenter, the hard drive shuffles and sorts the data around the platter so that all the data on the computer is in a consecutive order. This means the head doesn’t have to move around so much to read your data, and the loading process speeds up.
What About Solid State Drives?
Keen-eyed readers may realise this isn’t the case for solid state drives. SSDs don’t use spinning disk platters; they use flash memory like a USB drive would. Given there’s no disk, surely there’s no reason to defragment it. Right?
This was a hot topic a few years ago when SSDs were coming onto the market. The consensus was that SSDs didn’t have a spinning platter, so it didn’t need defragmenting. Not only that, but performing a defragmentation on the SSD would wear it down unnecessarily, shortening its lifespan. Sure enough, Jon L. Jacobi from PC World ran defraggers on his SSDs, and noted that they didn’t actually do anything worthy of note.
However, you shouldn’t be totally against disk defragmentation. Windows does its own SSD defragmentation once a month, but it isn’t the same kind that it performs on a HDD. Windows knows full well that your disk is an SSD, so it’ll perform special actions on it to make sure it’s kept healthy and runs for as long as possible. You can read Microsoft’s claim on their SSD defragmentation here. In short, don’t use third-party defragmenters on SSDs, but do allow Windows to perform maintenance on it.
Defragmenting a disk is a well-known way of getting a computer to act faster. However, it’s not self-explanatory as to what it actually does. Hopefully you now understand what defragmenting is, why it’s done, and its standing with SSDs.
Have you ever seen a huge performance boost after a defragment? Share your stories below.