You can set per-directory quotas if you use XFS as your filesystem (which you will probably want to do, since you'll have ~8TB of disk). They call the feature "project quotas" and they're a bit of a pain to get up and running, but work reasonably well once you figure them out.
You can read man 8 xfs_quota
to find out more about them.
Basically you need two files: /etc/projects
and /etc/projid
. In the /etc/projects
file you have an ID:directory mapping, eg:
10:/mnt/raid/foo1
10:/mnt/raid/foo2
20:/mnt/raid/bar
Then in the /etc/projid
file you have a listing of project name:ID mappings:
foo:10
bar:20
You the mount the filesystem with project quotas enabled mount -o pquota /dev/md0 /mnt/raid
and then set up the quotas:
xfs_quota -x -c 'project -s foo' /mnt/raid
xfs_quota -x -c 'project -s bar' /mnt/raid
xfs_quota -x -c 'limit -p bhard=10g foo' /mnt/raid
xfs_quota -x -c 'limit -p bhard=20g bar' /mnt/raid
The first command sets the quota metadata in the filesystem, and the second one sets up the hard block limit. The nice thing about this as opposed to using LVM volumes is that you can both increase and decrease the quota assignment, and you can also set soft quotas so that you can receive warnings when a directory is beginning to use a lot of space (see the report
command of xfs_quota
).
The downside is that this feature is only available with XFS filesytems, so these project quotas aren't supported by any tools other than the XFS ones.