16.2. Managing Disk Quotas
16.2.1. Enabling and Disabling
-goptions are specified, only the user quotas are disabled. If only
-gis specified, only group quotas are disabled. The
-vswitch causes verbose status information to display as the command executes.
quotaoncommand with the same options.
/home, use the following command:
quotaon -vug /home
-goptions are specified, only the user quotas are enabled. If only
-gis specified, only group quotas are enabled.
quotaoncommand is not always needed for XFS because it is performed automatically at mount time. Refer to the man page
quotaon(8)for more information.
16.2.2. Reporting on Disk Quotas
Example 16.5. Output of
repquota /homeproduces 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
-a) quota-enabled file systems, use the command:
--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.
gracecolumns 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,
noneappears in its place.
16.2.3. Keeping Quotas Accurate
quotacheckcan be run on a regular basis, even if the system has not crashed. Safe methods for periodically running
- Ensuring quotacheck runs on next reboot
NoteThis method works best for (busy) multiuser systems which are periodically rebooted.As root, place a shell script into the
/etc/cron.weekly/directory—or schedule one using the
crontab -ecommand—that contains the
touch /forcequotacheckcommand. This creates an empty
forcequotacheckfile 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
/forcequotacheckfile; thus, scheduling this file to be created periodically with
quotacheckis run during the next reboot.For more information about
cron, refer to
- Running quotacheck in single user mode
- An alternative way to safely run
quotacheckis to boot the system into single-user mode to prevent the possibility of data corruption in quota files and run the following commands:
quotaoff -vug /file_system
quotacheck -vug /file_system
quotaon -vug /file_system
- Running quotacheck on a running system
- If necessary, it is possible to run
quotacheckon a machine during a time when no users are logged in, and thus have no open files on the file system being checked. Run the command
quotacheck -vug file_system; this command will fail if
quotacheckcannot remount the given file_system as read-only. Note that, following the check, the file system will be remounted read-write.
quotacheckon a live file system mounted read-write is not recommended due to the possibility of quota file corruption.
man cronfor more information about configuring