Linux – Quota check for ext3 Linux partition

centosfilesystemslinuxquota

I use

quotacheck -m /home

in cron.daily to check quota everyday. The server OS is CentOS-5.3. I am getting error

quotacheck: Quota for users is enabled on mountpoint /home so quotacheck might damage the file.
Please turn quotas off or use -f to force checking.

since last few days in logwatch and even on manually running the command. Should I use -f or there is some better way to keep quota files accurate. I felt quota files were not being updated at all until I call quotacheck. Can kernel automatically update quota files when file size changes?

Best Answer

Did you read the manpage of quotacheck?

It is strongly recommended to run quotacheck with quotas turned off for the filesystem. Otherwise, possible damage or loss to data in the quota files can result. It is also unwise to run quotacheck on a live filesystem as actual usage may change during the scan.

[...]

-f, --force

Forces checking and writing of new quota files on filesystems with quotas enabled. This is not recommended as the created quota files may be out of sync.

So do not run it on a live filesystem. At any rate, why are you running it in cron.daily? quotacheck is only necessary if the quota data may be out of sync with the filesystem, usually after a fs crash, or if the fs was used without quotas.

During normal usage, the quotas are updated automatically, there's no need to run quotacheck regularly.

Manpage again:

quotacheck should be run each time the system boots and mounts non-valid filesystems.

So run quotacheck from your boot scripts (should be in there already), and lose the cron job.