But xfs_fsr sorts inodes by number of extents in order to optimise free
space. If you run the "find ..." on a badly fragmented file system, it
won't optimise much at all, since there won't be free chunks large
enough for big files. I tried to just copy one file and remove the
original in the file system mentioned, but it only got worse. Running
running xfs_fsr on the whole file system got it down to 0% file frag, 1
extent/file. So xfs_fsr on a whole file system is much more effective
than xfs_fsr on each file in the file system. Especially if the file
system is near full.
/Johan Andersson
On Mon, 2007-06-11 at 00:35 -0700, Chris Wedgwood wrote:
> On Mon, Jun 11, 2007 at 08:51:32AM +0200, Johan Andersson wrote:
>
> > So I run some tests. And as Chris pointed out, when running xfs_fsr
> > on a badly fragmented filesystem, it completely destroys the
> > locality of files.
>
> You can always do something like:
>
> find path/to/defrag/ -type f -print0 | xargs -r0 xfs_fsr -v
>
> and check /var/log/daemon.log (or whatever) for a progress report.
>
> This will of course only make one pass, so you might want to wrap it.
> But unless you're really low on space it's probably not useful to make
> many passes anyhow.
>
> You might always want the -d argument (not sure if the man page has
> this).
>
>
|