[Linux/quotacheck] quotacheck: Cannot stat directory //var/spool/exim_incoming/scan/1erAzg-0007eX-E1: No such file or directory

When running quotacheck on a filesystem that isn’t read only it will error out and not finish if it’s unable to stat a certain file or directory. It does this because it assumes that there’s a problem with the filesystem. If your mail software is actively processing mail when running quotacheck it will get an error like this:

# quotacheck -cmu /

(some time will pass while it scans the partition)

quotacheck: Cannot stat directory //var/spool/exim_incoming/scan/1erAzg-0007eX-E1: No such file or directory

The reason for this is that when it gets the directory contents this temporarily mail file exists and when it tries to get the ownership info on that file it has already been processed and doesn’t exist anymore. Simply stop the mail program (in this case exim) or any other program that deals in temporarily files quickly and restart the quotacheck.