A shared GlusterFS volume can fill from one busy project path before other teams have used their share. Setting a directory quota gives that path a hard ceiling so writes into the limited tree stop before the whole volume runs out of space.

GlusterFS applies quota rules to volume-relative paths, with the mounted volume root treated as /. The limit-usage subcommand sets or replaces the hard disk limit for an existing directory or an empty directory that will receive files later.

Quota rules require features.quota to be enabled first, and the strictest matching limit wins inside nested directory trees. Usage counters can lag while quota accounting catches up on active volumes, so verify the saved rule from a trusted-pool node and check the mounted client view before handing the path to applications that must handle Disk quota exceeded.

Steps to set GlusterFS quota limits:

  1. Open a terminal on a trusted-pool node.
  2. List volumes to confirm the target volume name.
    $ sudo gluster volume list
    volume1
  3. Confirm that the target volume is started.
    $ sudo gluster volume info volume1
    
    Volume Name: volume1
    Type: Replicate
    Volume ID: 53dc227f-05be-407d-a4f3-b27cdf2c8e98
    Status: Started
    Snapshot Count: 0
    Number of Bricks: 1 x 2 = 2
    Transport-type: tcp
    Bricks:
    Brick1: node1:/srv/gluster/brick1
    Brick2: node2:/srv/gluster/brick1
    ##### snipped #####

    Status: Started means the volume should accept quota changes. Repair a stopped or unhealthy volume before adding new limits.
    Related: How to check GlusterFS volume status

  4. Verify that quota accounting is enabled on the volume.
    $ sudo gluster volume get volume1 features.quota
    Option                                   Value
    ------                                   -----
    features.quota                           on

    Enable quotas first if the value is off.
    Related: How to enable GlusterFS volume quotas

  5. Create the target directory from a mounted client if it does not already exist.
    $ sudo mkdir -p /mnt/volume1/projects

    Replace /mnt/volume1 with the client mount point. The quota command still uses the volume-relative path /projects.

  6. Set the hard quota limit on the directory path.
    $ sudo gluster volume quota volume1 limit-usage /projects 500GB
    Usage limit has been set on /projects

    Writes under /projects fail with Disk quota exceeded after the hard limit is reached.

  7. List the quota entry for the limited path.
    $ sudo gluster volume quota volume1 list /projects
    Path        Hard-limit  Soft-limit  Used   Available
    ----------------------------------------------------
    /projects   500.0GB     80%         0B     500.0GB

    Used and Available can lag briefly while quota accounting updates on active volumes.

  8. Check the mounted directory from a client when quota-deem-statfs is enabled.
    $ df -hT /mnt/volume1/projects
    Filesystem      Type            Size  Used Avail Use% Mounted on
    node1:/volume1  fuse.glusterfs  500G     0  500G   0% /mnt/volume1

    GlusterFS recommends keeping features.quota-deem-statfs enabled so client disk-usage tools report the hard limit as the visible size for the limited path.