User Tools

Site Tools


cluster:197

This is an old revision of the document!


XFS quotas

In XFS you first enable quotas on the mountpoint
(you add the options to /etc/fstab and remount)

# user and group quotas example:
/dev/mapper/VolGroup00-lvhome /home  xfs defaults,usrquota,grpquota 0 1

# user and project quotas example:
/dev/sdb1  /mindstore   xfs   defaults,uquota,pquota    1 2

After that you apply quotas per user, group or project.

To apply quotas to a directory (other than $HOME) create a project.

For projects you edit (for example for this lab):

# /etc/projects add a line (the "id" needs to unique)
11:/mindstore/mindlab

# /etc/projid add a line 
mindstore_mindlab:11

# next initialize the project (it can already exist on disk)
xfs_quota -x -c 'project -s mindstore_mindlab'

And apply 20T quota for example

 

xfs_quota -x -c 'limit -p bsoft=21000000m    bhard=21470000m    \
isoft=20000000 ihard=21000000 mindstore_mindlab' /mindstore

Never shrink a file system (or partition). You can use xfs_growfs to enlarge a mounted XFS file system if needed. Or with lvm2 allocate all available space lvextend -l +100%FREE lvm_volume_pat. Quotas you can “reduce”, but be careful, not a best practice.

To keep the XFS file system healthy unmount it and remount it so the journal does its thing. Use xfs_repair for forced consistency checks (-n for no modify mode)

cluster/197.1598538611.txt.gz · Last modified: 2020/08/27 10:30 by hmeij07