Defragmenting Your Hard Drives
What is Fragmentation and why is it a problem?
In a nutshell, fragmentation is when files on your hard drive are broken up into seperate parts and stored in different areas on your hard drive. The same applies when files are deleted, leaving free space between other files still on the hard drives and also when files are stored (seemingly inexplicably) in the middle of free space areas, rather than in amongst the rest of the files on the hard drive. In all of these scenarios, the hard drive needs to perform more time consuming mechanical actions across different parts of the hard drive just to read a single file or load a single program. The end result being a slower PC.
The main purpose of defragmentation is to minimise the hard drive’s mechanical activity. This is achieved by putting all of the files close together on the fastest part of the drive, with each file being in one piece. A good defragmentation program will also organise files according to how frequently they are used. When a hard drive is regularly defragmented, each subsequent defragmentation will take less time than the last time because most of the data has already been defragmented. Over the long term this means the hard drive will perform much less mechanical activity than a drive that is defragmented rarely or not at all. In my opinion, these facts easily put to rest the common belief misconception that defragmentation wears hard drives out faster.
Hard Drive Performance
To understand how to defragmenting works, it’s important to have a basic understanding of how a hard drive works: Think of the hard drive as being like a vinyl record player. It’s got a delicate needle|head fixed to an arm and starts reading from the outside of the record|platter towards the centre. Per revolution, the needle|head can read more music|data on the outside of the record|platter than it can on the inside. Also, the faster the record|platter is spinning, the faster it can read the music|data. One other factor with hard drives is that most of them have multiple platters (stacked vertically) – however the heads are usually fixed to the same actuator, meaning they can’t move independently…
So basically it’s best to have all the data on the outside (the start) of the platter at the outside of the hard drive platter(s), where it’s at it’s fastest, and then works it’s way inwards. The inner part of the platter can get down to about half the speed of the outer parts of the disk. Obviously a smaller capacity hard drive will be forced to push data further towards the slower centre of the platter than a larger capacity drive will, although the performance drop isn’t usually noticeable until the drive exceeds ~50% capacity.
There’s a lot more to it than that, but I’ll leave it there and let you check out this excellent guide over at Red Hat, or find more comprehensive details over at The StorageReview.
Locked Files and Offline Defragmentation
When Windows loads up it locks a bunch of core system files to make sure they can’t be altered while Windows is in use. File Systems (eg. NTFS and FAT32) also lock their records stored on all of the files on the hard drive. In particular, NTFS (the file system usually used by Windows XP/Vista) maintains a Master File Table, which is essentially a record of all files on your hard drive and where all their fragments are. It serves a few other purposes, but that’s another story. What’s important is the fact that a heavily fragmented MFT can easily be just as detrimental to drive performance as heavy fragmentation of the actual files can be.
Because all of this data is locked, defragmentation programs can’t touch it while Windows is in operation (when it is “online”). The way around this is to wait until the drive is “offline” and then move them. The way defragmentation programs manage this is to schedule an “offline defrag” the next time Windows loads. This is known as a “boot-time defrag”.
None of the free defragmentation programs can perform “offline” defragmentation. A handful of programs can perform partial offline defrag functions, such as defragmenting paging files (eg: SysInternals PageDefrag).
Defragmentation Programs
There are many programs out there, each claiming to be better than the others. So what’s the difference?
Many of the free programs use the in-built Windows defragmenting interface, basically just making it easier to manage defragmenting tasks that Windows is already capable of but into a more user-friendly and aesthetically pleasing interface. Some of them add their own defragmentation algorithms that arrange files on the hard drive more sensibly. Ultimately they still suffer the same limitations as the Windows defragmentation interface.
An increasing number of professional (paid) programs are now starting to incorporate the ability to do offline defragmentation . Often this ability goes hand in hand with the ability to optimise the location of all files according to how frequently they are used. Both of these capabilies together yield the best performance results. A warning though – not all programs can do this efficiently.
I’m biased towards software manufacturers who specialise in their field. They tend to provide a more reliable and better performing product than manufacturers who try to put a finger in many different pies. I’m also skeptical of bold claims like “300% performance increase” or that “our product is faster than the rest“. It’s very rare that after a defrag, the PC will actually meets those sorts of claims. Secondly, the speed of defragmentation ultimately boils down to how fast the hard drive can move files.
My personal recommendation is Raxco PerfectDisk. They’ve been at it for many years, constantly the subject of high praise among enthusiasts and professionals alike. Anyway, it’s your PC and your choice. Here’s a list of defragmentation programs that I endorse (they’re all recipients of high praise in tech circles):
Tips for Defragmenting
Before you defragment, it’s a good idea to clean out all of your temporary and cached files (ATF-Cleaner does a good enough job) and remove any large and unwanted files or programs. If you want to go one step further, you can purge your System Restore folders, but be sure to create a new restore point once you’ve done that. If you need info on how to do that, post a response here and I’ll give you instructions
If your defragmentation program will run in Safe Mode, do it that way. This means that many programs won’t be locked and the defragmentation program will be able to move them as it pleases.
Tags: defrag, defragmentation, FAT32, Metadata, MFT, NTFS, pagefile, performance