heavily fragmented file system.. How to defrag it on-line??

Andreas Dilger adilger at clusterfs.com
Thu Mar 4 03:06:16 UTC 2004

On Mar 03, 2004  18:36 -0800, Guolin Cheng wrote:
>  Then How can I figure out whether the files are defragmented? Because the
> file system's read/write speed is greatly slow down ( about 8-10 times
> slower in extreme cases). 

I think there was a tool which would map your files for you, using the FIBMAP
ioctl, but you could also use debugfs "stat" to tell you the block maps of
particular files.

>  Can you suggest a tool|package to report file systems' defragment
> percentage? I tried a beta version oodcmd tool which reports both block
> defragment percentage and inode defragment percentage, are those enough?
> or there are still more defragment characteristics? I'm a little
> hesitate to use the commercial oodcmd tool since it can only work when
> file systems are unmounted and idle.. sigh..

If you have times when filesystem is nearly empty, moving files to a temp
partition and moving back would defragment.  Not quite "online" but avoids
need to unmount/reformat.  Sorry, nothing better at this time.

Andrew Morton had once implemented a simple "move block" ioctl while live,
but it was never included into the kernel (could be used by a defragmenter).

Cheers, Andreas
Andreas Dilger

More information about the Ext3-users mailing list