My Mac's got pretty slow. Do I need to defrag it?
So your Mac isn't performing as it used to and needs a speed boost. You think back to what you used to do on your old PC and remember disk defragging - that should have the same effect on Macs, right? After all, it made your old PC run a lot faster.
Sadly, that's not the case. Even though Windows has always had disk defragging software (even if it has been renamed to "Optimise Disk" in recent OS releases), Apple has never included defragging software in macOS.
"Why's that?" you may ask. Well, to put it simply, Macs don't typically experience the same fragmentation that Windows PCs are prone to.
In this article we show how to defrag a Mac, and explain the benefits and limitations of doing this. But before we go on to that, it's probably best to explain how data is written to a drive, why PCs need to be defragged, and why things are different for Macs. Read next: How to speed up a slow Mac
Why do we defrag?
Typically, hard drives, or HDDs, are fastest at the beginning (the outside edge) of the drive and slowest at the end (or inside) - as you might imagine. New data is usually written on the outside of the drive, slowly working its way in as other data is added.
The issue is that the data doesn't move back outwards to take any available space, so holes start to develop with lots of reads and writes. As well as this, things can get out of order, meaning the heads have to travel all over the drive to load files or programs, making the system slower on the whole.
Simply put, defragging a drive traditionally moves everything back in order and fills any holes that have appeared during its use. Read next: How to back up a Mac
When do Macs need to be defragged?
Macs don't generally need to be defragged. This is simply because the macOS file system was designed differently to Microsoft's, and it automatically defragments files on its own. The process is otherwise known as Hot File Adaptive Clustering (HFC).
That's not to say that a manual defrag is never needed; it's just rare. People (usually creatives) that have hundreds of films/audio/multimedia files larger than 1GB may need to defrag a Mac. The HDD also has to be pretty old to merit a defrag, as performance deteriorates over time.
How to defrag a Mac
In these rare cases where a defrag is needed, you'll need to use some third-party software.
We reviewed one suitable piece of software, iDefrag, seven years ago. iDefrag received a Macworld Editors' Choice award in our review, and we felt confident recommending it - but we can't comment on its development and effectiveness since then.
Coriolis Systems has assured us that it still offers the reboot and defrag feature, and since the launch of version 5.1.2 (we're up to 5.1.8 at time of writing) the software is unified across macOS and iOS; at one point you had to get version 5.0.1 for OS X 10.10 and 5.1.1 for OS X 10.11. You can download iDefrag here.
An alternative to iDefrag is Drive Genius 4, the software that Apple employees use at the Genius Bar. While it's more costly than iDefrag, coming in at $100, Drive Genius 4 comes with a tool that allows you to create a secondary drive so you can defrag & repair your main hard drive.
Don't worry, that's not all you get for $100 (around £64.55). It comes with a host of different features to free up space on your Mac and protect your HDD.
Why should never defrag a Mac's SSD
If you're using a newer Mac that comes with an SSD (solid state drive), there's no point in wasting your time defragging as they already have a built-in maintenance process called TRIM. In fact, it's actually dangerous to attempt to defrag a SSD, which can reduce its lifespan.
In any case, SSDs operate in a different way to a traditional HDD, allowing quicker access with fewer issues making them the preferred option for modern systems. Read next: What to do if your hard drive or SSD crashes and you have no backup
Alternatives to defragging
There are alternatives to defragging if you have issues with your Mac's general speed.
Repairing Disk Permissions
The most popular piece of advice that Mac users will give is to "Repair Disk Permissions" using Disk Utility, software that's baked directly into macOS and allows HDD management and repair. In reality, it only fixes file permissions that were installed as part of an Apple-originated installer package - so those that came pre-installed with your Mac and files downloaded from the Mac App Store.
We should add a further warning: Disk Utility will only help with disk permissions in OS X Yosemite and earlier. In OS X El Capitan and later, Apple insists that "system file permissions are automatically protected. It's no longer necessary to verify or repair permissions with Disk Utility."
Permissions control which users and system processes have access to certain files, with all permissions collected in "Bill of Materials" database files (.bom). During normal use, it's possible that some file permissions will change from what was originally set. When this happens, things generally go wrong - a program might give your user account read-only access to your home folder and restrict access to your files, for example.
People can often read this as something that a disk defrag could fix when in reality, all you need to do is repair your disk's permissions: a simple and risk-free process.
Read more: How do I fix Mac Permissions?
When you repair your permissions, your Mac looks at the .bom files and checks with the files on your system, making sure the permissions match. If they don't, the software will automatically change the file permissions so they match those originally set in the .bom files, hopefully fixing any issues that you had.
To repair your disk permissions, open Disk Utility (you can find this via Applications > Utilities), select your hard drive and, under the First Aid tab, click Verify Disk Permissions. The Disk Utility will then scan your Mac and highlight any permissions that are inconsistent with their related .bom files.
Once this process is finished, you can click Repair Disk Permissions to fix any issues with permissions - a process that shouldn't take more than a few minutes, depending on your Mac's general health.
General speed tips
If you're just looking to speed up your Mac, there are other alternatives to defragging. The easiest tip to a speedy Mac is to close apps that you aren't using - they're usually noticeable by a dot underneath their icon on your Dock. To quit an application you're not using, right-click the icon and click quit.
Targeting those pesky apps that start up when you turn your Mac on can also combat a sluggish system - if you don't need them, you can stop them from opening. Simply open your System Preferences, head to Users and Groups and select Login Items. From there you can see a list of all applications that open on startup and by deselecting them, you'll stop them from opening.
Another important tip is to try to leave at least 10 percent of your overall HDD space free to keep your Mac running smoothly. It needs free space to perform background actions. Make sure that once you've deleted your files, you empty the Recycling Bin, as no free space will be added until everything is permanently deleted.
If you're looking for software that can do all of those things for you and more, try iMobie's MacClean, which offers a limited free version which is available to download here.