Installation guide

Reporting on Disk Quotas
99
15.2.2. Reporting on Disk Quotas
Creating a disk usage report entails running the repquota utility. For example, the command
repquota /home produces this output:
*** Report for user quotas on device /dev/mapper/VolGroup00-LogVol02
Block grace time: 7days; Inode grace time: 7days
Block limits File limits
User used soft hard grace used soft hard grace
----------------------------------------------------------------------
root -- 36 0 0 4 0 0
kristin -- 540 0 0 125 0 0
testuser -- 440400 500000 550000 37418 0 0
To view the disk usage report for all (option -a) quota-enabled file systems, use the command:
repquota -a
While the report is easy to read, a few points should be explained. The -- displayed after each user
is a quick way to determine whether the block or inode limits have been exceeded. If either soft limit is
exceeded, a + appears in place of the corresponding -; the first - represents the block limit, and the
second represents the inode limit.
The grace columns are normally blank. If a soft limit has been exceeded, the column contains a
time specification equal to the amount of time remaining on the grace period. If the grace period has
expired, none appears in its place.
15.2.3. Keeping Quotas Accurate
Whenever a file system is not unmounted cleanly (due to a system crash, for example), it is necessary
to run quotacheck. However, quotacheck can be run on a regular basis, even if the system has not
crashed. Safe methods for periodically running quotacheck include:
Ensuring quotacheck runs on next reboot
Best method for most systems
This method works best for (busy) multiuser systems which are periodically rebooted.
As root, place a shell script into the /etc/cron.daily/ or /etc/cron.weekly/ directory—or
schedule one using the crontab -e command—that contains the touch /forcequotacheck
command. This creates an empty forcequotacheck file in the root directory, which the system
init script looks for at boot time. If it is found, the init script runs quotacheck. Afterward, the init
script removes the /forcequotacheck file; thus, scheduling this file to be created periodically
with cron ensures that quotacheck is run during the next reboot.
For more information about cron, refer to man cron.
Running quotacheck in single user mode
An alternative way to safely run quotacheck is to (re-)boot the system into single-user mode to
prevent the possibility of data corruption in quota files and run the following commands:
quotaoff -vaug /file_system
quotacheck -vaug /file_system