For more information, see the "Disk Quota System Overview" in the System Management Guide and the edquota command.
Disk quotas may be assigned based on three parameters and can be modified with the edquota command. The three parameters are:
The disk quota system tracks user and group quotas in the quota.user and quota.group files. These files reside in the root directories of file systems that have quotas assigned. These files are created with the edquota and quotacheck commands and are readable with the quota commands.
Typically, quotas are only used for file systems that contain user home directories and files. It is recommended that disk quotas never be assigned for the /tmp file system.
A system administrator would consider implementing the disk quota system under the following conditions:
To set up the disk quota system, you must have root-user-level authority.
Here is an example stanza line that enables user quotas:
quota = userquota
In a file system that has both user and group quotas enabled, the entry might look similar to the following:
/home: dev = /dev/hd1 vol = "/home" mount = true check = true free = false vfs = jfs log = /dev/hd8 quota = userquota,groupquota options = rw
Here is a sample:
/home: dev = /dev/hd1 vol = "/home" mount = true check = true free = false vfs = jfs log = /dev/hd8 quota = userquota,groupquota userquota = /home/myquota groupquota = /home/myquota options = rw
User Quotas
edquota -u ( -p Proto-UserName ) UserName ..
Group Quotas
edquota -g ( -p Proto-GroupName ) GroupName ...
When -p is used with the -u flag, it duplicates the quotas established for a prototypical user for each specified user.
The edquota command creates and edits quotas. It creates a temporary file that contains each user's and group's current disk quotas. It determines the list of file systems with established quotas from the /etc/filesystems file.
The edquota command invokes the vi editor (or the editor specified by the EDITOR environment variable) on the temporary file, so that quotas can be added and modified.
The fields that are displayed in the temporary file are:
NOTE: A hard limit with a value of 1 indicates that no allocations are permitted. A soft limit with a value of 1, in conjunction with a hard limit with a value of 0, indicates that allocations are permitted only on a temporary basis.
More information on the edquota command can be found in the edquota man page or in the softcopy and hardcopy product documentation.
Here is a sample edquota command and editing session:
#edquota -u bill Quotas for user bill: /home: blocks in use: 16, limits (soft = 10, hard = 30) inodes in use: 4, limits (soft = 0, hard = 0)
Change User or Group Grace Period
edquota -t -u | -g-t changes the grace period during which quotas can be exceeded before a soft limit is imposed as a hard limit. The default value of the grace period is 1 week. When invoked with the -u flag, the grace period is set for all file systems with user quotas specified in the /etc/filesystems file. When invoked with the -g flag, the grace period is set for all file systems with group quotas specified in the /etc/filesystems file.
NOTE: If the grace period is changed and repquota shows that some users have already reached their old grace period - before the new grace period can take effect for these users - these users must reduce their quotas to below their soft limits to reset the old grace period. In the future if these users exceed their soft limits, the new grace period will be in effect.
Also, if another user (like root) exceeds the quotas of some other user, the grace period as reported by the requota command will show (none). The overlimit must be corrected by the user. Then when the quota limit is exceeded the next time, the grace period will be seen with the correct value.
quotaon [ -g -u -v ] { -a | FileSystem ... } quotaoff [ -g -u -v ] { -a | FileSystem ... }
The quotaon command enables disk quotas for one or more file systems specified by the FileSystem parameter. The specified file system must have an entry in the /etc/filesystems file and must be mounted. The quotaon command looks for the quota.user and quota.group default files in the root directory of the associated file system. These file names may be changed in the /etc/filesystems file.
By default, both user and group quotas are enabled. The related flags or options are:
-a | enables or disables all file systems that are read-write and have disk quotas, as indicated by the /etc/filesystems file. When used with the -g flag, it enables or disables only group quotas in the /etc/filesystems file; when used with the -u flag, it enables or disables only user quotas in the /etc/filesystems file. |
-g | specifies that only group quotas are enabled or disabled. |
-u | specifies that only user quotas are enabled or disabled. |
-v | prints a message for each file system in which quotas are turned on or off. |
Examples:
quotaon -u /home
quotaoff -v -a
WARNING: It is recommended that the specified file system not be active while the quotacheck command is running. Executing quotacheck on an active file system (that is, one in which users have open files) can result in corrupt or incorrect quota data. Run quotacheck only from single-user mode or from the /etc/rc file during boot up (as shown in subsequent discussion).
The quotacheck process can be automated during boot up with the following entries added near the end of the /etc/rc file (after execution of the fsck command but before the "multi-user initialization completed" message):
echo " Enabling file system quotas" /usr/sbin/quotacheck [-g -u -v] { -a | FileSystem...} /usr/sbin/quotaon [-g -u -v] { -a | FileSystem...}
The quotacheck command checks for file system consistency and has the following format and syntax:
quotacheck [-g -u -v] { -a | FileSystem ...}
By default, both user and group quotas are checked.
The flags are
-a | checks all file systems with disk quotas and read-write permissions indicated by the /etc/filesystems file. |
-g | checks group quotas only. |
-u | checks user quotas only. |
-v | reports discrepancies between the calculated and recorded disk quotas. |
Examples:
quotacheck /home
quotacheck -g /home
repquota [-v -g -u] { -a | FileSystem ...} -a specifies that quotas are printed for all file systems enabled. -g specifies that only group quotas are printed. -u specifies that only user quotas are printed. -v prints a header line before the summary of quotas for each file system.
Example:
To print a summary of user quotas in the /home file system, enter:
repquota -u /home
The system prints the following information:
Block limits File limit User used soft hard grace used soft hard grace root -- 16 0 0 2 0 0 lanczi -- 12 3000 5000 3 3600 4500 biff -- 8 20 40 2 30 39 bill -- 16 10 30 7days 4 11 30
Fixes for AIX can be downloaded via the Internet with the FixDist service. For assistance, contact your AIX support center.
Install the latest version of fileset bos.sysmgt.quota.
[ Doc Ref: 90605220314844 Publish Date: Spt. 05, 2000 4FAX Ref: 2929 ]