xfs_admin
Modify XFS filesystem parameters
SYNOPSIS
xfs_admin [options] device
xfs_admin -V
PARAMETERS
-L label
Sets or clears the filesystem label. The label can be up to 12 characters long. Use "" to clear an existing label.
-U uuid
Sets or generates a new filesystem UUID. A specific UUID can be provided, or "generate" can be used to create a new random one. Use "clear" to clear an existing UUID.
-R rtdev
Sets the real-time device for the filesystem. Used for files with real-time attributes. Use "" to clear.
-l logdev
Sets an external log device for the filesystem. Use "" to clear.
-F
Forces the operation to proceed, even if the filesystem is mounted or appears inconsistent. Use with extreme caution, as it can lead to data corruption.
-O feature=value
Sets or clears feature flags on the filesystem. Common features include ftype=0 (old directory format) or ftype=1 (new directory format with file type in dirent).
-p logproto
Changes the log protocol for the filesystem. This is typically used for specific internal optimizations or compatibility.
-Q
Queries and prints the log protocol version of the filesystem.
-V
Displays the version number of xfs_admin.
-i
Prints filesystem information, including UUID, label, and other relevant details, without modifying the filesystem.
DESCRIPTION
xfs_admin is a utility used to modify the administrative parameters of an XFS filesystem. It allows an administrator to change various attributes of an unmounted XFS filesystem, such as its universally unique identifier (UUID), label, and real-time device assignment. It can also be used to manage XFS filesystem features like changing the inode format (ftype) or enabling/disabling other optional features. This tool operates at a low level and should be used with caution, as incorrect usage can lead to data corruption or loss. It is primarily used for post-creation modifications or system migration tasks.
CAVEATS
xfs_admin should only be used on an unmounted XFS filesystem. Modifying a mounted filesystem can lead to severe data corruption and loss. Use the -F option with extreme caution, as it overrides safety checks and significantly increases the risk of damaging the filesystem. Always back up critical data before performing modifications with xfs_admin.
FILESYSTEM FEATURES (-O OPTION)
The -O option allows manipulation of specific XFS filesystem features. One common use case is changing the ftype feature, which determines the type of directory entries. Setting ftype=1 enables support for accurate file type reporting in directory entries, improving compatibility with tools like ls and other filesystems. This change is generally irreversible without reformatting the filesystem.
UUID AND LABEL MANAGEMENT
Changing the filesystem UUID or label with -U or -L can be crucial for system migrations or avoiding conflicts when cloning filesystems. It's important to update any entries in /etc/fstab or other boot configurations that refer to the filesystem by its old UUID or label after making such changes.
HISTORY
xfs_admin is part of the xfsprogs package, which contains various utilities for managing XFS filesystems. XFS itself was originally developed by Silicon Graphics (SGI) in the early 1990s and released as open-source in 2000. xfs_admin has been a fundamental tool within the xfsprogs suite, evolving alongside the XFS filesystem to support new features and administrative requirements over decades of development and usage in Linux and other Unix-like operating systems.