Disk fragmentation and the Mac OS X
I've been asked this question several times recently, by Windows converts who are accustomed to defragging Windows XP drives as part of their optimization routine. My recollection from maintaining BSD for my long departed but not forgotten TIS Gauntlet Firewall on BSD lead me to conclude, "this is a BSD based system and I don't recall having to do this manually, ever, so I doubt there's value to defragging a Mac OS X partition". My instincts tell me, "this is a Mac, the nightmare stories about defragging are part of pop culture, so it's safe to assume it's not the sort of detail Apple might overlook in distinguishing Macs from PCs".
If you surf the net, you'll find a variety of claims ranging from "yes do it regularly" to "Oh my God never do this you'll screw up everything!". The truth lies between these extremes. The canonical word can be found at About disk optimization with Mac OS X.
Briefly, the support page says in most cases, defragging a drive is unnecessary. The reasons cited supporting this claim run the gamut from trite to practical to clever. The trite answer is that hard drives are very large today. Among the practical answers you'll learn that applications take advantage of the faster hard drives and better caching and simply rewrite an entire file each time rather appending data to existing files at the first convenient free space discovered. The clever answers include a delayed allocation modle for Mac OS X Extended-formatted volumes to allow "a number of small allocations to be combined into a single large allocation in one area of the disk."
The Support page does in fact lend credence to the claim " "Oh my God never do this you'll screw up everything!" It seems that Mac OS X defines what Apple calls "hot band items", a set of files that Apple writes together so that Macs can offer that zippy system startup user experience that always astonish Windows users. Defragmenting might move one of these files and this would add delay to startup.
The conclusion? Few circumstances warrant defragmenting Mac OS X.
Archived at http://www.securityskeptic.com/arc20081001.htm#BlogID706
by Dave Piscitello