Setting quotas

Learn how to use the setfattr command and the ceph.quota extended attributes to set the quota for a directory.

About this task

For more information, see the setfattr(1) manual page.

Procedure

Set CephFS quotes in one of the following ways.
  • Using a byte-limit quota.
    Note: The following values are supported for byte-limit quota: K, Ki, M, Mi, G, Gi, T, Ti.
    setfattr -n ceph.quota.max_bytes -v LIMIT_VALUE DIRECTORY
    For example:
    [root@client ~]# setfattr -n ceph.quota.max_bytes -v 2T /mnt/cephfs/
  • Using a file-limit quota.
    setfattr -n ceph.quota.max_files -v LIMIT_VALUE DIRECTORY
    For example:
    [root@client ~]# setfattr -n ceph.quota.max_files -v 10000 /mnt/cephfs/
    In this example, 10000 equals 10,000 files.
    Note: Only numerical values are supported for the file LIMIT_VALUE.