I came across two solutions for implementing directory size quotas in Linux.
- One was using making images using the dd/fallocate/etc command and mounting it using loopback interfaces, resizing can be done by resize2fs as and when needed.
- Another was using project quota for ext4 and xfs file system. I want to compare these two methods and their usability in specific cases.
Some points which I can think of are:
a. project quota is a more direct method and gives many more options like soft limit inode limit etc.
b. project quota doesn't require the overhead of creating a new image and mounting each time a directory needs to be created.
c. One advantage of the 1st method seems to be that non-admin users can see the folder size.
It would be nice to have more views, a more comprehensive comparison, and specific usage cases for each method. Also, I would like to know if there is another method for this task. Thanks in advance.
A little background: I'm creating smb shares in Linux and giving remote windows users access. Users are organized in small groups, each group needs to be isolated from others, i.e. they cannot access other groups' shares/files. Also, each user in a group should have a separate login and password and it should be possible to allocate each user a variable size (conditional i.e. there may be some users in a group with no size limit/quota). Another requirement is that some of the shares need to be constrained in terms of the size they can carry (so as to not allow these shares to take up all the disk space). I figured that because each share is basically a directory so if I can put a constraint on the size of the directory/folder (i.e. directory size quota), I will be able to constrain the size of an individual share.