LinuxCommandLibrary

xfs_quota

Manage XFS filesystem disk quotas

SYNOPSIS

xfs_quota [ -x ] [ -p prog ] [ -c cmd ... ] [ path ... ]

Common subcommands (used with -c or interactively):
report [-ugp] [path ...]
limit [-ugp] bsoft bhard isoft ihard name ...
enable [-ugp] [path ...]
disable [-ugp] [path ...]
state [-ugp] [path ...]
project -s name [id] [path ...]

PARAMETERS

-x
    Enables expert mode, which is required for certain commands that modify quota settings, such as `enable`, `disable`, `limit`, and `project`.

-p prog
    Sets the program name to be used for prompts when operating in interactive mode.

-c cmd ...
    Executes the specified command(s) (cmd) and then exits. Multiple `-c` options can be used, and commands are executed sequentially.

path ...
    Specifies one or more mount points (or their paths) on which the quota operations should be performed. If omitted, operations typically apply to all mounted XFS filesystems with quotas enabled.

DESCRIPTION

xfs_quota is a powerful command-line utility designed for managing and querying quota information on XFS filesystems. It supports user, group, and project-based quotas, allowing administrators to control disk space and inode usage for individual users, groups, or defined projects. The command can be used in two primary modes: interactive mode, where users can issue multiple commands sequentially, or non-interactive mode, by executing specific commands directly via the -c option. It provides functionalities to report current quota usage, enable or disable quota enforcement, and set or modify hard and soft limits on disk blocks and inodes. Its comprehensive features make it an essential tool for system administrators maintaining XFS-based storage.

CAVEATS

For quota limits to be enforced, the XFS filesystem must be mounted with the `quota` option for user/group quotas or `pquota` for project quotas. Enabling or disabling quotas on a mounted filesystem requires the `-x` (expert) option and might necessitate remounting or even rebooting for full effect, especially on older kernels. Project quotas require careful setup and path association.

KEY SUBCOMMANDS

While `xfs_quota` can be run interactively, its most common usage involves specifying subcommands via the `-c` option. Here are some fundamental subcommands:

report: Displays current quota usage for users, groups, or projects. Offers various options for output format and scope.
limit: Sets soft and hard limits for disk blocks and inodes for specified users, groups, or projects. Requires expert mode (`-x`).
enable / disable: Activates or deactivates quota enforcement for user, group, or project quotas on a specified filesystem. Requires expert mode (`-x`).
state: Reports the current state (enabled or disabled) of user, group, and project quotas on a filesystem.
project: A comprehensive subcommand for managing project quota definitions, including associating paths with project IDs and setting up project hierarchies. Requires expert mode (`-x`).
df: Reports disk space usage and quota information in a format similar to `df`, but with quota details.

INTERACTIVE VS. NON-INTERACTIVE MODE

`xfs_quota` can be run in two modes:

Interactive Mode: Invoke `xfs_quota` without the `-c` option. This drops you into an interactive prompt where you can type multiple commands sequentially. This is useful for complex administration tasks involving several steps.
Non-Interactive Mode: Use the `-c` option followed by the command(s) you wish to execute. This is ideal for scripting or executing a single, specific quota operation without user intervention. Example: `xfs_quota -x -c 'limit -u bsoft 1G bhard 2G user1' /mnt/xfsdata`.

HISTORY

The XFS filesystem, and consequently its quota capabilities, were originally developed by Silicon Graphics, Inc. (SGI) in the early 1990s. It was integrated into the Linux kernel around 2001. `xfs_quota` is the dedicated tool for managing quotas on XFS filesystems, differentiating it from generic quota tools like `edquota` or `repquota` which are primarily for ext/ext3/ext4 filesystems. Its development has continued as part of the XFS tools suite, adapting to new kernel features and requirements.

SEE ALSO

quotacheck(8), quotaon(8), quotaoff(8), repquota(8), edquota(8), xfs_admin(8), xfs(5)

Copied to clipboard