Quotas set to unlimited after unclean shutdown. How to reconfig all?

After an unclean shutdown quotas have been deleted and set to unlimited.

command quota -v user and also virtualmin validation showed unlimited quotas

I tried command quotacheck -vbugmf --all which completed succesfully but did not do anything to reapply them

I also tried from virtualmin limits and validation / check disk quotas but it showed a timeout error on the browser and did not succeed in reapplying them

This has happened before and I went to each virtual server to slightly change quota values and save to reapply.

Is there a way to reapply quotas for all servers from gui or from command line?

If there is a console virtualmin command this would help as well, even if it is for one virtual server only.

Status: 
Active

Comments

Joe's picture
Submitted by Joe on Sun, 05/17/2015 - 08:02 Pro Licensee

There is a virtualmin console command. (Generally speaking, everything you can do from the UI can be done from the virtualmin command, except in cases where it doesn't make sense, like graphing and other graphically oriented tasks.)

Give this a try:

# virtualmin fix-domain-quota --all-domains

You can get a list of available commands for the virtualmin command, and the usage options for a specific command, by running virtualmin or any specific command without options.

Worked like charm! Thank you!

One more think I would like to ask. Do you think I should be using journaled quota to avoid this from happening again.

I was using usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0 in /etc/fstab. Quota works but I am not sure if it is journaled or if this helps unclean shutdowns.

Howdy -- it's rare that the issue you saw happens, even with an unclean shutdown... I hadn't run into that before.

I don't have any experience using journaled quotas, though in researching that option it does sound like it can decrease the chance of data loss.

So it may be worth a try.

Out of curiosity, what filesystem are you using? And is this a dedicated server or a VPS?

Currently I am running 2 Debian servers as kvm Virtual Machines (proxmox setup) and using ext4 on the one and reiserfs on the other, planning to switch to ext4 as well.

It happens on both filesystems. It happened also before switching to VM when I was using bare metal servers. And it happens on another non-virtualmin server as well.

The only common in every server is that it has a Debian distribution running for over 8 years with at least 4 distribution upgrades (meaning there might be also some old configuration files in quota or other service that could cause the issue)

I think reiserfs does not support journaled quota, one of the reasons I am switching. However I cannot figure out if journaled quota is supported on a compiled kernel with a switch on, or if this is enabled on stock debian kernel as well. Journaled quota is not well documented and everytime I search I find the same minimal setup I have already done that does not work.

A second implication is that quota checking on reboot after unclean shutdown makes boot take over 20 minutes, and on proxmox VM I cannot even send CTRL-\ to interrupt quota check to continue boot, and schedule a quota check later.

This has been bugging me for a long time (years). It is helpful to quickly fix consequences with the virtualmin command but I should find a fix for the issue causing quota deletion or at least make it appear rarely. For now it appears almost every time.