Server Quota Issues

A Virtualmin customer reported a problem where after a power outage, a number of users had incorrect quotas... many were much lower than they should have been, causing email to not be delivered. Errors include the following:

18:29:32 HOSTNAME spamd[1170]: Error writing to /home/USERNAME/homes/info/.spamassassin/bayes.lock.1170: Disk quota exceeded at /usr/share/perl5/Mail/SpamAssassin/Locker/ line 88, <GEN315> line 46.

The issue was resolved one user at a time by going into Virtualmin, and changing the quotas -- but he was inquiring if this issue were a bug, and if it were possible to correct all the quotas.

I wanted to place a response here in the Support tracker to help us track the issue --

Whenever this occurs, it means that there is a quota file corruption.

It sounds like in this case, the filesystem's quota file "broke" during the power outage.

While Virtualmin tells the filesystem what a user's quota should be -- that's the only time Virtualmin is involved with the quotas. If that value changes during a power outage, that means there is a filesystem/quota corruption issue.

It's similar to how MySQL databases can experience corruption during a power outage -- except in this case, it's the quota databases stored by the filesystem.

This isn't the result of a Virtualmin bug, and quota file corruption isn't preventable with software.

So, the next question is, how can we reset or regenerate the filesystem's quota file when it does get corrupted?

For that, we have good news, and bad news!

The good news is in regards to the Virtual Server owner and group -- Virtualmin stores metadata regarding what the Virtual Server user and group quota should be (the one set on the Edit Virtual Server page).

Jamie recently added a feature into Virtualmin which can correct that quota information for Virtual Server owners.

It's only available within the command line tools. To see the available options, run the following command:

virtualmin fix-domain-quota

You'll see options for running that against one domain, or all domains.

Now, in regards to email users -- that's a more tricky problem.

Virtualmin does not store any metadata for email users -- and there isn't a way to regenerate their quotas like you can for Virtual Server owners.

Outside of updating the users one at a time, the only way to correct the quotas for email users would be to restore the email users from the previous night's backup, as the quotas are stored during the backup process.

There's two gotchas with that -- one, that means any passwords would be reset to the previous backup. And two, probably more significant, is that any users created since the last backup would be deleted.

However, at present, that's the only way to reset the quotas for email users.