DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
[Next] [Previous] [Top] [Contents] [Index]

VxFS System Administrator's Guide

Quotas

Chapter 7


Introduction

The VERITAS File System supports BSD style user quotas. The quota system limits the use of two principal resources of a file system: files and data blocks. For each of these resources, users may be assigned quotas.

The following topics are covered in this chapter:

Quota Limits

Quota limits for individual users can be set up for file and data block usage on a file system. A user quota consists of limits for these resources. The following limits can be set for each resource:

An example of the use of soft limits is when the user needs to run applications that might generate large temporary files. In cases like these, quota limit violations may be allowed for a limited duration. However, if the user continuously exceeds the soft limit, no further allocations are allowed after the expiration of the time limit.

The system administrator is responsible for assigning hard and soft limits to the users, as well as setting associated time limits. Although file and data block limits can be set individually for each user, the time limits apply to the file system as a whole. Quota information associated with user IDs are stored in a quotas file, as described in Chapter 2, "Disk Layout."

Quotas File on VxFS

A quotas file (named quotas) must exist in the root directory of a file system for any of the quotas commands to work. This is a BSD quotas implementation requirement, and is also applicable to VxFS quotas. The quotas file in the root directory is referred to as the external quotas file. VxFS also maintains an internal quotas file for its internal use.

The quotas administration commands read and write the external quotas file to get or change usage limits. The internal quotas file is used to maintain counts of blocks and inodes used by each user. When quotas are turned on, the quota limits are copied from the external quotas file into the internal quotas file. While quotas are on, all the changes in the usage information as well as changes to quotas are registered in the internal quotas file. When quotas are turned off, the contents of the internal quotas file are flushed into the external quotas file so that all data is in sync between the two files.

Quota commands


Note: Most of the quotas commands in VxFS (as with ufs) are similar to BSD quotas commands. However, the quotacheck command is an exception--VxFS does not support an equivalent command. This is discussed in more detail in "quotacheck With VxFS."


In general, quota administration for VxFS is performed using commands similar to ufs quota commands. On SCO UnixWare, the available quota commands are ufs specific (that is, these commands work only on ufs file systems). For this reason, VxFS supports a similar set of commands that work only for VxFS file systems.

VxFS supports the following quota-related commands:

Besides these commands, the VxFS mount command supports a special mount option (-o quota), which can be used to turn on quotas at mount time.

For additional information on the quota commands, see the corresponding manual pages.

quotacheck With VxFS

The standard practice with most quota implementations is to mount all file systems and then run a quotacheck on each one. quotacheck reads all the inodes on disk and calculates the usage for each user. This can be costly, and because the file system is mounted, the usage can change while quotacheck is running.

VxFS does not support a quotacheck command. With VxFS, quotacheck is automatically performed (if necessary) at the time quotas are turned on. A quotacheck is necessary if the file system has changed with respect to the usage information as recorded in the internal quotas file. This only happens if the file system has been written with quotas turned off or if there has been structural damage to the file system that required a full fsck.

quotacheck reads information for each inode off the disk and rebuilds the internal quotas file. It is possible that while quotas were not on, quota limits were changed by the system administrator. These changes are stored in the external quotas file. As part of enabling quotas processing, quota limits are read from the external quotas file into the internal quotas file.

Using Quotas

To use the quotas functionality on a file system, quotas need to be turned on. Quotas can be turned on either at mount time or any time after a file system is mounted.


Note: Before turning on quotas, the root directory of the file system must contain a file owned by root, called quotas.


To turn on quotas for a VxFS file system, use the following commands:

	# quotaon mount_point
Quotas can also be turned on for a file system at mount time by giving an option to the mount command:

	# mount -F vxfs -o quota special mount_point
edquota is a quota editor. User quotas can be set up with the edquota command by the superuser:

	# edquota username
edquota creates a temporary file for the given user; this file contains on-disk quotas for each mounted VxFS file system that has a quotas file. It is not necessary that quotas be turned on for edquota to work. However, the quota limits will be applicable only after quotas are turned on for a given file system.

The soft and hard limits can be modified or assigned desired values. For any user, usage can never exceed the hard limit.

Time limits can be modified using the command:

	# edquota -t
Modified time limits apply to the entire file system and cannot be set selectively for each user.

The quota command can be used to view a user's disk quotas and usage on VxFS file systems:

	# quota -v username
This displays the user's quotas and disk usage on all mounted VxFS file systems where the quotas file exists.

To turn off quotas for a mounted file system, enter:

	# quotaoff mount_point

VxFS System Administrator's Guide
[Next] [Previous] [Top] [Contents] [Index]