Controlling User Disk Space Usage
Quotas let system administrators control the size of UFS file systems by limiting the amount of disk space that individual users can acquire. Quotas are especially useful on file systems where user home directories reside.
After the quotas are in place, they can be changed to adjust the amount of disk space or number of inodes that users can consume. Additionally, quotas can be added or removed as system needs change. Also, quota status can be monitored.
Quota commands enable administrators to display information about quotas on a file system or search for users who have exceeded their quotas.
After you have set up and turned on disk and inode quotas, you can check for users who exceed their quotas. You can also check quota information for entire file systems by using the following commands
|quota||Displays the quotas and disk usage within a file system for individual users on which quotas have been activated|
|repquota||Displays the quotas and disk usage for all users on one or more file systems|
Generally, you do not see quota in use these days due to the cost of disk space continues to fall and in most cases, the sysadmin simply watches disck space to identify users who might be using more than their fair share.
On a large system with many users, however, disk quotas can be an effective way to control disk space usage.
The quot command
quot command to display how much disk space, in kilobytes, is being used by users. You do not need to implement disk quotas to use this command. The
quot command can only be run by root. The syntax for the
quot command is:
quot -options <file system>
The quot command has two options:
-a Reports on all mounted file systems
-f Includes the number of files
To display disk space being used by all users on all mounted file systems, type the following:
# quot -af /dev/rdsk/c0t0d0s0 (/): 68743 4370 root 162 18 lp 31 14 uucp 1 1 adm /dev/rdsk/c0t0d0s6 (/usr): 1270388 50748 root 1254 19 lp 766 15 uucp 10 3 bin 1 1 adm /dev/rdsk/c0t0d0s1 (/var): 63327 5232 root 208 9 adm 22 27 lp 16 17 uucp 4 4 daemon 4 8 nobody 2 2 smmsp 1 3 dsmith 1 1 bin /dev/rdsk/c0t0d0s5 (/opt): 2608 253 root 2 2 lp /dev/rdsk/c0t0d0s7 (/export/home): 212 131 root 68 56 mchurchi 58 39 dsmith 5 5 sharris 4 4 jhaynes 4 4 tpeters 2 2 tfarar
The columns of information displayed represent kilobytes used, number of files, and owner, respectively.
To display a count of the number of files and space owned by each user for a specific file system, enter
# quot -f /dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7: 212 131 root 68 56 mchurchi 58 39 dsmith 5 5 sharris 4 4 jhaynes 4 4 tpeters 2 2 tfarar