XFS has a particularly strong reputation for reliability and led to the creation of the venerable xfstests Linux kernel test suite which now tests regressions in various filesystems.
File systems --->
<*> XFS filesystem support
File systems --->
[*] XFS Quota support
[*] XFS POSIX ACL support
[*] XFS Realtime subvolume support
[ ] XFS Verbose Warnings
[ ] XFS Debugging support
[ ] XFS online metadata check support
[ ] XFS online metadata check usage data collection
[ ] XFS online metadata repair support
Thepackage is needed for XFS userspace utilities:
emerge --ask sys-fs/xfsprogs
Mount XFS filesystems with the mount command.
XFS supports SSD discards in /etc/fstab.
Make an XFS filesystem with mkfs.xfs from xfsprogs:
mkfs.xfs -L 'label'
xfs_spaceman can be used to display information about the space available and to run a report on the health of a filesystem.
xfs_spaceman -c info /path/to/mountpoint
It is not possible to change the parameters of a mounted filesystem
The parameters of an XFS filesystem can be changed using xfs_admin. For the full list of options, view the manpage:
xfs_admin -L 'label' /dev/sda1
Expanding a filesystem
The filesystem must be mounted to be grown
To grow an XFS filesystem to N amount, use xfs_growfs.
xfs_growfs -D N /path/to/mountpoint
-d argument results in it being expanded to the max size
To suspend access to a filesystem, use the xfs_freeze command.
xfs_freeze -f /path/to/mountpoint
|Checks a filesystem for corruption
|Creates a new filesystem
|Changes the parameters of a filesystem
|Prints block mapping for an XFS file
|Copies contents of a filesystem to one or more targets in parallel
|Estimate the amount of space a directory would consume if it were copied to an XFS filesystem
|Used to debug an XFS filesystem
|Suspends access to a filesystem
|Improves organization of mounted filesystems, compacting or improving the layout of extents
|Increases a filesystem's size
|Equivalent to invoking xfs_growfs but does not change any aspects about the filesystem
|Used for debugging, like xfs_db but for regular file paths than raw volumes
|Prints the log of an XFS filesystem
|Restores an XFS metadump image to a filesystem image
|Copies filesystem metadata to a file
|Creates an XFS file (padded by zeroes by default)
|Generates pathnames from inode numbers
|Used for reporting and editing different aspects of filesystem quotas
|Repairs corrupted or damaged XFS filesystems
|Copies a file to a real-time partition
|Checks and repairs contents of a mounted filesystem
|Scrubs all mounted XFS filesystems
|Reports and controls free space usage
Year 2038 timestamp support (bigtime)
Older partitions (created with <xfsprogs-5.15) will not have bigtime enabled by default. Mounting such partitions results in a warning like:
... [ 4.036258] xfs filesystem being mounted at /home supports timestamps until 2038 (0x7fffffff) ...
To check the current version of xfsprogs, run mkfs.xfs -V. There's no need for this on up-to-date Gentoo systems, but it might be necessary if using install media from another distribution with older userland.
The bigtime code support was enabled by default in xfsprogs 5.15, so manual setting is not required in newer versions.
To upgrade an older filesystem to
bigtime, first cleanly unmount the file system. The upgrade will refuse to run if the unmount was not completely clean.
xfs_admin -O bigtime=1 /dev/sda1
Replacing /dev/sda1 with the device path.
XFS on the root mount will require an initramfs or other live environment with the necessary tools to perform an upgrade to the metadata.
Using Dracut initramfs to perform the upgrade
First, Dracut needs additional files included in the initramfs in order to perform the upgrade. This can be accomplished with either the
--install option or inside a configuration file using the
dracut --install "/usr/sbin/xfs_admin /usr/bin/expr" ...
Then, the kernel command line option can be modified to include
rd.break=pre-mount to stop the initramfs just before it would mount the root filesystem. Ensure this is done temporarily and removed on subsequent reboots after upgrade.
To schedule removal at the next run:
emerge --ask --depclean --verbose sys-fs/xfsprogs
- Deduplication — uses the clone mechanism of a copy-on-write or CoW capable filesystem, a feature that allows to share data of copied but identical files
- FAT — filesystem originally created for use with MS-DOS (and later pre-NT Microsoft Windows).
- Ext4 — an open source disk filesystem and most recent version of the extended series of filesystems.
- Btrfs — a copy-on-write (CoW) filesystem for Linux aimed at implementing advanced features while focusing on fault tolerance, self-healing properties, and easy administration.