quota.5 (2010 09)

q
quota(5) quota(5)
NAME
quota - disk quotas
DESCRIPTION
Disk quotas can be used by the system administrator to limit the number of files and file blocks owned by
a user or group on a per-file-system basis. Separate limits can be established for both the number of files
(inodes) and the number of 1 KB blocks for each user or group. A soft (preferred) and a hard limit are
established.
For example, user
joe_doe may have soft limits of 1000 blocks and 200 files and hard limits of 1200
blocks and 300 files on the root file system (
/) containing his/her HOME directory and /tmp, and soft and
hard block limits of 100 and 120, respectively, with no explicit file limit (0), on the mounted file system
/mnt.
A time limit is established for each file system which determines how long a user is allowed to exceed the
soft limit. The default time limit is one week (seven days).
When a user exceeds his/her soft limit, a warning is emitted on the users terminal. The user can con-
tinue to increase utilization over the soft limit until he/she either exceeds the hard limit or the esta-
blished time limit. Once either of these events occurs, a message is sent to the user’s terminal and further
attempts at file creation and/or increased block utilization will fail. At this point, the user must reduce
his/her use of the exceeded limit below the soft limit to restore normal operation.
At login time, users exceeding quota limits are reminded (via
login) of exceeded quotas and appropriate
remedial action. The user can check current quota status at any time with the quota command (see
quota (1)).
Quota limits and utilization statistics are maintained by the operating system for each file system for
which quotas have been enabled (see mount(1M) and quotaon (1M)).
Disk quotas are established independently for each user and each file system via the
edquota command
(see edquota (1M)). This command is also used to establish the limit for the amount of time users are per-
mitted to exceed their soft limit. The default time limit is one week.
Limits and usage statistics are stored statically in the file
quotas on the root of each file system for
which they are in effect. This file is synchronized with information in the kernel by the
quotactl()
system call (see quotactl (2)) and whenever an affected file system is unmounted.
Quotas can be enabled automatically at boot or mount time by adding the
quotas option to the option
list in
/etc/fstab (see fstab (4) and mount(1M)). By default, mount does not enable disk quotas.
Quotas can subsequently be disabled and re-enabled with the
quotaoff and quotaon commands (see
quotaon (1M)). When quotas are disabled, the kernel does not maintain usage statistics and the quotas
file usage statistics are invalidated by file system activity. Disabling quotas improves performance, but
necessitates running the quotacheck command (see quotacheck (1M)) to update the kernel and quotas
file after subsequently re-enabling quotas.
The
repquota command (see repquota (1M)) displays reports of current quota statistics. The somewhat
related, but independent, quot command (see quot(1M)), collects and reports disk utilization indepen-
dently of the disk quota subsystem.
The
mount command (see mount(1M)) reports any file systems for which quotas are enabled.
Data Storage Structure
The
dqblk data structure (defined in <quota.h>), is used by the quotactl() system call (see quo-
tactl (2)) to get or set quota information. This structure contains fields that are used to store a user’s
current file and block count and quota limits for a particular file system.
struct dqblk contains the following members:
uint32_t dqb_bhardlimit; /* maximum # of disk blocks +1 */
uint32_t dqb_bsoftlimit; /* preferred limit on disk blocks */
uint32_t dqb_curblocks; /* current block count */
uint32_t dqb_fhardlimit; /* maximum # allocated files +1 */
uint32_t dqb_fsoftlimit; /* preferred file limit */
uint32_t dqb_curfiles; /* current # allocated files */
uint32_t dqb_btimelimit; /* time limit for excessive block use */
uint32_t dqb_ftimelimit; /* time limit for excessive files */
HP-UX 11i Version 3: September 2010 1 Hewlett-Packard Company 1

Summary of content (4 pages)