Working with our SAMBA server on CentOS 6.5 we can look to see how we can implement users quotas via the smbtools. We still need to have quotas turned on on our mount options for the file-system that is shared out but smbcquotas will allow for the quotas to feedback correctly via the SMB protocol as will as managed though the smbtools.
In the worked example in the video we have the /repo directory shared out and this is mounted individually in the /etc/fstab so we effect mount option on this disk.
- Edit the /etc/fstab add the mount options usrjquota=aquota.user,jqfmt=vfsv0
- Unmount and mount again from the fstab: umount /repo ; mount -a
- Create quota database:
quotacheck -cmuva - Enable quota checking quotaon /repo
- Show quota flags : smbcquotas -F //127.0.0.1/repo
- Enable a quota for the user
smbcquotas -S UQLIM:fred:10000000/20000000 //127.0.0.1/repo
The limit is set for the user fred to 10M as a soft limit and 20M as a hard limit. The numbers are in bytes. - List quotas smbcquotas -L //127.0.0.1/repo
To unset a quota for a user use the value of -1. Soft limits ca be exceeded for the grace period which defaults to 7 days, hard limits cannot exceeded.