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!
Comments
Submitted by ghost23 on Mon, 11/26/2018 - 02:43 Pro Licensee Comment #1
Submitted by ghost23 on Mon, 11/26/2018 - 02:45 Pro Licensee Comment #2
Submitted by JamieCameron on Mon, 11/26/2018 - 22:20 Comment #3
Virtualmin checks the /etc/fstab file to see if quotas are enabled for the filesystem, via usrquota and grpquota options.
Submitted by ghost23 on Tue, 11/27/2018 - 02:24 Pro Licensee Comment #4
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.
Submitted by JamieCameron on Wed, 11/28/2018 - 22:34 Comment #5
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 linequotas=1
exist?Submitted by ghost23 on Thu, 11/29/2018 - 06:36 Pro Licensee Comment #6
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
Submitted by JamieCameron on Sat, 12/01/2018 - 00:03 Comment #7
Make sure you also set
quota_commands=1
in that file.Submitted by ghost23 on Sun, 12/02/2018 - 10:16 Pro Licensee Comment #8
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'
Submitted by JamieCameron on Sun, 12/02/2018 - 12:21 Comment #9
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).Submitted by ghost23 on Mon, 12/03/2018 - 08:05 Pro Licensee Comment #10
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 expactedusername <block-softlimit> <block-hardlimit> <inode-softlimit> <inode-hardlimit> -a
Submitted by JamieCameron on Wed, 12/05/2018 - 00:38 Comment #11
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.
Submitted by ghost23 on Wed, 12/05/2018 - 07:32 Pro Licensee Comment #12
Thast clear but what passes virtualmin to the "comands" ?
Can I see someware what actions are done from virtualmin?
Submitted by JamieCameron on Wed, 12/05/2018 - 23:29 Comment #13
You can see docs on what args are passed to the commands on the Virtualmin Configuration page, by clicking on the option names.