If you counted the number of computer troubleshooting web pages that start off with recommendations to defrag your hard drive regularly, well, you'd be counting for a long time.
I just tried a Google search for "Defrag regularly" and got 42,900 results. Of course some of them may have been recommending NOT defragging, but I'll bet most are enthusiastically in favor of it.
In fact, defragmenting may be a total waste of time. It's unlikely to be harmful (though it can be if interrupted by a sudden power failure), but it may actually accomplish nothing worth even the minor effort it takes to run it.
That's especially apt to be true for desktop computer users.
So why do we have all this possibly pointless advice?
It's probably because that in some situations, defragging may speed things up. Someone who uses several large databases (which will include some games, by the way), may benefit. Defragging may also be useful with older computers.
Understand that when I say "old", I mean very old, much older than any system you are likely to own. As an example of a system that is NOT old enough, I'm going to show you some disk fragmentation information from a computer my wife started using in 2006. It ran Windows XP and we never even looked at defragging it until 2008. The picture below shows the fragmentation state of that system then.
I'm going to be referring back to this throughout this article, so you might want to print that out - you can right-click on the image, open it in another tab or window and print it if you like.
Let's imagine a bookcase.
Wait, we don't need to imagine: I have a bookcase.
Let's say that bookcase represents my computer hard drive and the books are the programs and files that came with it. Yes, yes, it's a small hard drive and there aren't many programs. I said "represents", didn't I?
Of course the first thing I want to do is buy some more programs - I mean books. Because I am a strange person, I'm going to buy Linux and Unix books. You'd probably buy much more interesting books, but this is MY bookshelf, okay? You fill your bookshelf however you like.
So I have my new books and it is very nice that I'm able to fit them all together in one spot, because that makes it easier for me to find a particular Linux or Unix book when I want it.
Well, actually it's often hard for me to find the book I want, but it helps me to look it up on Amazon to see what color the cover it. That helps me find the book on the shelves a bit more quickly, but having similar books grouped together really does help.
Well, the shelf is filling up, isn't it? That's because, silly me, I keep buying more books.
Oh, there's a new Linux book I just bought. Unfortunately, I can't fit it in with the others. It will have to go up on the top shelf. That's not really where I want it, but it would be a pain to rearrange everything.
If only I had thought to delete - throw away - an old book before I bought this new one! If I had, there would have been some room right next to the the other Unix and Linux books and I could have snuck it in the newly empty space.
But I didn't. I deleted a book AFTER buying a new one. I now have plenty of room to put things where I want them, but to do that, I need to rearrange - defragment.
There. That wasn't so hard, and now I have my Unix and Linux books together again.
If these books represent files on your computers hard drive, things actually work a little differently. You do buy some whole books, but a lot of what you "buy" on a disk is just new chapters.
Consider your virus definition file. That's something you bought from your Anti-Virus vendor and it got put on the shelf just like one of those Linux books. Other "books" got put on top of it, just like I did here.
But next week, the Anti-Virus people have a new definitions to add to that file or perhaps a larger file to replace the old. Either way, the new file is bigger than the old one. It won't fit where the old one was. What should your computer do?
Your computer has three basic choices. It could delete the original book and then, because there isn't enough space in that part of the bookcase, it could go look for another place that is big enough to hold the new book. Ideally, that's what it should do.
But what if we really had filled the book case up and had thrown away some books from time to time and from here and there, but there was no one place big enough?
It could rearrange everything, shoving books around, moving them to make room. That's defragging, and it takes time, so it probably won't.
So instead, it puts PART of the "book" (the new virus file) in one empty slot and part in another. The file is now "fragmented" - if we want to read the whole thing, we need to go gather the parts and put them together.
That would take more time, right? That's why people recommend defragmenting your hard drive - to put the fragments together to make them easier to get at.
Sure sounds like it, doesn't it?
Well, not so fast.
First. let's think about the kinds of things most home computer users do.
You use your browser, right? That adds a lot of "books". Those are the "Temporary Internet files" that everybody tells you to clean up (delete) when your browser acts up.
If you regularly take photos, you may add those to your computer. If you run Windows, of course you have anti-virus files that get updated frequently. If you get email on your computer (not through your browser), you are constantly growing your Inbox file.
Another place is Windows Update. Those are the patch files that Microsoft wants you to download every now and then. Apple does the same thing. These aren't quite as frequent as your virus updates, but they are likely to get fragmented because of their size.
Look again at that picture of my wife's machine. I used a free utility called Contig to get that report. As I said, this was a system that had been running for two years and had never been defragged. What did Contig have to tell us?
Pretty much what I expected. The virus files are fragmented, so are a few pictures and the rest of it is Windows updates. She didn't use Outlook on this computer, so we don't see those. One of the files is Quickbooks data - that gets updated constantly.
By the way, Mark Russinovitch has other free tools. Another you might be interested in is "PageDefrag", which can defrag Registry files. Again, that's probably silly and unnecessary for most of us, but some people could benefit.
Two things to note: the fragmentation on her drive really isn't bad and secondly, the files that ARE fragmented are files that will quickly become fragmented again in normal activity. We can defrag, but these same files will just pop back a few days or a few weeks later.
One of the reasons for that is that she frequently runs low on disk space. Although that 25 GB drive was pretty good in 2006, it's not a large hard drive by today's standards. If you have a more modern machine, you might have 100 GB or more.
Why is that important? Do you remember that I said that if there was space on the "shelf", the computer could delete the old virus file and put it all in a new space big enough to hold it? Well, if you have a big hard drive and you have not used most of it, there probably IS space.
For example, I'm using a four year old MacBook right now. The free space, the space I am not using, is far larger than that old XP's machine 25 GB drive!
Just for that reason alone, my hard drive is far less likely to have to fragment any files.
Wouldn't you have thought that after 2 years of work that old XP machine would have been very fragmented? It was in constant use, browsing, photos, Windows updates.. why was it not highly fragmented?
One reason is that it used a decent file system (NTFS). As the Wikipedia article on fragmentation explains, NTFS is "designed to decrease the likelihood of fragmentation". So is the HFS+ file system used on my Mac. All modern file systems use smart positioning and some even defragment "on the fly". Given their improved brains and the large hard drives in modern systems, it has become much harder to get any significant fragmentation.
Windows XP does some helpful work when you aren't doing anything else, too.
There is another reason to move books or files around.
Those Unix and Linux books are probably the ones I need to access most frequently. It would make sense to put them in a convenient spot closer to me.
There are "convenient" places on hard drives too. The outer tracks of a hard disk can actually transfer data more quickly than the inner tracks. It therefore makes sense to put the most frequently used files on the outermost tracks. Disk defragmenters can do that, so that can give some boost.
For most of us, that would be very minor. If you were accessing a very large database frequently, it might make sense to have that put on the outer tracks. Few of us use large files like that on our home computers - even the virus definition files aren't all that large, so having files on the outer track won't help us much.
Mac OS X actually watches this for you as you use your computer and moves the things you use most to what it calls the "Hot Zone" - that's the outer tracks. It also automatically defrags files "on the fly" that need it when you try to access them. See "Do You Need to Defragment a Mac’s Hard Drive?" for more on that.
Most Mac users feel no need to defrag, but if you are the exception, there are tools like Coriolis System's iDefrag. They have a free demo that will not actually defrag, but it will show you what files are fragmented.
First rule of fragmentation: if you hardly ever USE a particular file, do you care that it is fragmented? No, you do not. For example, Windows Restore point files are fragmented. So what? I'm unlikely to ever need them, and if I do, does it matter that it takes an extra half second to read it? I don't think so.
Second rule: Files that do fragment (virus definitions, Quickbooks, Restore points and the like) are going to become fragmented again very quickly. You can keep defragging every day, but is that really how you want to spend your time?
Third rule: Some of the things that fragment (or cause other things to fragment) are temporary - like "Temporary Internet Files". A quick and easy way to fix that is to just delete them!
Fourth rule: Big hard drives protect against fragmentation. Keep your junk deleted and there will be space for the things you need.
Given all this, you probably do NOT need to worry about fragmentation. Mac OS X doesn't even include a defragmentation tool. You have one in Windows, but in truth, you may not really need it.
That's not to say that no one ever needs a defrag tool. Some people use their systems for different purposes and may have real need. They may even want to buy a third party tool rather than use the tools Microsoft provides. People who regularly access large files which change frequently may find the time spent on defragmentation to be worth their while.
But you and I and most people we know do not. Use a tool like "Contig" if you run Windows to see what really is fragmented. Remember the rule about "if you hardly ever use it" when looking at the report.
If you do decide to defrag, check again a few days later with Contig. Get an idea of how quickly your system typically gets fragmented. If you feel you need to to this regularly, there's no point in doing it more often than you need to (assuming you need to at all). You might also decide that it re-fragments so quickly that there is little to gain.
Also, try using the file(s) you defragged. Does it REALLY make a noticeable difference loading those files? Don't try it until you reboot, because they could be in cache, which makes them load fast anyway. Try it after rebooting - if you can't tell the difference, was it worth your time to do this?
In the case of my wife's old XP, defragging made no noticeable difference. I might have been able to measure some specific difference if I wanted to, but there was nothing noticeable in real use. Measuring the speed at which a large file can be copied is only meaningful if copying large files is what you do every day. That's the problem with many articles that praise the benefits of defragging: they measure results based on activities you don't actually do!
SOME people need to defragment. Most of us do not.
Got something to add? Send me email.
More Articles by Anthony Lawrence © 2012-12-03 Anthony Lawrence