[MacDV] Re: more about the inutility of defragmenting an OS X FS.

Peter van der Linden pvdl at afu.com
Wed Dec 31 09:23:40 PST 2003


On Dec 30, 2003, at 8:45 PM, James Asherman wrote:
>  There is a graphic map that shows that a significant portion of what 
> you might think is freee space is actually small useless holes in 
> otherwise crowded areas. and llarge tracts of frree space have iTunes 
> hanging around like muggers waiting for some video to screw up.
> Jim

Let me put this another way, Jim.
Your view on disk defragmenting (whatever that means in the context of 
HFS+, which already uses groups of allocation blocks called "clumps" to 
limit fragmentation at the sector level) relies on at least three false 
assumptions:

1.  The HD map shown by programs like is an accurate representation of 
disk sector layout on disk
2.  The disk controller places sectors at the addresses you give it, at 
the time you give them
3.  Adjacent sector addresses given to the disk controller represent 
adjacent physical addresses on disk

All three of these assumptions are false for today's disk drives.  To 
give a simple example, multi-platter disks break assumption 3.  
Read/write coalescing done by the disk controller (buffering and 
reordering disk commands) breaks assumption 2.   Flaw mapping (which 
long ago moved from the OS kernel into the disk controller) breaks 
assumptions 2 and 3.  Logical Block Addressing and the consequent 
geometry translation inside the controller breaks assumption 1.

As if that isn't enough, Panther automatically coalesces small and 
medium sized files (smaller than 20MB) on journalled HFS+ disks when 
they are opened.  Further, MacOSX caches file and directory data 
extensively.

The bottom line is this: there are multiple levels of translation 
within the kernel I/O subsystem, PROM, the disk controller, and the 
hard disk itself.  The cylinder/head/sector numbers that people are 
trying to optimize with defragmentation long ago stopped having any 
real relationship to the actual drive characteristics.  MacOS X 
software that does defragmentation is at worst a fraud (like the 
Syncronys "RAM doubler" of a few years ago) and at best an unnecessary 
holdover from the days of MacOS 9 and earlier.

Apple itself says, disk de-fragmentation is "probably not required if 
you use MacOS X"  and "there is little benefit to defragmenting."

So far no one claiming that defragmentation is useful has actually 
produced any data to support their position.  They just have "feelings" 
that they "know".  I invite anyone who believes that disk 
defragmentation does anything measurable to affect performance, to 
benchmark a program before and after defragmentation under MacOS 10.3 
and send me the data and results.  If I can reproduce results showing 
defragmentation is helpful I will gladly eat these words.  That won't 
happen because manual defragmenting does nothing measurably useful 
under MacOS X 10.3 on HFS+.

     Peter



More information about the MacDV mailing list