These examples help you 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:
You decide to impose a hard limit of 50 MB for each user in vol1, by using the following quotas file:
#Quota target type disk files thold sdisk sfile #----------- ---- --- ----- ---- ----- ----- * user@/vol/vol1 50MIf 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).
#Quota target type disk files thold sdisk sfile #----------- ---- --- ----- ---- ----- ----- * user@/vol/vol1 50M jsmith user@/vol/vol1 80MNow, jsmith can use up to 80 MB of space on vol1, even though all other users are still limited to 50 MB.
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; therefore, 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.
#Quota target type disk files thold sdisk sfile #----------- ---- ---- ----- ----- ----- ----- * user@/vol/vol1 50M - 45M jsmith user@/vol/vol1 80M - 75MIt is necessary to add a dash (-) in the Files field as a placeholder because the Threshold field appears after the Files field in the quotas file.
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.
Suppose you need to partition some space for two projects. You can create two qtrees, named proj1 and proj2, to accommodate those projects within vol1. Creating qtrees does not cause any change for the 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.
#Quota target type disk files thold sdisk sfile #----------- ---- ---- ----- ----- ----- ----- * user@/vol/vol1 50M - 45M jsmith user@/vol/vol1 80M - 75M * tree@/vol/vol1 20GNote that the correct type is tree, not qtree.
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 -The quota report in the example contains the following new lines:
This quota is derived from the default user quota that was 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, quotas were enabled on qtrees as a result of which the derived quota was created:user * vol1 proj1 0 51200 46080 0 -
#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 10MThe resulting quota report is similar to the following:
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 following new entry appears in the quota report:user * vol1 proj1 0 10240 0 - *
However, this attempt to limit space to users in the proj1 qtree also reduces the amount of space that was originally assigned to the user jsmith. The user is prevented from writing more data to the proj1 qtree because the quota that was created to override the default user quota is on the volume vol1.
jsmith user@/vol/vol1/proj1 80MThis entry adds the following line to the quota report:
Type ID Volume Tree Used Limit Used Limit Quota Specifier ----- -------- -------- -------- --------- --------- ------- ------- --------------- user jsmith vol1 proj1 57864 81920 57 - jsmith