quotacheck Command

Purpose

Checks file system quota consistency.

Syntax

quotacheck [ -d ] [ -g ] [ -u ] [ -v ] { -a | Filesystem ... }

Description

The quotacheck command examines a file system specified by the FileSystem parameter, builds a table of current disk usage, and compares the information in the table to that recorded in the file system's disk quota files. If any inconsistencies are detected, the quota files are updated. By default, both user and group quotas are checked.

The optional -g flag specifies that only group quotas are checked. The optional -u flag specifies that only user quotas are checked. Specifying both -g and -u flags is equivalent to the default behavior which checks both user and group quotas. The -a flag specifies that all file systems in the /etc/filesystem file with disk quotas enabled are checked.

For both JFS and JFS2 file systems, the optional -d flag deletes Usage statistics for any user or group ID that does not exist in /etc/passwd or /etc/group, and which has no allocation in the file system. The affected users or groups will no longer have statistics displayed by the repquota command.

The quotacheck command normally operates silently. If the -v flag is specified, the quotacheck command reports discrepancies between the calculated and recorded disk quotas.

For JFS, the quotacheck command determines the quota file names from the /etc/filesystems file (by default, the files are named quota.user and quota.group and are located at the root of the file system); for JFS2, the names and location of these files are predetermined and cannot be changed. If these files do not exist, the quotacheck command creates them.
Note: Do not run the quotacheck command against an active file system. If the file system has any current activity, running quotacheck may result in incorrect disk usage information.

Flags

Item Description
-a Checks all file systems with disk quotas enabled in /etc/filesystems.
-d Deletes Usage statistics for undefined IDs with no allocation (both JFS and JFS2).
-g Checks group quotas only.
-u Checks user quotas only.
-v Reports discrepancies between the calculated and recorded disk quotas.

Security

Access Control: Only a user with root user authority can execute this command.

Attention RBAC users and Trusted AIX® users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

Examples

  1. To check the user and group quotas in the /usr file system, type:
    quotacheck /usr
  2. To check only the group quotas in the /usr file system, type:
    quotacheck -g /usr

Files

Item Description
quota.usr Specifies user quotas.
quota.group Specifies group quotas.
/etc/filesystems Contains file system names and locations.
/etc/group Contains basic group attributes.
/etc/passwd Contains user names.