![]() |
Why Defragment? |
It has often been asserted that defragmentation (or disk optimization) is not a good idea on systems using Apple’s HFS+ file system. The main reasons given for this historically have been:
HFS+ is very much better at keeping files defragmented than many other commodity file systems.
Advanced features in recent versions of HFS+ can easily be disrupted by a defragmentation tool that does not support them, resulting in decreased performance.
There is a risk associated with defragmentation.
Whilst these arguments are certainly valid, they are not the whole story. For one thing, iDefrag, unlike most other disk defragmentation tools, fully supports the most recent features of HFS+, namely the metadata zone (or “hot band”) and the adaptive hot file clustering support added in Mac OS X 10.3. Not only does it avoid disrupting them, but it is capable of fixing disruption caused by other software by moving files into or out of the metadata zone as appropriate.
Sensible arguments for occasional optimization of your disk include:
HFS+ is not very good at keeping free space contiguous, which can, in turn, lead to large files becoming very fragmented, and can also cause problems for the virtual memory subsystem on Mac OS X.
Older versions of the Mac OS are not themselves aware of the metadata zone policy, and may disrupt its performance.
HFS+ uses B-Tree index files to hold information about the file system. If a large number of files are placed on a disk, the file system may have to enlarge these B-Tree structures; however, there is no built-in mechanism to shrink them again once the files are deleted, so the space taken up by these files has been lost.
Whilst HFS+ is good at keeping individual files defragmented, mechanisms like Software Update may result in files that are components of the same piece of software being scattered across the disk, leading to increased start-up times, both for Mac OS X itself and for applications software. This is a form of fragmentation that is typically overlooked.
Defragmenting disk images can be helpful, particularly if they are to be placed onto a CD/DVD, as seeks on CD/DVD discs are particularly expensive.
Some specific usage patterns may cause fragmentation despite the features of HFS+ that are designed to avoid it.
We do not recommend very frequent optimization of your disk; optimizing a disk can take a substantial amount of time, particularly with larger disks, far outweighing the benefits that are likely to be obtained by (say) a weekly optimization regime.
Optimization may make more sense, however, following large software updates, or on an occasional basis if you notice decreased performance and lots of hard disk seeking on system start-up or when starting an application.