I successfully use xfs project (or directory) quota. However I just discovered that I am unable to remove quota information once I don't need it anymore. For example, I had 3 projects with project id 1, 2, 3. I removed the directory of the project with id 2, and now xfs_quota continues to tell me that there is is a project with id 2, and it has quota. The reported used space is 0, which is correct since the directory was removed. This is not a real problem. Whenever I reuse project id 2 I will set new quota, but I'd still like to remove this useless information from the filesystem.
/etc/projects
1:/web/perso/usera
3:/web/perso/userc
/etc/projid
usera:1
userc:3
And here is what xfs_quota reports.
root@server # xfs_quota -xc "report -a -p -h"
Project quota on /web (/dev/vdb1)
Blocks
Project ID Used Soft Hard Warn/Grace
---------- ---------------------------------
#0 588.3M 0 0 00 [------]
usera 5.5M 14G 14G 00 [------]
#2 0 980M 1G 00 [------]
userc 574.6M 14G 14G 00 [------]
How can I tell xfs that it does not need anymore to keep track of project id 2 ?
Setting limits to 0 while the project is still in
/etc/{projid,projects}
removes the project from metadata. After that it can be removed from/etc/{projid,projects}
.I came across this by chance.
It seems you'd need to switch the quota off before you could do that:
You could try
disable
first, but I'm afraid you'd need to useoff
.As you said, it's possible to set the quota again when the ID is reused, so this is not a real problem. Permanently switching off the quota seems like burning down a house to kill a rat.
You should use
xfs_quota -x -c "project -C foo" /path
to clear the directory tree at first. Then usexfs_quota -x -c "off -up" /path
andxfs_quota -x -c "remove -p" /path
to remove the quota metadata.Pay attention that this operation will delete all project quota limitation.