Score:0

Comparision of methods for implementing directory size quota in Linux?

co flag

I came across two solutions for implementing directory size quotas in Linux.

  1. 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.
  2. 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.

in flag
What is the purpose of the quota? Is this supposed to limit users, limit applications, or limit everything? Is this something that will be done with Ubuntu? Or are you looking at “any Linux” solutions?
SUNITA GUPTA avatar
co flag
@matigo Sorry I forgot to mention I meant quota wrt size. I have edited question to reflect the same.
in flag
I still don’t see what the goal is. If you’re just trying to limit how much a user account can consume, then there’s the standard set of `quota` functions. If you’re trying to limit how much an application uses, then even more questions will be raised. There’s little benefit to over-engineering any solution, as that makes a system brittle
SUNITA GUPTA avatar
co flag
@matigo I had updated the question to fill the gap (.....background), seems fine now?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.