On 10/23/07, Steve Costaras <stevecs@chaven.com> wrote:
Yes, I use the filefrag tool from Theodor Tso' (ext2/3) which works on pretty much any filesystem under linux.   That defrag tool you mentioned would work as well (it's just copying files) I don't like how it doesn't check for file integrity though.  
 
Here's a fast one I through together ages ago which works to some extent (no pun intended. ;)  )   I never got it to take a command-line argument as to which directory / mount point to start on (it just runs from the current directory on down).    But that's easy to change (must have been interrupted).    Anyway do with it what you will.  :)

What is the the best way to write a file with respect to fragmentation? I guess that its best that the filesystem knows the final size in advance, so that it can allocate it in as few extents as possilbe.

//Simon