InomHitta mer dokumentationSupportresurser som ingår | Ladda ner denna bok i PDF (1709 KB)
Setting ZFS Quotas and ReservationsYou can use the quota property to set a limit on the amount of space a file system can use. In addition, you can use the reservation property to guarantee that some amount of space is available to a file system. Both properties apply to the dataset they are set on and all descendents of that dataset. That is, if a quota is set on the tank/home dataset, the total amount of space used by tank/home and all of its descendents cannot exceed the quota. Similarly, if tank/home is given a reservation, tank/home and all of its descendents draw from that reservation. The amount of space used by a dataset and all of its descendents is reported by the used property. The refquota and refreservation properties are available to manage file system space without accounting for space consumed by descendents, such as snapshots and clones. In this Solaris release, you can set a user or group quota on the amount of space consumed by files that are owned by a particular user or group. The user and group quota properties cannot be set on a volume, on a file system before file system version 4, or on a pool before pool version 15. Consider the following points to determine which quota and reservations features might better manage your file systems:
For more information about setting quotas and reservations, see Setting Quotas on ZFS File Systemsand Setting Reservations on ZFS File Systems. Setting Quotas on ZFS File SystemsZFS quotas can be set and displayed by using the zfs set and zfs get commands. In the following example, a quota of 10 Gbytes is set on tank/home/bonwick.
ZFS quotas also impact the output of the zfs list and df commands. For example:
Note that although tank/home has 33.5 Gbytes of space available, tank/home/bonwick and tank/home/bonwick/ws only have 10 Gbytes of space available, due to the quota on tank/home/bonwick. You cannot set a quota to an amount less than is currently being used by a dataset. For example:
You can set a refquota on a dataset that limits the amount of space that the dataset can consume. This hard limit does not include space that is consumed by snapshots and clones. For example:
For additional convenience, you can set another quota on a dataset to help manage the space that is consumed by snapshots. For example:
In this scenario, studentA might reach the refquota (10 Gbytes) hard limit, but can remove files to recover, even if snapshots exist. In the above example, the smaller of the two quotas (10 Gbytes versus 20 Gbytes) is displayed in the zfs list output. To see the value of both quotas, use the zfs get command. For example:
Setting User or Group Quotas on a ZFS File SystemYou can set a user or a group quota by using the zfs userquota and zfs groupquota commands as follows:
Display the current user quota or group quota as follows:
You can display general user and group space usage by querying the following properties:
If you want to identify individual user or group space usage, query the following properties:
The user and group quota properties are not displayed by using the zfs get all dataset command that displays a listing of all file system properties. You can remove a user or group quota as follows:
ZFS user and group quotas provide the following features:
Enforcement of user or group quotas might be delayed by several seconds. This delay means that users might exceed their quota before the system notices that they are over quota and refuses additional writes with the EDQUOT error message. You can use the legacy quota command to review user quotas in an NFS environment, for example, where a ZFS file system is mounted. Without any options, the quota command only displays output if the user's quota is exceeded. For example:
If you reset the quota and the quota limit is no longer exceeded, you will need to use the quota -v command to review the user's quota. For example:
Setting Reservations on ZFS File SystemsA ZFS reservation is an allocation of space from the pool that is guaranteed to be available to a dataset. As such, you cannot reserve space for a dataset if that space is not currently available in the pool. The total amount of all outstanding unconsumed reservations cannot exceed the amount of unused space in the pool. ZFS reservations can be set and displayed by using the zfs set and zfs get commands. For example:
ZFS reservations can affect the output of the zfs list command. For example:
Note that tank/home is using 5 Gbytes of space, although the total amount of space referred to by tank/home and its descendents is much less than 5 Gbytes. The used space reflects the space reserved for tank/home/moore. Reservations are considered in the used space of the parent dataset and do count against its quota, reservation, or both.
A dataset can use more space than its reservation, as long as space is available in the pool that is unreserved and the dataset's current usage is below its quota. A dataset cannot consume space that has been reserved for another dataset. Reservations are not cumulative. That is, a second invocation of zfs set to set a reservation does not add its reservation to the existing reservation. Rather, the second reservation replaces the first reservation.
You can set a refreservation to guarantee space for a dataset that does not include space consumed by snapshots and clones. The refreservation reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations. For example:
You can also set a reservation on the same dataset to guarantee dataset space and snapshot space. For example:
Regular reservations are accounted for in the parent's used space. In the above example, the smaller of the two quotas (10 Gbytes versus 20 Gbytes) is displayed in the zfs list output. To see the value of both quotas, use the zfs get command. For example:
If refreservation is set, a snapshot is only allowed if enough free pool space exists outside of this reservation to accommodate the current number of referenced bytes in the dataset. |
||||||||||||||||||||