Network Appliance(TM)

Manual Pages


Table of Contents

NAME

quota - control filer disk quotas

SYNOPSIS

quota [ on | off | resize ] [ volume ]

quota report [ path ]

quota qtree [ name ]

DESCRIPTION

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 users and groups within a quota subtree. A request that would cause a user or group to exceed an applicable quota 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 limit fails with an ``out of disk space'' error.

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

_FI_FI_

The first non-comment line in the file restricts the user mhoward to 500 megabytes of disk space and 51200 files in the root volume. The second line restricts the user lfine to 500 megabytes of disk space in the home volume, 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 /vol/root/export subtree to 750 megabytes and 76800 files each in the root volume.

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. Data ONTAP Release 4.1 and later do not have this limitation.

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.

USAGE

With no arguments, quota indicates whether quotas are on or off in each volume. The following list describes how to use the various quota commands:

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.

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. The maximum number of quota trees is 254. If name does not begin with a /, the /name quota tree is created in the root volume. Alternatively, if name begins with /vol/volume, the quota tree will be created in the root directory of the indicated volume. A quota tree is similar to a partition in that files inside 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 the root directory of a volume. 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 volume.

FILES

/etc/quotas
quota configuration file

SEE ALSO

na_rc(5), na_rquotad(8)

DIAGNOSTICS

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.

BUGS

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