Is there an easy way to cap the size of a directory? I don't think there is but just wanted to make sure. I would like to set max directory sizes for some user home dirs as well as some other dirs, mostly under /var in an attempt to better manage the disk resources.

  • 3
    Are quotas acceptable solution? – dchirikov Jan 10 '13 at 17:31
  • 1
    See also this (possible duplicate?) serverfault question on per-directory quotas. – sr_ Jan 10 '13 at 17:33
  • @dchirikov -- if a quota will effectively cap a dir size, then yes – amphibient Jan 10 '13 at 17:40

You can have a separate filesystem for /var on a new disk partition/LUN created for this. Then, you can use LVM to manage the size. In future, if you feel the need to grow this filesystem, LVM will be more flexible for that.

  • This is probably what I would do. I was going to post this an an answer, and then I scrolled down and saw that you beat me to it. :) – BenjiWiebe Jan 11 '13 at 0:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.