Table of ContentsView in Frames

Progressive quota examples

Following through a series of progressive examples can help you to understand how to create your quotas file and read your quota reports.

For the following examples, assume that you have a storage system that has one volume, vol1.

Example 1: default quota

You decide to impose a hard limit of 50 MB for each user in vol1, using the following quotas file:

#Quota target type            disk files  thold sdisk  sfile
#-----------  ----            ---  -----  ----  -----  -----
*             user@/vol/vol1  50M  
If any user on the system enters a command that would use more than 50 MB in vol1, the command fails (for example, writing to a file from an editor).

Example 2: default quota override

Suppose that you have received a complaint from an important user, saying that she needs more space in vol1. To give this user more space, you update your quotas file as follows (her username is jsmith):
#Quota target type            disk files  thold sdisk  sfile
#-----------  ----            ---  -----  ----  -----  -----
*             user@/vol/vol1  50M  
jsmith        user@/vol/vol1  80M
Now, jsmith can use up to 80 MB of space on vol1, even though all other users are still limited to 50 MB.
The quota report looks like this:
filer1> quota report
                                 K-Bytes             Files
Type       ID    Volume    Tree  Used      Limit     Used    Limit   Quota Specifier
----- -------- -------- -------- --------- --------- ------- ------- ---------------
user      *      vol1        -         0     51200       0       -    *
user      jsmith vol1        -     63275     81920      37       -    jsmith
user      root   vol1        -         0         -       1       - 
Note that an extra quota is shown, for the root user. Default user quotas do not apply to root, so the root user has no space limit on vol1, as shown in the quota report by the dash (“-”) in the Limit column for the root user.

Example 3: thresholds

This example sets up a threshold for all users at 45 MB, except for jsmith, who will get a threshold at 75 MB. To set up a user-specific threshold, we change the quotas file to read as follows:
#Quota target   type            disk    files   thold   sdisk   sfile
#-----------    ----            ----    -----   -----   -----   -----
*               user@/vol/vol1  50M     -       45M
jsmith          user@/vol/vol1  80M     -       75M
Note that it was necessary to add a dash (-) in the Files field as a placeholder because the Threshold field comes after the Files field in the quotas file.
Now the quota report looks like this:
filer1> quota report -t
                            K-Bytes                    Files
Type    ID    Volume  Tree  Used    Limit     T-hold   Used    Limit   Quota Specifier
------ ----- -------- ----- ------ --------  -------- ------- -------- ----------------
user    *      vol1    -     0       51200    46080     0        -     *
user    jsmith vol1    -     63280   81920    76800     47       -     jsmith
user    root   vol1    -     0       -        -         51       - 
Note that the -t flag is used to display threshold limits.

Example 4: quotas on qtrees

Suppose that you decide you need to partition some space for two projects. You create two qtrees, named proj1 and proj2, to accommodate those projects within vol1. Creating qtrees does not cause any change for your quotas, because the quotas file only applies quotas to the volume so far. Users can use as much space in a qtree as they are allotted for the entire volume (provided they did not exceed the limit for the volume by using space in the root or another qtree). In addition, each of the qtrees can grow to consume the entire volume.

You decide that you want to make sure that neither qtree grows to more than 20 GB. Your quotas file now looks like this:
#Quota target   type            disk files thold sdisk   sfile
#-----------    ----            ---- ----- ----- -----   -----
*               user@/vol/vol1  50M   -     45M
jsmith          user@/vol/vol1  80M   -     75M
*               tree@/vol/vol1  20G 
Note that the correct type is tree, not qtree.
Now your quota report looks like this:
filer1> quota report -t 
                             K-Bytes                      Files
Type   ID    Volume    Tree  Used      Limit     T-hold   Used    Limit  Quota Specifier
----- ------ -------- ------ --------- --------- -------- ------- ----- -------------
user   *      vol1      -           0      51200    46080     0       -  *
user   jsmith vol1      -       63280      81920    76800    55       -  jsmith
tree   *      vol1      -           0   20971520        -     0       -  *
tree   1      vol1      proj1       0   20971520        -     1       - /vol/vol1/proj1
user   *      vol1      proj1       0      51200    46080     0       - 
user   root   vol1      proj1       0          -        -     1       - 
tree   2      vol1      proj2       0   20971520        -     1       - /vol/vol1/proj2
user   *      vol1      proj2       0      51200    46080     0       - 
user   root   vol1      proj2       0          -        -     1       - 
user   root   vol1      -           0          -        -     3       - 
Several new lines have appeared. The first new line is exactly what you added to the quotas file:tree * vol1 - 0 20971520 - 0 - *The next line shows what is called a derived quota. You did not add this quota directly. It is derived from the default tree quota that you just added. This new line means that a quota of 20 GB is being applied to the proj1 qtree:tree 1 vol1 proj1 0 20971520 - 1 - /vol/vol1/proj1The next line shows another derived quota. This quota is derived from the default user quota you added in an earlier example. Default user quotas on a volume are automatically inherited for all qtrees contained by that volume, if quotas are enabled for qtrees. When you added the first qtree quota, you enabled quotas on qtrees, so this derived quota was created:user * vol1 proj1 0 51200 46080 0 - The rest of the new lines are for the root user and for the other qtree.

Example 5: user quota on a qtree

You decide to limit users to less space in the proj1 qtree than they get in the volume as a whole. You want to keep them from using any more than 10 MB in the proj1 qtree. To do so, you update the quotas file as follows:
#Quota target   type                 disk    files   thold   sdisk   sfile
#-----------    ----                 ----    -----   -----   -----   -----
*               user@/vol/vol1       50M      -       45M
jsmith 	        user@/vol/vol1       80m      -       75M
*               tree@/vol/vol1       20G
*               user@/vol/vol1/proj1 10M
Now a quota report looks like this:
filer1> quota report 
                                 K-Bytes             Files
Type       ID    Volume    Tree  Used      Limit     Used    Limit   Quota Specifier
----- -------- -------- -------- --------- --------- ------- ------- ---------------
user         *  vol1        -         0     51200       0       -     *
user    jsmith  vol1        -         0     81920      57       -     jsmith
tree         *  vol1        -         0  20971520       0       -     *
user         *  vol1    proj1         0     10240       0       -     *
tree         1  vol1    proj1         0  20971520       1       -     /vol/vol1/proj1
tree         2  vol1    proj2         0  20971520       1       -     /vol/vol1/proj2
user         *  vol1    proj2         0     51200       0       - 
user      root  vol1    proj2         0         -       1       - 
user      root  vol1        -         0         -       3       - 
user      root  vol1    proj1         0         -       1       - 
The new report entry that appears as a result of the line you added is this one:user * vol1 proj1 0 10240 0 - *However, now your phone is ringing. It’s jsmith again, complaining that her quota has been decreased. You ask where she is trying to put data, and she says “in proj1.” She is being prevented from writing more data to the proj1 qtree because the quota you created to override the default user quota (to give her more space) was on the volume. But now that you have added a default user quota on the proj1 qtree, that quota is being applied and limiting all users' space in that qtree, including jsmith. You must add a new line to the quotas file overriding the qtree default quota to give her more space in the proj1 qtree:
jsmith user@/vol/vol1/proj1 80M
This adds the following line to your quota report:
Type       ID    Volume    Tree  Used      Limit     Used    Limit   Quota Specifier
----- -------- -------- -------- --------- --------- ------- ------- ---------------
user   jsmith    vol1     proj1   57864     81920       57    -       jsmith