Do I need to defrag MacOSX filesystems?

Solution 1:

With the default file system JHFS+ or Mac OS Extended (journaled), recent versions of Mac OS X defragment some things automatically. However, if you use large files or have a very full disk you may benefit from defragmenting.

If large amounts of contiguous space are occupied by multiple swapfiles at /private/var/vm then restarting the System can temporarily free the space used by all but one of those files, and so possibly allow other types of file to be written — without fragmentation — in that space.

See "About disk optimization with Mac OS X"

iDefrag is one product listed in Apple database that also states it doesn't touch the "Hot Zone" which is an area of the disk used by OS X to optimize disk access. They have a demo version you could try.

Solution 2:

Adding to Glenn's answer, Amit Singh has done thorough testing and written a tool hfsdebug. In his results, he concludes:

Defragmentation on HFS+ volumes should not be necessary at all, or worthwhile, in most cases, because the system seems to do a very good job of avoiding/countering fragmentation.