Manual Pages
Table of Contents
quota - control filer disk quotas
quota [ on | off | resize ]
quota report [ path ]
quota qtree [ name ]
A quota limits the amount of disk space and the number of
files that a particular user or group can consume. A quota
can also restrict the total space and files used in a quota
subtree, or the usage of a user or group within a quota subtree.
A request that would cause a user or group to exceed
one of these limits fails with a ``disk quota exceeded''
error; a request that would cause the number of blocks or
files in a quota subtree to exceed one of that subtree's
limits fails with an ``out of disk space'' error. User or
group quotas do not apply to the root user; tree quotas,
however, do apply even to root.
The quota command controls quotas, and /etc/quotas describes
the quotas to impose. Here is a sample /etc/quotas:
# Quota Target type disk files
# ------------- ----- ---- -----
mhoward user 500M 50K
lfine user 500M
stooges group 750M 75K
/export tree 750M 75K
mhoward user@export 50M 5K
stooges group@export 100M 10K
* user 100M 10K
* group 500M 70K
* user@export 20M 2K
* group@export 200M 20K
-
_FI_FI_
The first non-comment line in the file restricts the user
mhoward to 500 megabytes of disk space and 50 thousand files
over the entire file system. The second line restricts the
user lfine to 500 megabytes of disk space but places no restriction
on the number of files he can have - if the file
limit is left blank, no limit is imposed. The next two
lines restrict the stooges group and the /export subtree to
750 megabytes and 75 thousand files each.
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
would put a quota on the user who owns /home/user/mhoward.
The paths are relative to the root of the filer's file system.
Current versions of the filer software do not have
this limitation.
Quotas of type tree can only be applied to "quota trees",
which are directories created in / using 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 /export and then we restrict
the user mhoward to 50 megabytes and 5,120 files under the
/export tree. Similarly, the group stooges has been limited
to 100 megabytes of disk space and 10,240 files under the
/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 /export tree only if his
total disk usage throughout the file system does not exceed
500 megabytes, his usage within the /export tree does not
exceed 50 megabytes, and the space already in use in the
/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.
With no arguments, quota indicates whether quotas are on or
off.
- quota on
- activates quotas based on the contents of
/etc/quotas. 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
- turns quotas off.
quota resize adjusts currently active quotas 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. 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.
- quota report
- prints the current file and space consumption
for each user or group with a quota and for
each quota tree. With a path argument, quota
report displays information about all quotas
that apply to the file.
quota qtree name
creates a new quota tree named /name. The
maximum number of quota trees is 254. A
quota tree is similar to a partition in that
files inside of a quota tree cannot be moved
outside of it, and vice versa. A quota tree
is more flexible than a partition because the
quota that restricts its size can be changed
at any time. Quota trees can only be created
in /. A newly created quota tree has no file
or size limit. To impose a quota, update
/etc/quotas and run quota off followed by
quota on. With no argument, quota qtree
lists all existing quota trees. To delete a
quota tree, simply remove it from the file
system.
- /etc/quotas
- quota configuration file
na_rc(5), na_rquotad(8)
If /etc/quotas is incorrectly formatted, or if a specified
file doesn't exist, then quota on prints a warning and does
not turn quotas on.
Quotas do not count space consumed by snapshots. Doing so
could put users into a state where they couldn't create any
new files until all snapshots containing their old files
expired, which could take a week or more. That seems like a
worse bug.
It is possible for a quota to exceed its limit if files were
created before quotas were turned on or during quota initialization.
Table of Contents