For each filesystem with quotas enabled/on where is the actual quota information stored?
See e.g. the quotaon manpage. There will be files named .quota* in the filesystem root directory, which contain the necessary information (.quota.user,.quota.group, .quota.ops.user, .quota.ops.group).
Say user foo creates a new file on
/home. How does the kernel determine
whether user foo is below their hard
limit? Does the kernel have to tally
up quota information on that
filesystem each time or is it in the
superblock or somewhere else?
No, the kernel continually tracks fs usage, so it does not need to recalculate that on each allocation (which would be prohibitively expensive). It will do the calculation once when quotas are enabled, and then update that. The initial calculation is performed by quotacheck.
As far as I understand, the kernel
consults the aquota.user file for the
actual rules, but where is the current
quota usage data stored? Can this be
viewed with any tools outside repquota
and the like? TIA!!
Quota information is stored in .quota* (see above). I'm not aware of any tools to generate quota usage reports, apart from repquota. But you should be able to generate most reports using/scripting repquota. Or you'll have to hack the source...
BTW:
The Quota mini-HOWTO give a good overview over the Linux quota system. It's a bit dated, but the fundamentals have not changed much.
I like the gt5 utility. It use the output of du
and creates a browsable listing of directories and their sizes and uses a text-mode browser such as links to display the information.
Both programs are available in the Ubuntu repositories: gt5 and links.
Best Answer
Not sure how you missed this, if you did read the man page.
So you'll set a default quota something like: