5.9.7.2. Enabling Disk Quotas

Note

The following sections provide a brief overview of the steps necessary to enable disk quotas under Red Hat Enterprise Linux. For a more in-depth treatment of this subject, see the chapter on disk quotas in the System Administrators Guide.
To use disk quotas, you must first enable them. This process involves several steps:
  1. Modifying /etc/fstab
  2. Remounting the file system(s)
  3. Running quotacheck
  4. Assigning quotas
The /etc/fstab file controls the mounting of file systems under Red Hat Enterprise Linux. Because disk quotas are implemented on a per-file-system basis, there are two options -- usrquota and grpquota -- that must be added to that file to enable disk quotas.
The usrquota option enables user-based disk quotas, while the grpquota option enables group-based quotas. One or both of these options may be enabled by placing them in the options field for the desired file system.
The affected file system(s) then must be unmounted and remounted for the disk quota-related options to take affect.
Next, the quotacheck command is used to create the disk quota files and to collect the current usage information from already existing files. The disk quota files (named aquota.user and aquota.group for user- and group-based quotas) contain the necessary quota-related information and reside in the file system's root directory.
To assign disk quotas, the edquota command is used.
This utility program uses a text editor to display the quota information for the user or group specified as part of the edquota command. Here is an example:
 Disk quotas for user matt (uid 500): Filesystem blocks soft hard inodes soft hard /dev/md3 6618000 0 0 17397 0 0 
This shows that user matt is currently using over 6GB of disk space, and over 17,000 inodes. No quota (soft or hard) has yet been set for either disk blocks or inodes, meaning that there is no limit to the disk space and inodes that this user can currently use..
Using the text editor displaying the disk quota information, the system administrator can then modify the soft and hard limits as desired:
 Disk quotas for user matt (uid 500): Filesystem blocks soft hard inodes soft hard /dev/md3 6618000 6900000 7000000 17397 0 0 
In this example, user matt has been given a soft limit of 6.9GB and a hard limit of 7GB. No soft or hard limit on inodes has been set for this user.

Note

The edquota program can also be used to set the per-file-system grace period by using the -t option.