Linux "xfs_fsr" Command Line Options and Examples
filesystem reorganizer for XFS

xfs_fsr is applicable only to XFS filesystems. xfs_fsr improves the organization of mounted filesystems. The reorganization algorithm operates on one file at a time, compacting or otherwise improving the layout of the file extents (contiguous blocks of file data).


Usage:

xfs_fsr [-vdg] [-t seconds] [-p passes] [-f leftoff] [-m mtab]
    xfs_fsr [-vdg] [xfsdev | file] ...
    xfs_fsr -V






Command Line Options:

-m
mtab Use this file for the list of filesystems to reorganize. The default is to use /etc/mtab.
xfs_fsr -m ...
-t
seconds How long to reorganize. The default is 7200 seconds (2 hours).
xfs_fsr -t ...
-p
passes Number of passes before terminating global re-org. The default is 10 passes.
xfs_fsr -p ...
-v
Verbose. Print cryptic information about each file being reorganized.
xfs_fsr -v ...
-d
Debug. Print even more cryptic information.
xfs_fsr -d ...
-g
Print to syslog (default if stdout not a tty).
xfs_fsr -g ...
-V
When invoked with no arguments xfs_fsr reorganizes all regular files in all mounted filesystems. xfs_fsrmakes many cycles over /etc/mtab each time making a single pass over each XFS filesystem. Each pass goesthrough and selects files that have the largest number of extents. It attempts to defragment the top 10% ofthese files on each pass.It runs for up to two hours after which it records the filesystem where it left off, so it can start there thenext time. This information is stored in the file /var/tmp/.fsrlast_xfs. If the information found here issomehow inconsistent or out of date it is ignored and reorganization starts at the beginning of the firstfilesystem found in /etc/mtab.xfs_fsr can be called with one or more arguments naming filesystems (block device name), and files to reorga‐nize. In this mode xfs_fsr does not read or write /var/tmp/.fsrlast_xfs nor does it run for a fixed timeinterval. It makes one pass through each specified regular file and all regular files in each specifiedfilesystem. A command line name referring to a symbolic link (except to a file system device), FIFO, or UNIXdomain socket generates a warning message, but is otherwise ignored. While traversing the filesystem thesetypes of files are silently skipped.FILES/etc/mtab contains default list of filesystems to reorganize./var/tmp/.fsrlast_xfsrecords the state where reorganization left off.
xfs_fsr -V ...