Este contenido no está disponible en el idioma seleccionado.
16.2.3. Keeping Quotas Accurate
When a file system fails to unmount 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
Note
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 thecrontab -ecommand—that contains thetouch /forcequotacheckcommand. This creates an emptyforcequotacheckfile in the root directory, which the system init script looks for at boot time. If it is found, the init script runsquotacheck. Afterward, the init script removes the/forcequotacheckfile; thus, scheduling this file to be created periodically withcronensures thatquotacheckis run during the next reboot.For more information aboutcron, refer toman cron.- 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 -vaug /file_system
# quotaoff -vaug /file_systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow quotacheck -vaug /file_system
# quotacheck -vaug /file_systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow quotaon -vaug /file_system
# quotaon -vaug /file_systemCopy to Clipboard Copied! Toggle word wrap Toggle overflow - 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 commandquotacheck -vaug file_system; this command will fail ifquotacheckcannot remount the given file_system as read-only. Note that, following the check, the file system will be remounted read-write.Warning
Runningquotacheckon a live file system mounted read-write is not recommended due to the possibility of quota file corruption.
Refer to
man cron for more information about configuring cron.