quota on a remote server (NFS)

Hi @all,

I've got a question about quota with virtualmin on a remote server (NFS) .

Setup: virtualmin host: IP: 10.203.30.10/16 path for virtualmin domains to create: /home/cluster fstab: 10.203.20.20:/cluster/nfsshare /home/cluster nfs4 defaults 0 0 NFS Server: IP:10.203.20.20/16 nfs share: /cluster/nfsshare dev for /cluster: /dev/drbd0

So I edit Webmin -> System -> Disk Quota -> 'Module Config' -> System configuration like this:

Command to list users on a filesystem = ssh root@storage001 -i /root/.ssh/key_root repquota -u -v /dev/drbd0

Command to list groups on a filesystem = ssh root@storage001 -i /root/.ssh/key_root repquota -g -v /dev/drbd0

Command to edit user's quota = edquota -r -u -f /home/cluster/

Command to edit group's quota = edquota -r -g -f /home/cluster/

Command to set a user's quota = ssh root@storage001 -i /root/.ssh/key_root setquota -u

Command to set a group's quota = ssh root@storage001 -i /root/.ssh/key_root setquota -g

Command to check a user's quota = ssh root@storage001 -i /root/.ssh/key_root quota -v -u -f /cluster

Command to check a group's quota = ssh root@storage001 -i /root/.ssh/key_root quota -v -g -f /cluster

Command to copy a user's quota = ssh root@storage001 -i /root/.ssh/key_root edquota -u -p

Command to copy a group's quota = ssh root@storage001 -i /root/.ssh/key_root edquota -g -p

Command to turn on user quotas = ssh root@storage001 -i /root/.ssh/key_root quotaon -u /cluster

Command to turn on group quotas = ssh root@storage001 -i /root/.ssh/key_root quotaon -g /cluster

Command to turn off user quotas = ssh root@storage001 -i /root/.ssh/key_root quotaoff -u /cluster

Command to turn off group quotas = ssh root@storage001 -i /root/.ssh/key_root quotaoff -g /cluster

Command to check quotas = ssh root@storage001 -i /root/.ssh/key_root quotacheck -u -g /cluster

Command to edit user grace times = ssh root@storage001 -i /root/.ssh/key_root edquota -f /cluster -u -t

Command to edit group grace times = ssh root@storage001 -i /root/.ssh/key_root edquota -f /cluster -g -t

If I run th comands from the console every thing return the expected result. But Virtualmin -> System Settings -> Re-Check Configuration says:

Quotas are not enabled on the filesystem /home/cluster which contains home directories under /home/cluster and email files under /home/cluster. Quota editing has been disabled.

What dose Virtualmin check ? Is there a logfile about the check? Could this work at all? Are there any experience about this? Thanks!

Status: 
Active

Comments

Virtualmin checks the /etc/fstab file to see if quotas are enabled for the filesystem, via usrquota and grpquota options.

So because of mount.nfs(8) don't support options for grpquota/usrquota there is no possibility to get virtualmin to work with quota on NFS.

Even /etc/fstab = 10.203.20.20:/cluster/nfsshare /home/cluster nfs4 rw,suid,dev,exec,auto,nouser,async,usrquota,quota,grpquota 0 0

with 'mount -as' won't be realised by virtualmin.

Actually, when a custom quota command is in use, Virtualmin shouldn't care about the filesystem options.

In your /etc/webmin/virtual-server/config file, does the line quotas=1 exist?

root@host000 /etc # grep quotas= /etc/webmin/virtual-server/config

quotas=1 mail_quotas= show_uquotas=0 hard_quotas=1 group_quotas= home_quotas= show_quotas=1

Make sure you also set quota_commands=1 in that file.

If I do this quota_commands=1 an edit under Virtualmin -> Virtualmin Configuration -> Quota commands -> Command to set a user's quota = ssh root@storage001 -i /root/.ssh/key_root setquota -u /cluster

In /etc/webmin/virtual-server/config I find: quota_set_user_command=ssh root@storage001 -i /root/.ssh/key_root setquota -u /cluster

but der Re-Check Configuration said: External quota commands are enabled, but the command to set a user's quota is not defined or does not exist

I also tried : quota_set_user_command='ssh root@storage001 -i /root/.ssh/key_root setquota -u /cluster'

Ok, there's a bug in Virtualmin - it expects the command to be a single script rather than a long ssh command. The work-around is to place your commands into short shell scripts in /etc and then references those in the Virtualmin config (use $* to refer to the list of command-line args to the script).

Thanks for this! I created this:

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to list users on a filesystem and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to list user quotas /etc/vmin-quota_list-user =ssh root@storage001 -i /root/.ssh/key_root repquota -uv $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to list groups on a filesystem and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to list group quotas /etc/vmin-quota_list-group = ssh root@storage001 -i /root/.ssh/key_root repquota -g -v $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to set a user's quota and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to set a user's quota /etc/vmin-quota_set-user = ssh root@storage001 -i /root/.ssh/key_root setquota -u $* 0 0 -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to set a group's quota and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to set a group's quota /etc/vmin-quota_set-group = ssh root@storage001 -i /root/.ssh/key_root setquota -g $* 0 0 -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to check a user's quota and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to get a user's quota /etc/vmin-quota_get-user = ssh root@storage001 -i /root/.ssh/key_root quota -v -u $*

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to check a group's quota and add to Virtualmin-> System Settings -> Virtualmin Configuration -> Quota Commands -> Command to get a group's quota /etc/vmin-quota_get-group = ssh root@storage001 -i /root/.ssh/key_root quota -v -g $*

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to copy a user's quota /etc/vmin-quota_copy-user = ssh root@storage001 -i /root/.ssh/key_root edquota -g -p $*

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to copy a group's quota /etc/vmin-quota_copy-group = ssh root@storage001 -i /root/.ssh/key_root edquota -g -p $*

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to turn on user quotas /etc/vmin-quota_on-user = <code>ssh root@storage001 -i /root/.ssh/key_root quotaon -u $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to turn on group quotas /etc/vmin-quota_on-group = ssh root@storage001 -i /root/.ssh/key_root quotaon -g $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to turn off user quotas /etc/vmin-quota_off-user = ssh root@storage001 -i /root/.ssh/key_root quotaoff -u $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to turn off group quotas /etc/vmin-quota_off-group = ssh root@storage001 -i /root/.ssh/key_root quotaoff -g $* -a

add to Webmin -> System -> Disk Quotas -> Module Configuration -> System configuration -> Command to check quotas /etc/vmin-quota_check = ssh root@storage001 -i /root/.ssh/key_root quotacheck -u -g $* -a

I see all commands in /etc/webmin/virtual-server/config and the Re-Check Configurations seems to be ok. Great! The only thing I dont see is the useed quota in virtualmin.

Any idea? Can you say what virtual min passes to 'the command' I saw foe example to Virtualmin -> Command to set a user's quota on creation it only passes username 1024 1024 but the comand expacted username <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> -a

You may need to repeat some of the args - in your script, you can use $1 for the first are, $2 for the second and so on.

Thast clear but what passes virtualmin to the "comands" ?

Can I see someware what actions are done from virtualmin?

You can see docs on what args are passed to the commands on the Virtualmin Configuration page, by clicking on the option names.