I believe it is not necessary to have quota trees in order to have quotas. But it is highly advisable. I highly recommend putting all user home directories in quota trees.
I second this. Always put users who are subject to quotas into a quota tree. Even if you think you will never need quota trees.
Assume a volume is delimited by { and } and a qtree is delimited by ( and ). If you have a user A who owns files in a volume and also in a qtree, it looks like this:
{ A ( A ) }
Suppose you want to limit A to 100M in the volume at large, but let A use up to 500M in the qtree. There is no way to accomplish this with the above scenario. The volume quota covers the ENTIRE volume, i.e., everything from { to }. If you set A's volume quota to 100M, and A's qtree quota to 500M, then A is limited to 100M in the entire volume, including any space A uses in the qtree.
Since A is entitled to up to 600M total, you could set A's volume quota to 600M and A's qtree quota to 500M. But then A could use 600M outside the qtree and nothing inside it. Still not what you want.
It is much better to do this:
{ ( A ) ( A ) }
That way you can give A an unlimited quota in the volume, but then set separate quotas for A in each qtree. You can give A a 100M quota in one qtree and a 500M quota in the other one.
When planning, don't assume that you will never use qtrees. Sure as the world some special project will come along that just begs for a qtree and you will need to let folks use the qtree who already own files elsewhere in the volume.
It's very easy to set up quotas using defaults. For each volume, I suggest creating a "users" qtree:
qtree create /vol/vol0/users
Now put these lines in your quotas file:
* user@/vol/vol0 - - (default user in vol unlimited) * tree@/vol/vol0 - - (default tree size unlimited) /vol/vol0/users tree - - ("users" tree size unlimited) * user@/vol/vol0/users 100M - (default user in "users" tree 100M)
Run "quota on"
Now add users to the "users" quota tree. Each one will be limited to 100M. You can override this with specific entries:
A user@/vol/vol0/users 500M - (user A in "user" tree gets 500M)
Then run "quota resize"
If you ever create a new qtree, just add these lines to the quotas file:
/vol/vol0/qt1 tree 10G - ("qt1" tree size is 10G) * user@/vol/vol0/qt1 - - (default user can have it all)
and run "quota resize"
The total size of qt1 is limited to 10G and each user in qt1 can use the whole thing. Of course, you could put in a limited user default, and you could override it with explicit entries:
* user@/vol/vol0/qt1 2G - (default user gets 2G) A user@/vol/vol0/qt1 - - (A can have it all) B user@/vol/vol0/qt1 500M - (B gets 500M)
If you are paranoid, you may prefer to set the default user quota for the qtree to zero. But then you need an explicit quota entry for each qtree user.
* user@/vol/vol0/qt1 0M 0K A user@/vol/vol0/qt1 - - B user@/vol/vol0/qt1 500M -
Why do this? Suppose user A makes a directory world writable. This lets any other user create files in there. Suppose user F, who should not be allowed into qt1, discovers this open directory and copies a bunch of files in there. F owns these files, so they are charged to F's quota in qt1, which is the default. If you set the default to zero then that prevents F or anyone else from sneaking files into qt1.
Steve Losen scl@virginia.edu phone: 804-924-0640
University of Virginia ITC Unix Support