Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    help: to limit a folde`s size without using quotas

    Friends, could anybody there give me a light, please, to solve the following problem: I need a way to limit the size of a folder, but without using group or user quotas... is there a good solution?

    For example, I want to avoid that folder X grows up more than 100MiB, no matters who writes to the folder...

    If there is no such way, maybe do you think that it is possible to create a new user account just to control the size of the folder X? I mean to put this new user as the owner of the folder X and allow any access to the folder... Do you think that, if someone writes to the folder, the quota of the new user would be consumed and reach a unbreakable limit?

    thanks in advance

  2. #2

    controlling the folder's disk quota with setgid

    Folks, I need to limit the size of a folder shared in the network, no matters who have

    access and write to it... in other words, think about a folder that every user have to

    access and possibly write, but the size of this folder has to be under a size limit...

    In my concern, there is no configuration mecanism especially made to this task, right? I think that the proper feature should come from the filesystem...

    But, anyway, I thought about a solution using group quotas. I guess that when you enable the folder's setgid bit, everything that is copied to that folder becames owned by the folder's group owner. If I create a group of users, let's say named "Control", and put every network user in this group (but as a secondary group - "Control" won't be the main group of no user), do you think that the "Control"s group disk quota (properly configured) will limit the size of the folder (without limiting no user's quota)...

    Is there a chance that this idea work? Is there a better choice?

    Thanxs in advance....

  3. #3
    Linux Guru
    Join Date
    Nov 2007
    Córdoba (Spain)
    The simplest thing I can think of is to use a separate partition of that size, do not allow user mounts and use an specific fs that doesn't allow symlinking, like fat. That's the simplest you can get. If you do not want to create a partition for that, you can create a filesystem of any given size into an sparse file, just like you would do on a device node.

  4. $spacer_open
  5. #4


    just to give a feedback: a loop device was a really good idea... to every folder that I want to limit its size I create an image of a file system with the right size... []'s

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts