This script works best run from the top directory of each partition. It is braindead simple and filesystem agnostic. You need to run it on a mounted partition. It seems safe in my testing but comes with all the usual warnings! The maximum benefit seems to occur with two runs, and it seems to be effective only if the initial fragmentation is > 2.5%. Note if you use lilo as your loader and you defrag the partition containing your kernel you will need to rerun lilo before rebooting! Here is a sample of a /home partition containing 407564 files. Before and after running this script: Before: filesystem: ext3 mount status: mount fragmented percentage: 3.16% total blocks: 17194960 system blocks: 269928 file blocks: 9939228 fragmented blocks: 314289 sys-fragmented blocks: 44 continuous files: 411125 fragmented files: 43333 max dir depth: 15 After: filesystem: ext3 mount status: mount fragmented percentage: 1.59% total blocks: 17194960 system blocks: 269928 file blocks: 9885890 fragmented blocks: 157391 sys-fragmented blocks: 56 continuous files: 417985 fragmented files: 29727 max dir depth: 15 Best results I've had were on my compile directory: Before: filesystem: ext3 mount status: mount fragmented percentage: 8.93% total blocks: 11698552 file blocks: 290134 fragmented blocks: 25918 sys-fragmented blocks: 4 continuous files: 83754 fragmented files: 8155 max dir depth: 15 After: filesystem: ext3 mount status: mount fragmented percentage: 0.21% total blocks: 9267264 file blocks: 290134 fragmented blocks: 618 sys-fragmented blocks: 4 continuous files: 91623 fragmented files: 286 max dir depth: 15 Get tools to measure fragmentation of ext2/3 here: http://sourceforge.net/projects/davtools/ Con