Setting up Project Quotas under XFS in Debian GNU/Linux

Quick and dirty notes for getting XFS project quotas running: I’m working on making storage areas for various capstone design class groups, vehicle teams, etc. I’d like to ensure that they don’t take an excessive amount of storage, too. These instructions are slightly different than what I’d found elsewhere, and I’m hoping to have someone confirm that what I’m doing is correct and update the appropriate man pages accordingly.

So assuming we have a project for ME4444, group 3 (I already had projects defined for groups 1 and 2 from earlier tests):

# grep /home /etc/fstab
/dev/md1000/home        /home   xfs     defaults,usrquota,prjquota      0      1
# echo "me4444-03:/home/projects/me4444-03" >> /etc/projects
# echo "me4444-03:3" >> /etc/projid
# mkdir /home/projects/me4444-03
# xfs_quota -x -c "project -s me4444-03"
Setting up project me4444-03 (path /home/projects/me4444-03)...
Processed 1 /etc/projects paths for project me4444-03
# xfs_quota -x -c "limit -p bsoft=5g bhard=10g me4444-03"
# xfs_quota -x -c "report -p"
Project quota on /home (/dev/md1000/home)
Project ID       Used       Soft       Hard    Warn/Grace
---------- --------------------------------------------------
me4444-01           0          0    1048576     00 [--------]
me4444-02           0    5242880   10485760     00 [--------]
me4444-03           0    5242880   10485760     00 [--------]

Now group 3 has a 5 GB “soft” quota, can exceed that for up to 7 days at a time, but can never exceed their 10 GB “hard” quota. All that’s left is setting up directory permissions and Samba configuration so that the authorized users can store things there.

Leave a comment

Your email address will not be published. Required fields are marked *