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.
Related: How to enable GlusterFS volume quotas
Related: How to check GlusterFS volume status
Related: How to check GlusterFS logs
$ sudo gluster volume list volume1
$ 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
$ 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
$ sudo mkdir -p /mnt/volume1/projects
Replace /mnt/volume1 with the client mount point. The quota command still uses the volume-relative path /projects.
$ 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.
$ 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.
$ 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.