Skip to main content

Quota

To configure a share with quota-support an administrator should do:

  • Mount volume with usrquota option.
  • Create quota file on volume with:
# quotacheck -u -c -f -F vfsv1 <volume root>

‘-F vfsv1’ is important because only this version of quota file format support 64-bit limits.

  • Create some subdirectory for SMB share root (as volume root is not recommended for this).

Quota support has limitations connected with Linux quota implementation:

  • Only one SMB shares can exist on quota enabled volume.
  • It is recommended to have SMB share root located under some subdirectory of volume root to avoid exporting system files such as aquota.user file.

Example:

$ mount | grep quota
/dev/sdc1 on /mnt/quota_disk type ext4
(ro,relatime,user_xattr,barrier=1,data=ordered,usrquota)
$ ls -ln /mnt/quota_disk/
total 88
-rw------- 1 0 0 10240 Jan 2 03:49 aquota.user
drwx------ 2 0 0 16384 Dec 21 18:33 lost+found
drwxrwxrwx 2 2039 2000 4096 Jan 2 00:54 vol

In tsmb.conf file, there is a configuration option connected to quota support: extra parameter of vfs.

Option for share: def_quota_uid. In Linux quota support, there is no term default quota settings (settings valid for users that do not have specific quota configuration). Therefore, in order to save the default quota settings, an artificial entry with some predefined UID, which should not be valid user UID, are created. The UID value is specified via def_quota_uid parameter of vfs setting.

Example of share configuration with quota support:

[share]
netname = SH1
remark = Test Share
path = /mnt/quota_disk/vol
permissions = everyone:full
vfs = libc:def_quota_uid=7777
[/share]