iDefrag: Should You Defrag Your Mac’s Hard Drive?

When you own a PC, you need to pay attention to things like defragmenting your hard-drives, installing and updating antivirus, antivandal and firewall software. If you switch to a Mac, you need worry a lot less about such things. I’m not saying you should be complacent, but things generally just work much more easily and straightforwardly.

Your Mac has built-in maintenance routines that run periodically, and – for the most part – you will have a simpler computing experience that requires you to spend much less time under the hood tweaking things.

If you’ve made the switch from a PC, one thing that you might find yourself wondering about is defragmenting your hard-drive. Today we’re delving into that topic, and taking a look at iDefrag. After the jump, I’ll walk you through the app, and conclude with some reflections on whether or not you need it.

The Defrag Dilemma

Most PC users know that it’s a good idea to defrag your PC’s drive every few months. It used to be, back in the early days of Windows, that using the built-in defragging software took several hours to process even the smallest disk. How many times did I sit, despairing, as the process began all over again because, in my impatience, I had tried to do something else before the defragging had finished?!)

Newcomers to the Mac platform might wonder whether they need to, and how they can, defragment their new machine’s hard-drives.

The answer that you will find in most places is ‘No, you don’t need to do this.’ But now and then you’ll come across guidance on how to do it if you really want to, even within Apple’s own support material.

iDefrag has been around for a little while, and back in March, Coriolis Systems released a major update of the app, iDefrag 2.

Getting Going

You can download a trial version of iDefrag from the developer’s site. This demo is severely limited in what it can actually do, but at least you will be able to take a look at the app. Once you’ve downloaded and installed it, this is what you will see:

Launching iDefrag

Launching iDefrag

A list of available volumes in the left panel, and a warning on the right that you can’t make any changes until you have entered your Administrator password.

Click on the lock icon to authenticate, and iDefrag will then start scanning your drive, filling up the right-hand panel with a visualisation of your drive’s contents:

Your Visualised Drive

Your Visualised Drive

You’ll note from the the linear graphic at the bottom of that panel that my drive currently looks in pretty good shape, all the files compacted into a more or less contiguous block. The screenshot above is taken after a full defrag – here’s what it looked like before:

Before a Defrag

Before a Defrag

Apparently, my files have been shifted about a whole lot during the defrag process, and the blocks of fragmented files visible here have all been sorted out – so, theoretically, my system should now run a bit more quickly. I’ll come back to assessing whether this is the case in my conclusions.

To get started, you need to select which of the five available defragmentation Algorithms is to be used. You choose from the pulldown menu in the toolbar, selecting from: Compact, Metadata, Optimize, Quick (on-line), or Full Defrag.

Remember: you’re working with your data at a pretty deep level in this process – files that are currently split across different locations on your drive are going to be moved about.

Things can go wrong. Power cuts happen, for one thing. Your files could get borked. And so it’s very important that you make a full backup of your information. Bad things happen, so do the best you can to insulate yourself from those things, and run a Time Machine backup right now – better yet, do that, and also make a SuperDuper! or Carbon Copy Cloner image of your hard-drive.

iDefrag in Action

If it’s your Startup volume you’re defragmenting, your Mac will need to restart in order to complete all but the Quick (on-line) algorithm.

Requesting a Restart

Requesting a Restart

The differences between these algorithms are explained in the Quick Start Guide that is accessible from iDefrag’s Help menu.

In brief, a Full Defrag is the most straightforward path to follow: it combines the Metadata and Optimize algorithms. The Quick Start Guide more or less discourages using the Metadata or Optimize algorithms separately, though they are available from the menu.

For further information about these options, the Guide refers you to the Help menu, which explains that the Metadata algorithm ‘Focuses on the volume metadata and the adaptive hot file clustering system’, and the Optimize algorithm ‘Runs iDefrag’s disk optimization algorithm, which rearranges files on the disk under the control of the selected class set.’

Maybe that means more to you than it does to me? Knowing that the Full Defrag combines the benefits of these two algorithms, I’ve been happy to choose it and allow iDefrag to get on with its work. No doubt, a more technically savvy person might want to think through these options in more depth, and will be pleased that iDefrag allows you some more granular control of your defragmentation job.

There’s not actually anything much to see while iDefrag is working – and anyway, because the app boots your machine into a special mode, it’s not possible to take screenshots of the process in operation.

A Quick (on-line) defragmentation looks much the same as the screenshots above, except that you’ll see bits and pieces of files being moved and re-written as it works through your drive.

Additional Features

iDefrag monitors your drive temperature (on drives that have these sensors, as most modern Macs do), and will take steps to protect the drive if it starts to overheat – pausing until it cools enough for the process to safely continue. This is a reassuring feature – it’s nice to know your drive is not going to go into meltdown!

OS X apparently places files that are most frequently used into a special area of your hard drive, known as the Hot Zone. iDefrag works with the operating system and knows which files need to be placed here.

You could, if you chose, use iDefrag to defragment a Time Machine backup – I’m not sure what the point of this would be, but if you want to do so, iDefrag can help.

So, Defragment or Not?

I’m inclined to accept Apple’s guidance and conclude that there’s not really a need to defragment my Macbook’s drive. But I probably will continue to do so anyway – not often, but maybe three or four times per year. Running a Full Defragmentation does seem to have made things a little snappier – not as much as I know reinstalling OS X would do, but on the whole apps and documents do seem to open more quickly.

What I want to come back to is the need to take very good care of your data. Backup, backup, backup. I had some problems with Disk Permissions the first time I ran a Full Defragmentation, and iDefrag froze on me (I left it running at bedtime, and in the morning it was frozen about three quarters of the way through).

This time I used Disk Utility to Repair Permissions before running iDefrag, and the process ran to completion, and the machine turned itself off with no problems.

Returning to my opening paragraphs comparing PCs and Macs: yes, your Mac should just work, but it’s worthwhile giving it some help every now and then by making sure that it’s running the built-in maintenance scripts.

There are several apps available that will help you do this (Cocktail and Onyx are two of the best known). Or you can simply open the Terminal and type: ‘sudo periodic daily weekly monthly’ followed by Return, enter your Administrator password, and OS X will take care of things for you. If your Mac is left on all the time, then the operating system will run these processes automatically in the early hours of the morning.

I know very well that this topic is likely to be controversial. There will be people who know a lot more than me about how OS X accesses your machine’s hard drives who will have strong opinions. I hope you will voice these in the comments!


iDefrag is a powerful, customizable, disk optimization tool. It provides a wealth of options for defragmenting your hard drive, and might speed up the performance of your Mac.