VMware ESXi and vSphere Cluster Management

Enable User and Group Disk Quotas on Linux Filesystems

Learn how to enable Linux user and group disk quota accounting with /etc/fstab, remounting, quotacheck, verification, and troubleshooting.

A disk quota is a filesystem-level mechanism that tracks and optionally limits resource usage. Quotas can monitor or restrict both the number of bytes stored and the number of inodes used. An inode represents filesystem metadata for an object such as a file or directory, so an inode quota limits object count even when the objects are small.

User quotas associate accounting and limits with individual user IDs. Group quotas associate them with group IDs. Enabling quota accounting is not the same as assigning limits: accounting builds usage data, while later administration sets soft limits, hard limits, grace periods, or inode limits.

Quota support is configured per mounted filesystem. Enabling it for /data does not automatically enable it for every filesystem on the host.

Quota Enablement Workflow

StepGoalPrimary file or commandExpected result
Inspect the targetIdentify the device, mount point, and filesystem typefindmnt, lsblk, dfThe correct locally mounted filesystem is identified
Configure mount optionsAdd usrquota and/or grpquota/etc/fstabPersistent quota-capable mount configuration
Apply the configurationRemount or unmount and mount againmount, umountActive mount options include the requested quota options
Create accounting dataScan ownership and usagequotacheckQuota accounting data is created or refreshed
Verify and enforceConfirm accounting and optionally enable enforcementfindmnt, quota, repquota, quotaonQuota data is available and enforcement is active when required

Prerequisites and Safety Checks

Perform these steps as root or with sudo. Before editing persistent configuration, make a backup of /etc/fstab and validate every change carefully. An invalid entry can prevent a filesystem from mounting normally and may interfere with boot.

  • Identify the target block device or UUID, partition, mount point, and filesystem type.
  • Confirm that the filesystem is locally mounted rather than a remote filesystem such as NFS.
  • Confirm that the target filesystem has an entry in /etc/fstab if the configuration should persist across boots.
  • Preserve existing mount options; add quota options rather than replacing options that the system needs.
  • Plan maintenance before scanning or rebuilding quota data, especially on a busy production filesystem.
findmnt /data
findmnt -no SOURCE,FSTYPE,TARGET,OPTIONS /data
lsblk -f
 grep -E '^[^#].*[[:space:]]/data[[:space:]]' /etc/fstab

In the example above, remove the accidental leading space before grep if your shell treats it differently; the command itself is simply an inspection of the matching /etc/fstab entry.

Add Quota Mount Options in /etc/fstab

/etc/fstab is the persistent filesystem mount configuration read during boot and by commands such as mount -a. Its fields commonly contain the source device, mount point, filesystem type, mount options, dump setting, and filesystem-check order.

The traditional quota options are:

  • usrquota enables accounting for individual users.
  • grpquota enables accounting for groups.
  • Use both options when both user and group tracking are needed.
/dev/sdc1  /data  ext4  defaults,usrquota,grpquota  0  2

Here, the fourth field is the mount-option field. Replace /dev/sdc1, /data, and ext4 with the actual source, mount point, and filesystem type. A UUID is often preferable to a device name when the system already uses UUID-based entries.

UUID=replace-with-the-real-uuid  /data  ext4  defaults,usrquota,grpquota  0  2

Apply the Updated Mount Configuration

Changing /etc/fstab does not change the options of an already mounted filesystem. The filesystem must be remounted when the implementation supports that operation, or unmounted and mounted again.

Unmount and mount again

For the example filesystem, the explicit cycle is:

sudo umount /data
sudo mount /data

The second command uses the matching /etc/fstab entry. This approach is useful when the changed options need a complete mount operation. Do not unmount a filesystem casually if services or users depend on it.

Remount where appropriate

A remount reapplies mount settings to an already mounted filesystem. Whether quota options can be activated by remount depends on the filesystem and kernel support, so verify the result rather than assuming success.

sudo mount -o remount /data
findmnt -no TARGET,OPTIONS /data

If the expected options are absent, perform a planned unmount and mount cycle or consult the filesystem-specific procedure.

Create Quota Accounting Files with quotacheck

quotacheck scans current filesystem ownership and usage, then creates or refreshes quota accounting data. It does not, by itself, assign user or group limits.

Important quotacheck options

OptionPurposeTypical use
-cCreate fresh accounting filesInitial quota setup
-uCheck or create user quota dataUser accounting
-gCheck or create group quota dataGroup accounting
-aProcess all locally mounted filesystems configured for quotasHost-wide initialization after reviewing all eligible mounts

Initialize one filesystem

For both user and group accounting on /data:

sudo quotacheck -cug /data

For user accounting only, use -cu. For group accounting only, use -cg. Option behavior and recommended safety flags can vary between versions of the quota tools, so read the local manual with man quotacheck when necessary.

Initialize all eligible local filesystems

After reviewing the configured mounts, the combined command is:

sudo quotacheck -cuga

The -a option processes all locally mounted filesystems whose active configuration indicates quota support. Verify each filesystem separately: failure on one mount does not prove that every other mount failed.

With traditional quota formats, the resulting files commonly appear in the root of the quota-enabled filesystem:

ls -l /data/aquota.user /data/aquota.group

aquota.user stores traditional user accounting data, while aquota.group stores traditional group accounting data. File names and metadata storage differ with filesystem type and quota implementation, so their absence is not conclusive until the filesystem method has been identified.

Verification After Activation

First verify that the active mount, not merely /etc/fstab, contains the requested options.

findmnt -no TARGET,OPTIONS /data
mount | grep ' /data '
grep ' /data ' /proc/mounts

Look for usrquota, grpquota, or the filesystem-specific equivalent. If both types were configured, confirm that both are active.

Next inspect the accounting data when the legacy format applies:

ls -l /data/aquota.user /data/aquota.group

Quota reporting commands can confirm that accounting is available. Exact output and supported flags vary by distribution and filesystem:

sudo quota -v user_name
sudo repquota -aug
CheckCommand or locationSuccessful indication
Correct source and filesystemfindmnt /data, lsblk -fThe expected device, type, and mount point are shown
Active quota optionsfindmnt -no TARGET,OPTIONS /dataRequested quota options appear in active settings
Accounting files/data/aquota.user, /data/aquota.groupExpected legacy files exist when that format is used
Accounting reportquota or repquotaUsage data can be read without an unsupported-operation error
Enforcement statequotaon, distribution service, or filesystem-specific statusLimits are enforced when enforcement has been intentionally enabled

Accounting and enforcement are separate. Depending on the distribution and quota implementation, enforcement may require a service or an explicit command such as:

sudo quotaon -vug /data

Some systems enable quotas automatically during boot, while others use a different mechanism. Do not assume that creating accounting files has activated limits.

Operational Cautions

  • Quota files must not be modified or regenerated casually while the filesystem is actively changing. Run maintenance during a quiet period and use suitable access controls.
  • Stop or restrict workloads that write to the filesystem while quotacheck scans it, when the operating procedure requires a stable view.
  • Keep a backup of /etc/fstab before editing and check that the source, mount point, type, and options belong to the intended entry.
  • Do not force an unmount on production storage without assessing application impact and data-integrity risk.

Troubleshooting

umount reports that the target is busy

A shell may have its current directory inside the mount, or a service may have open files there. Locate users with appropriate tools:

sudo lsof +D /data
sudo fuser -vm /data

Move shells out of the directory, stop or relocate affected services, and retry during planned maintenance. If a clean unmount cannot be achieved during normal operation, use an appropriate single-user or rescue environment according to your operational procedures.

Quota options do not appear after editing /etc/fstab

  • The filesystem may not have been remounted.
  • The wrong fstab entry or mount point may have been edited.
  • The active mount may have come from another configuration source.

Validate the entry, remount or unmount and mount again, inspect the active options with findmnt, and check system logs for mount errors.

quotacheck does not create expected files

Confirm that quota options are active, that the command targets the intended filesystem, and that the correct -u and/or -g flags were supplied. If the filesystem uses a non-legacy quota format, its metadata may not be stored as aquota.user and aquota.group.

Quota commands report an unsupported operation

Check the filesystem type, kernel support, and installed quota utilities. The traditional usrquota/grpquota procedure may not match the filesystem's quota model. Use the method and tooling documented for that filesystem and Linux distribution.

What This Procedure Does Not Do

This procedure enables or initializes quota accounting. It does not decide which users or groups receive limits. After activation, use the appropriate quota administration tools to set user or group byte and inode limits, configure grace periods, and manage enforcement.

For a compact reference, return to the quota support procedure after identifying the filesystem-specific requirements.