Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
Are quotas acceptable solution? – dchirikov Jan 10 '13 at 17:31
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
up vote 2 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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