xfs_fsr
xfs.org
- Free plan
- Linux
What xfs_fsr is
xfs_fsr is a free Linux utility in the xfsprogs project for reorganizing mounted XFS filesystems. It improves file extent layout one file at a time by copying a file to a temporary location and atomically exchanging the data extents of the original and copy. With no arguments, it selects files with the most extents and attempts to defragment the top 10% on each pass. A default run can last up to two hours and records where it stopped so work can resume later. You can target named filesystems or individual files; it makes one pass through each target.
The filesystem must be mounted read-write. xfs_fsr skips files mapped in memory and files marked no-defrag. Reorganization needs enough free disk space to copy the target, with space less fragmented than the original; quota-enabled systems also need sufficient remaining file space quota for the owner. The manual says system partitions generally do not need the utility and warns that moving bootloader files can make a system unbootable unless lilo is rerun before reboot. Bug reports are directed to the linux-xfs mailing list.
Who it suits
xfs_fsr is for Linux users who need to reorganize files on mounted XFS filesystems. It is suited to targets with adequate free disk space and, where quotas apply, enough remaining file space quota.
Good to know, and what to watch
- Free utility for mounted XFS filesystems
- Can target individual files or named filesystems
- Default runs record a stopping point for resumption
- Selects highly fragmented files when run without arguments
- Applies only to XFS filesystems
- Targets must be mounted read-write
- Needs free space to copy each target file
- Does not operate on files mapped in memory
Plans
Every plan and pricexfs_fsr
Free plan
The verdict
xfs_fsr provides a targeted way to reorganize files on mounted XFS filesystems, with resumable default runs. Check mount mode, disk space, quota availability, and bootloader implications before choosing targets.
What the maker publishes
- Access requirement
- The filesystem must be mounted read-write; entries without the rw option are skipped. source
- Disk space requirement
- Reorganization requires enough free disk space to copy the target file, with space less fragmented than the original file. source
- How it works
- It copies a file to a temporary location and atomically interchanges the data extents of the original and temporary files. source
- Mapped files
- It does not operate on files that are currently mapped in memory. source
- No-defrag flag
- Files marked no-defrag are skipped, and the flag can be set or cleared with xfs_io's chattr command. source
- Operational caution
- The manual says system partitions generally do not need xfs_fsr and cautions that moving bootloader files can make a system unbootable unless lilo is rerun before reboot. source
- Project and support
- The manual identifies xfs_fsr as part of the xfsprogs project and directs bug reports to the linux-xfs mailing list. source
- Purpose
- xfs_fsr reorganizes mounted XFS filesystems by improving the layout of file extents one file at a time. source
- Quota requirement
- On systems using quotas, the file owner must have enough remaining file space quota for the copy. source
- Selection
- With no arguments, it selects files with the largest numbers of extents and attempts to defragment the top 10% on each pass. source
- Targeting
- It can be run on named filesystems or individual files, making one pass through each specified target. source
- Time limit
- The default run lasts up to two hours and records where it stopped so it can resume later. source
Checked against the maker's pages on 4 Oct 2026.