quota.5 (2010 09)

q
quota(5) quota(5)
The dqblk64 data structure (defined in
<quota.h>), is used by the quotactl() system call (see quo-
tactl (2)) to get or set quota information for 64-bit filesystems. 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. Note that VxFS
3.5 will track usage in the dqb64_curblocks field only up to 2 TB.
struct dqblk64 contains the following members:
uint64_t dqb64_bhardlimit; /* maximum # of disk blocks +1 */
uint64_t dqb64_bsoftlimit; /* preferred limit on disk blocks */
uint64_t dqb64_curblocks; /* current block count */
uint64_t dqb64_fhardlimit; /* maximum # allocated files +1 */
uint64_t dqb64_fsoftlimit; /* preferred file limit */
uint64_t dqb64_curfiles; /* current # allocated files */
uint64_t dqb64_btimelimit; /* time limit for excessive block use */
uint64_t dqb64_ftimelimit; /* time limit for excessive files */
NETWORKING FEATURES
Quotas are not fully supported over NFS file systems. However, the
quota command is able to report
quota statistics on remote NFS file systems for which disk quotas are in effect, if the remote system pro-
vides the RPC
rquotad service (see rquotad (1M)).
rquotad is provided to allow reciprocal support to other systems.
EXAMPLES
Initial Setup
The kernel must be reconfigured to support disk quotas; see the System Administration manuals. Eligi-
ble file systems for disk quota enforcement are those with mount options
rw and quota, as described in
mount(1M) and fstab (4).
For each file system for which quotas are to be enabled, perform the following tasks:
1. Mount the file system.
2. Add
quota to the existing options list in /etc/fstab. For example, change the string
default for the root (/) entry to default,quota
. Once this is done, quotas will automati-
cally be enabled for all relevant file systems on system reboot.
3. Create the
quotas file in the mount directory of the file system. For example, for the
/mnt
file system, run the command
cpset /dev/null /mnt/quotas 600 root bin
4. Establish one or more prototype user quotas using the
edquota command (see edquota (1M)).
If you want a number of users on your system to have the same limits, use
edquota to set
those quotas for a prototype user; then use the
edquota -p command to replicate those lim-
its for that group of users.
5. Turn on the quotas on the file system using
quotaon. For example, run the command
/usr/sbin/quotaon /mnt
6. Run quotacheck (see quotacheck (1M)) on the file system to record the current usage statis-
tics.
Adding a New User
To add a new user to the quota system:
1. Use edquota to copy the quotas of an existing user.
2. Run
quotacheck.
Adding a New File System to an Established System
Repeat steps 1 through 5 above under "Initial Setup" for the new file system.
WARNINGS
The HP-UX default is to allow
chown(). This can interfere with the disk quota mechanism. Quotas can
be defeated if the chown command (see chown(1)) or the chown() system call (see chown(2)) is accessi-
ble to a user. The setprivgrp command (see setprivgrp (1M)) can be used to limit access to the
chown() system call so that only a specified group of users are permitted to use the chown command or
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010