Defragging on OS X... discussion and example

Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
There's a lot of debate, here and elsewhere on the web, over the value of using a defragger on OS X. While it is true that OS X does automatically defrag files that are 20 mb or smaller, it doesn't do so for larger files, nor in an “intelligent” or "optimized" manner for what it does defrag. Additionally, if you have a need to repartition your drive to accommodate Boot Camp or for some other use, your files may be spread out all over your drive, preventing you from getting an acceptable partition size. Apple's official stance is that defragging “may” not be necessary. Not everyone agrees entirely with Apple, as you can read about in more detail in this dissenting article with links to more in-depth discussions.

Personally, I can say that I have seen real measurable performance boosts in some situations from running a full defrag. In the most extreme example, an older Powerbook that was taking over 5 minutes to boot got restored to a saner 1 minute or so after all else failed and I ran a full defrag. Also, I had choppy streaming of some videos from my desktop's data drive to my Mac mini. Defragging solved that issue (that drive was very heavily fragmented.... around 65%!). Generally speaking, if you work with a lot of “big” files (video editing in particular), or do a lot of downloading of apps and media, then you likely can benefit from defragging.

One common way of dealing with the need to repartition is to use SuperDuper to clone the drive to a second drive, then clone it back over. I've not used it myself, but from what I understand (and I reserve the right to be corrected ;) ), while this does result in compacting the files, it doesn't actually defragment them. It also requires a second drive for this sole purpose, which may be a bit more of an investment than necessary. Personally, I have my own backup solutions via a Time Capsule and a RAID-mirrored pair of drives for my data. Yet another drive just to compact my boot drive would be overkill. This is where a defragger steps in.

One very common misperception of defraggers for OS X is that they can't compact the data all to the “front” of the drive to allow for partitioning a drive. That is wholly false. They can, but due to the various safeguards OS X has in place, it can't normally be done from the same volume you are booted from. The solution is to either make a bootable DVD with the defrag utility on it (iDefrag comes with a bootable DVD maker as a separate download); install OS X to an 8GB or larger flash drive and boot from that; attach the Mac that needs defragging to another Mac via firewire and boot in in target disk mode, then defrag from the other Mac; or dual-boot OS X on the same Mac. There are better solutions coming. There's a new version of iDefrag in beta testing that will let you do a full defrag from the volume you are booted in, while a newly released version of DiskTools Pro “appears” to do the same (I've not used it myself and may be mis-interpreting the article).

Attached is a combo of before/after screenshots of a defrag run I just did on my Macbook Pro. Normally I wouldn't have bothered for so low a fragmentation level, but I did so to demonstrate that iDefrag can indeed compact the data for the needs of Boot Camp.

Note how, if I had wanted to repartition that drive in half for Boot Camp, it wouldn't have been possible before defragging. Now it is. Also, I did some timing of my boot times before and after. Beforehand, it was taking about 45 seconds consistently to go from power-on to full desktop readiness. Afterwards... about 38 seconds consistently. And this is not a heavily used Mac... basically web surfing, some photo importing, and some basic desktop publishing work. It's reasonable to expect a more heavily-used Mac to see more drastic improvements.

Defrag.jpg
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top