LinuxCommandLibrary

edquota

Edit user or group disk quotas

TLDR

Edit quota of the current user

$ edquota [[-u|--user]] $(whoami)
copy

Edit quota of a specific user
$ sudo edquota [[-u|--user]] [username]
copy

Edit quota for a group
$ sudo edquota [[-g|--group]] [group]
copy

Restrict operations to a given filesystem (by default edquota operates on all filesystems with quotas)
$ sudo edquota [[-f|--file-system]] [filesystem]
copy

Edit the default grace period
$ sudo edquota [[-t|--edit-period]]
copy

Duplicate a quota to other users
$ sudo edquota [[-p|--prototype]] [reference_user] [destination_user1 destination_user2 ...]
copy

SYNOPSIS

edquota [-u|-g|-r] [-F <fmt>] [-f <filesystem>] [-p <prototype>] names...
edquota [-u|-g|-r] [-F <fmt>] [-f <filesystem>] -t

PARAMETERS

-u
    Edit user quotas. This is the default behavior if no other type is specified.

-g
    Edit group quotas instead of user quotas.

-r
    Edit project quotas. This option is available in newer quota implementations.

-F <fmt>
    Specify the quota format to use. Common formats include vfsv0 and vfsv1.

-f <filesystem>
    Specify the filesystem(s) on which to edit quotas. If omitted, quotas are edited on all filesystems with quotas enabled.

-p <prototype>
    Duplicate the quota settings of a prototype user, group, or project to the specified names. This is useful for quickly applying standard quotas.

-t
    Edit the grace periods for soft limits. This option is used without specifying specific users or groups, as grace periods apply globally per filesystem for all users/groups.

names...
    One or more usernames, group names, or project names whose quotas are to be edited. When used with -t, this argument is omitted.

DESCRIPTION

The edquota command provides a convenient and interactive way for system administrators to manage disk quotas for users and groups on filesystems.

When invoked, edquota opens a temporary file in a text editor (determined by the EDITOR or VISUAL environment variable, defaulting to vi). This temporary file contains the current disk usage and quota limits (soft and hard limits for disk blocks and inodes) for the specified users or groups.

Administrators can then modify these limits directly within the editor. Upon saving and exiting the editor, edquota reads the modified file and applies the new quota settings to the filesystem. This interactive approach makes it ideal for one-off adjustments or for setting initial quotas for multiple entities simultaneously. It can also be used to set grace periods, which define how long a user or group can exceed their soft quota limit before it's enforced as a hard limit.

CAVEATS

edquota requires root privileges to execute.
Quota support must be enabled on the target filesystem(s) prior to using edquota.
Changes made in the editor are applied directly to the quota files upon saving and exiting, so care must be taken to avoid errors as incorrect entries can lead to data corruption or prevent quota enforcement.
If a new hard limit is set below the current usage, the user will immediately be in violation and unable to write more data until usage is reduced.

EDITOR SELECTION

The text editor used by edquota is determined by the EDITOR or VISUAL environment variables. If neither is set, edquota defaults to using vi. Administrators can specify their preferred editor (e.g., export EDITOR=nano) to use a different one.

QUOTA FILE CONTENT

When you edit quotas, edquota presents a temporary file with lines similar to this (for users):
Quotas for user username:
/dev/sda1: blocks in use: current_blocks, limits (soft / hard): soft_block_limit / hard_block_limit
inodes in use: current_inodes, limits (soft / hard): soft_inode_limit / hard_inode_limit

You only need to modify the numerical values for soft_block_limit, hard_block_limit, soft_inode_limit, and hard_inode_limit.

GRACE PERIODS

Grace periods define a temporary window during which users or groups can exceed their soft quota limit without immediate enforcement. Once this period expires, the soft limit effectively becomes a hard limit, preventing further writes until usage falls below the soft limit. When using -t, you'll edit values in units like 'days', 'hours', 'minutes', or 'seconds'.

HISTORY

The edquota command is a long-standing component of the Linux quota utilities, providing a human-friendly interface to manage disk quotas. It has been part of the standard Linux distribution for many years, evolving alongside filesystem quota capabilities such as the introduction of different quota formats (e.g., vfsv0, vfsv1) and support for project quotas. Its core design, which leverages a text editor for interactive configuration, has remained consistent, making it a reliable tool for administrators across various Linux versions.

SEE ALSO

quota(1), quotacheck(8), quotaon(8), quotaoff(8), repquota(8), setquota(8), warnquota(8)

Copied to clipboard