Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

Relational databases usually have their data over in /var/lib/something. Users are in /home (with data in /var/www). How can I apply a single total disk space quota across all of these independent software systems (file systems, RDBMS, etc.)?

P.S. There's a bet going on around me as to just how awesome SU is. Let's see what you've got.

share|improve this question

You could move each user's database files to within their home directory, so they will be counted against any quota monitored there. If /var and /home or on the same filesystem you can do this with hardlinks so there is no need to even pause msySQL, otherwise moving the files to the home directories and symlinking them back to `/var/lib/whatever'.

For web accessible content, I tend to configure each user's sites to be in their home directories anyway (usually in a directory called /home/<user>/public_html (with a symlink to that called /home/<user>/www as some prefer that). This way the files are in the same place as the rest of their home directories so there is no extra location to count.

Depending how quotas are counted, file ownership may be an issue. For instance if you run your web server such that everything runs as one user (the users nobody and www-data are common) any files created by web accessed scripts will not be owned by the user so if this stops them being counted in their quota you'll be missing some stuff in your counts. I have each user's scripts run as themselves (via suPHP or phpSUexc for PHP) so things end up correctly owned meaning this is not an issue for web accessible scripts and any output they create in the filesystem.

share|improve this answer

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.