quota report [ path ]
quota qtree [ name ]
User and group quotas do not apply to the root user; tree quotas, however, do apply even to root.
The quota command controls quotas, and the file /etc/quotas describes the quotas to impose. All quotas are established on a per-volume basis. If a volume name is not specified in an entry of the /etc/quotas file, the entry applies to the root volume. Here is a sample /etc/quotas:
# Quota Target type disk files # ------------- ----- ---- ----- mhoward user 500M 50K lfine user@/vol/home 500M stooges group@/vol/root 750M 75K /vol/root/export tree 750M 75K mhoward user@/vol/export 50M 5K stooges group@/vol/export 100M 10K * user@/vol/home 100M 10K * group@/vol/root 500M 70K * user@/vol/root/export 20M 2K * group@/vol/root/export 200M 20K
Users and groups may be specified by:
a user or group name, which must appear in the password or group database (either in the /etc/passwd or /etc/group file on the filer, or in the password or group NIS map if NIS is enabled on the filer and is being used for the password or group database);
a numerical user or group ID;
the pathname of a file owned by that user or group.
Earlier versions of the filer software were unable to map user and group names to user and group IDs (UIDs and GIDs); instead, lines in the /etc/quotas file could only specify the pathname of a file owned by the appropriate user or group. For example, a line such as
/home/user/mhoward user 500M 50K
The user or group identifier for a user or group quota can be followed by an @/vol/volume string, which specifies the volume to which the quota applies. If the string is omitted, the quota applies to the root volume.
A quotas of type tree can only be applied to a ``quota tree,'' which is a directory in a specified volume created with the quota qtree command described below.
User and group quotas can be created inside a quota tree, so that the user's or group's use of space or files within that quota tree is restricted. This is done by specifying the type as user@tree or group@tree where tree is the name of the quota tree. In the example above, we first limit overall usage in the quota tree /vol/root/export and then we restrict the user mhoward to 50 megabytes and 5,120 files under the /vol/root/export tree. Similarly, the group stooges has been limited to 100 megabytes of disk space and 10,240 files under the /vol/root/export tree.
In any operation that creates files or writes to them, all applicable quotas must be satisfied. For example, the user mhoward can write to a file in the /vol/root/export tree only if his total disk usage throughout the root volume does not exceed 500 megabytes, his usage within the /vol/root/export tree does not exceed 50 megabytes, and the space already in use in the /vol/root/export tree does not exceed 750 megabytes.
The * symbol is special and it specifies a default user or a group quota depending on the type. Any user or group that is not specifically mentioned in the /etc/quotas file is subject to the limits of the default user or group. Default user or group quotas can be specified on a per quota tree basis also.
Disk and file size limits in the third and fourth columns of /etc/quotas can end in ``K'', ``M'', or ``G''. ``K'' indicates kilobytes (or kilofiles), that is, it multiplies the limit by 1,024. Similarly, ``M'' denotes megabytes (or megafiles) and ``G'' denotes gigabytes (or gigafiles). The default for the disk limit is kilobytes.
quota on volume activates quotas in the specified volume based on the contents of /etc/quotas. The volume name may be omitted if the system has only one volume. Changing /etc/quotas has no effect until the next time quota on or quota resize is executed. The filer remembers whether quotas are on or off even after a reboot, so quota on should not be added to /etc/rc. When quotas are first turned on, the filer scans the file system to determine current file and space usage for each user and group with a quota. This may take several minutes during which quotas are not in effect, although the file system is still accessible. Executing quota with no arguments during this period indicates that quotas are initializing and reports how much of the initialization process has completed.
quota off volume turns quotas off on the specified volume. The volume name may be omitted if the system has only one volume.
quota resize volume
adjusts currently active quotas in the
specified volume to reflect changes in the
/etc/quotas file. For instance, if you
edit an entry in /etc/quotas to increase a
user's quota, quota resize will cause the
change to take effect. The volume name
may be omitted if the system has only one
volume. quota resize can be used only
when quotas are already on. Because it
does not rescan the file system to compute
usage, quota resize is faster than turning
quotas off and then on again. quota
resize will apply all updated entries in
/etc/quotas; however, it will generally
ignore newly added entries. A newly added
entry will only take effect if the
corresponding user or group has an active
quota as a result of updating a file subject
to default quotas.
It is possible for a quota to exceed its limit if files were created before quotas were turned on or during quota initialization.