xfs_fsr
defragments a file by copying it to a new temporary location and atomically swap the new (contiguous) file with the old one. This obviously means that it really need sufficient space to make the temporary copy (ie: at least as much free space as the file you are defragmenting).
From xfs_fsr
man page:
xfs_fsr improves the layout of extents for each file by copying the
entire file to a temporary location and then interchanging the data
extents of the target and temporary files in an atomic manner. This
method requires that enough free disk space be available to copy any
given file and that the space be less fragmented than the original
file. It also requires the owner of the file to have enough remaining
filespace quota to do the copy on systems running quotas. xfs_fsr
generates a warning message if space is not sufficient to improve the
target file.
Its -f
option enable you to specify the progress file location which, in turn, is used when restoring an interrupted defrag session. Again, from the man page:
-f leftoff
Use this file instead of /var/tmp/.fsrlast to read the state of where
to start and as the file to store the state of where reorganization
left off.