Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Managing Disks and Files
Managing File Systems
Chapter 6 621
• “What To Do When Exceeding a Hard Limit” on page 626
Using disk quotas allows the administrator to control disk space usage
by limiting the number of files users can create and the total number of
system blocks they can use.
You implement disk quotas on a local file system and its users by placing
soft limits and hard limits on users’ file system usage. Soft limits are
limits that can only be exceeded for a specified amount of time. A hard
limit can never be exceeded. If users fail to reduce usage below soft limits
before the specified time limit or reach a hard limit, they will be unable
to create files or increase the size of existing files.
Typically, you will set disk quotas on file systems that would otherwise
become full without limitations. For example, to prevent users from
using /tmp or /var/tmp as storage, set the soft limits small and the time
limits for remedial action short.
Because disk quota statistics reside in memory, using disk quotas rarely
impairs performance. However, the time required to reboot a crashed
system will take longer because of the time required to run
/usr/sbin/quotacheck whenever the system is booted.
You cannot use SAM to perform disk quota tasks.
Setting Up and Turning On Disk Quotas
Here are the main steps for setting up and turning on disk quotas:
Step 1. Mount the file system.
Suppose you want to implement quotas on /home, which is accessed via
the device file /dev/vg00/lvol3. This file system will be mounted
automatically at bootup if it is listed in your /etc/fstab file. If the file
system is not mounted, enter:
mount /dev/vg00/lvol3 /home
Step 2. Create a quotas file.
Use the cpset command to create an empty file named quotas within
the directory. This file will contain, in binary form, the limits and usage
statistics for each user to be limited in creating files within the file
system. For example, to install the quotas file for the mounted /home
file system, enter:
cpset /dev/null /home/quotas 600 root bin