Contained WithinFind More DocumentationFeatured Support Resources | Download this book in PDF (1709 KB)
Chapter 6 Managing ZFS File SystemsThis chapter provides detailed information about managing ZFS file systems. Concepts such as hierarchical file system layout, property inheritance, and automatic mount point management and share interactions are included in this chapter. A ZFS file system is built on top of a storage pool. File systems can be dynamically created and destroyed without requiring you to allocate or format any underlying space. Because file systems are so lightweight and because they are the central point of administration in ZFS, you are likely to create many of them. ZFS file systems are administered by using the zfs command. The zfs command provides a set of subcommands that perform specific operations on file systems. This chapter describes these subcommands in detail. Snapshots, volumes, and clones are also managed by using this command, but these features are only covered briefly in this chapter. For detailed information about snapshots and clones, see Chapter 7, Working With ZFS Snapshots and Clones. For detailed information about ZFS volumes, see ZFS Volumes. Note – The term dataset is used in this chapter as a generic term to refer to a file system, snapshot, clone, or volume. The following sections are provided in this chapter: Creating and Destroying ZFS File SystemsZFS file systems can be created and destroyed by using the zfs create and zfs destroy commands. Creating a ZFS File SystemZFS file systems are created by using the zfs create command. The create subcommand takes a single argument: the name of the file system to create. The file system name is specified as a path name starting from the name of the pool: pool-name/[filesystem-name/]filesystem-name The pool name and initial file system names in the path identify the location in the hierarchy where the new file system will be created. The last name in the path identifies the name of the file system to be created. The file system name must satisfy the naming conventions defined in ZFS Component Naming Requirements. In the following example, a file system named bonwick is created in the tank/home file system.
ZFS automatically mounts the newly created file system if it is created successfully. By default, file systems are mounted as /dataset, using the path provided for the file system name in the create subcommand. In this example, the newly created bonwick file system is at /tank/home/bonwick. For more information about automanaged mount points, see Managing ZFS Mount Points. For more information about the zfs create command, see zfs(1M). You can set file system properties when the file system is created. In the following example, a mount point of /export/zfs is specified and is created for the tank/home file system.
For more information about file system properties, see Introducing ZFS Properties. Destroying a ZFS File SystemTo destroy a ZFS file system, use the zfs destroy command. The destroyed file system is automatically unmounted and unshared. For more information about automatically managed mounts or automatically managed shares, see Automatic Mount Points. In the following example, the tabriz file system is destroyed.
No confirmation prompt appears with the destroy subcommand. Use it with extreme caution. If the file system to be destroyed is busy and so cannot be unmounted, the zfs destroy command fails. To destroy an active file system, use the -f option. Use this option with caution as it can unmount, unshare, and destroy active file systems, causing unexpected application behavior.
The zfs destroy command also fails if a file system has children. To recursively destroy a file system and all its descendents, use the -r option. Note that a recursive destroy also destroys snapshots so use this option with caution.
If the file system to be destroyed has indirect dependents, even the recursive destroy command described above fails. To force the destruction of all dependents, including cloned file systems outside the target hierarchy, the -R option must be used. Use extreme caution with this option.
No confirmation prompt appears with the -f, -r, or -R options so use these options carefully. For more information about snapshots and clones, see Chapter 7, Working With ZFS Snapshots and Clones. Renaming a ZFS File SystemFile systems can be renamed by using the zfs rename command. Using the rename subcommand can perform the following operations:
The following example uses the rename subcommand to do a simple rename of a file system:
This example renames the kustarz file system to kustarz_old. The following example shows how to use zfs rename to relocate a file system.
In this example, the maybee file system is relocated from tank/home to tank/ws. When you relocate a file system through rename, the new location must be within the same pool and it must have enough space to hold this new file system. If the new location does not have enough space, possibly because it has reached its quota, the rename will fail. For more information about quotas, see Setting ZFS Quotas and Reservations. The rename operation attempts an unmount/remount sequence for the file system and any descendent file systems. The rename fails if the operation is unable to unmount an active file system. If this problem occurs, you will need to force unmount the file system. For information about renaming snapshots, see Renaming ZFS Snapshots. Introducing ZFS PropertiesProperties are the main mechanism that you use to control the behavior of file systems, volumes, snapshots, and clones. Unless stated otherwise, the properties defined in this section apply to all the dataset types. Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control ZFS file system behavior. In addition, native properties are either settable or read-only. User properties have no effect on ZFS file system behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information on user properties, see ZFS User Properties. Most settable properties are also inheritable. An inheritable property is a property that, when set on a parent, is propagated down to all of its descendents. All inheritable properties have an associated source. The source indicates how a property was obtained. The source of a property can have the following values:
The following table identifies both read-only and settable native ZFS file system properties. Read-only native properties are identified as such. All other native properties listed in this table are settable. For information about user properties, see ZFS User Properties. Table 6–1 ZFS Native Property Descriptions
ZFS Read-Only Native PropertiesRead-only native properties are properties that can be retrieved but cannot be set. Read-only native properties are not inherited. Some native properties are specific to a particular type of dataset. In such cases, the particular dataset type is mentioned in the description in Table 6–1. The read-only native properties are listed here and are described in Table 6–1.
For more information on space accounting, including the used, referenced, and available properties, see ZFS Space Accounting. The used PropertyThe amount of space consumed by this dataset and all its descendents. This value is checked against the dataset's quota and reservation. The space used does not include the dataset's reservation, but does consider the reservation of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that is freed if the dataset is recursively destroyed, is the greater of its space used and its reservation. When snapshots are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. The space that is used by a snapshot accounts for its unique data. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots. For more information about snapshots and space issues, see Out of Space Behavior. The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using fsync(3c) or O_SYNC does not necessarily guarantee that the space usage information will be updated immediately. The usedbychildren, usedbydataset, usedbyrefreservation, and usedbysnapshots property information can be displayed with the zfs list -o space command. These properties break down the used property into space that is consumed by descendents. For more information, see Table 6–1. Settable ZFS Native PropertiesSettable native properties are properties whose values can be both retrieved and set. Settable native properties are set by using the zfs set command, as described in Setting ZFS Properties or by using the zfs create command as described in Creating a ZFS File System. With the exceptions of quotas and reservations, settable native properties are inherited. For more information about quotas and reservations, see Setting ZFS Quotas and Reservations. Some settable native properties are specific to a particular type of dataset. In such cases, the particular dataset type is mentioned in the description in Table 6–1. If not specifically mentioned, a property applies to all dataset types: file systems, volumes, clones, and snapshots. The settable properties are listed here and are described in Table 6–1.
The canmount PropertyIf this property is set to off, the file system cannot be mounted by using the zfs mount or zfs mount -a commands. Setting this property is similar to setting the mountpoint property to none, except that the dataset still has a normal mountpoint property that can be inherited. For example, you can set this property to off, establish inheritable properties for descendent file systems, but the file system itself is never mounted nor is it accessible to users. In this case, the parent file system with this property set to off is serving as a container so that you can set attributes on the container, but the container itself is never accessible. In the following example, userpool is created and the canmount property is set to off. Mount points for descendent user file systems are set to one common mount point, /export/home. Properties that are set on the parent file system are inherited by descendent file systems, but the parent file system itself is never mounted.
Setting the canmount property to noauto means that the dataset can only be mounted explicitly, not automatically. This setting is used by the Solaris upgrade software so that only those datasets belonging to the active boot environment (BE) are mounted at boot time. The recordsize PropertySpecifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. ZFS automatically adjust block sizes according to internal algorithms optimized for typical access patterns. For databases that create very large files but access the files in small random chunks, these algorithms may be suboptimal. Specifying a recordsize greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance. The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes. Changing the file system's recordsize only affects files created afterward. Existing files are unaffected. This property can also be referred to by its shortened column name, recsize. The volsize PropertyThe logical size of the volume. By default, creating a volume establishes a reservation for the same amount. Any changes to volsize are reflected in an equivalent change to the reservation. These checks are used to prevent unexpected behavior for users. A volume that contains less space than it claims is available can result in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use, particularly when you shrink the size. Extreme care should be used when adjusting the volume size. Though not recommended, you can create a sparse volume by specifying the -s flag to zfs create -V, or by changing the reservation once the volume has been created. A sparse volume is defined as a volume where the reservation is not equal to the volume size. For a sparse volume, changes to volsize are not reflected in the reservation. For more information about using volumes, see ZFS Volumes. ZFS User PropertiesIn addition to the standard native properties, ZFS supports arbitrary user properties. User properties have no effect on ZFS behavior, but you can use them to annotate datasets with information that is meaningful in your environment. User property names must conform to the following characteristics:
The expected convention is that the property name is divided into the following two components but this namespace is not enforced by ZFS:
When making programmatic use of user properties, use a reversed DNS domain name for the module component of property names to reduce the chance that two independently-developed packages will use the same property name for different purposes. Property names that begin with "com.sun." are reserved for use by Sun Microsystems. The values of user properties have the following characteristics:
For example:
All of the commands that operate on properties, such as zfs list, zfs get, zfs set, and so on, can be used to manipulate both native properties and user properties. For example:
To clear a user property, use the zfs inherit command. For example:
If the property is not defined in any parent dataset, it is removed entirely. Querying ZFS File System InformationThe zfs list command provides an extensible mechanism for viewing and querying dataset information. Both basic and complex queries are explained in this section. Listing Basic ZFS InformationYou can list basic dataset information by using the zfs list command with no options. This command displays the names of all datasets on the system including their used, available, referenced, and mountpoint properties. For more information about these properties, see Introducing ZFS Properties. For example:
You can also use this command to display specific datasets by providing the dataset name on the command line. Additionally, use the -r option to recursively display all descendents of that dataset. For example:
You can use the zfs list command with the mount point of a file system. For example:
The following example shows how to display tank/home/chua and all of its descendent datasets.
For additional information about the zfs list command, see zfs(1M). Creating Complex ZFS QueriesThe zfs list output can be customized by using the -o, -f, and -H options. You can customize property value output by using the -o option and a comma-separated list of desired properties. Supply any dataset property as a valid value. For a list of all supported dataset properties, see Introducing ZFS Properties. In addition to the properties defined there, the -o option list can also contain the literal name to indicate that the output should include the name of the dataset. The following example uses zfs list to display the dataset name, along with the sharenfs and mountpoint properties.
You can use the -t option to specify the types of datasets to display. The valid types are described in the following table. Table 6–2 Types of ZFS Datasets
The -t options takes a comma-separated list of the types of datasets to be displayed. The following example uses the -t and -o options simultaneously to show the name and used property for all file systems:
You can use the -H option to omit the zfs list header from the generated output. With the -H option, all white space is output as tabs. This option can be useful when you need parseable output, for example, when scripting. The following example shows the output generated from using the zfs list command with the -H option:
Managing ZFS PropertiesDataset properties are managed through the zfs command's set, inherit, and get subcommands. Setting ZFS PropertiesYou can use the zfs set command to modify any settable dataset property. Or, you can use the zfs create command to set properties when the dataset is created. For a list of settable dataset properties, see Settable ZFS Native Properties. The zfs set command takes a property/value sequence in the format of property=value and a dataset name. The following example sets the atime property to off for tank/home. Only one property can be set or modified during each zfs set invocation.
In addition, any file system property can be set when the file system is created. For example:
You can specify numeric properties by using the following easy to understand suffixes (in order of magnitude): BKMGTPEZ. Any of these suffixes can be followed by an optional b, indicating bytes, with the exception of the B suffix, which already indicates bytes. The following four invocations of zfs set are equivalent numeric expressions indicating that the quota property be set to the value of 50 Gbytes on the tank/home/marks file system:
Values of non-numeric properties are case-sensitive and must be lowercase, with the exception of mountpoint and sharenfs. The values of these properties can have mixed upper and lower case letters. For more information about the zfs set command, see zfs(1M). Inheriting ZFS PropertiesAll settable properties, with the exception of quotas and reservations, inherit their value from their parent, unless a quota or reservation is explicitly set on the child. If no ancestor has an explicit value set for an inherited property, the default value for the property is used. You can use the zfs inherit command to clear a property setting, thus causing the setting to be inherited from the parent. The following example uses the zfs set command to turn on compression for the tank/home/bonwick file system. Then, zfs inherit is used to unset the compression property, thus causing the property to inherit the default setting of off. Because neither home nor tank have the compression property set locally, the default value is used. If both had compression on, the value set in the most immediate ancestor would be used (home in this example).
The inherit subcommand is applied recursively when the -r option is specified. In the following example, the command causes the value for the compression property to be inherited by tank/home and any descendents it might have.
Note – Be aware that the use of the -r option clears the current property setting for all descendent datasets. For more information about the zfs command, see zfs(1M). Querying ZFS PropertiesThe simplest way to query property values is by using the zfs list command. For more information, see Listing Basic ZFS Information. However, for complicated queries and for scripting, use the zfs get command to provide more detailed information in a customized format. You can use the zfs get command to retrieve any dataset property. The following example shows how to retrieve a single property on a dataset:
The fourth column, SOURCE, indicates where this property value has been set. The following table defines the meaning of the possible source values. Table 6–3 Possible SOURCE Values (zfs get)
You can use the special keyword all to retrieve all dataset properties. The following examples use the all keyword to retrieve all existing dataset properties:
Note – The casesensitivity, nbmand, normalization, sharesmbutf8only, and vscan properties are set to a fixed value and are not supported in the Solaris 10 release. The -s option to zfs get enables you to specify, by source type, the properties to display. This option takes a comma-separated list indicating the desired source types. Only properties with the specified source type are displayed. The valid source types are local, default, inherited, temporary, and none. The following example shows all properties that have been locally set on pool.
Any of the above options can be combined with the -r option to recursively display the specified properties on all children of the specified dataset. In the following example, all temporary properties on all datasets within tank are recursively displayed:
A recent feature enables you to make queries with the zfs get command without specifying a target file system, which means it operates on all pools or file systems. For example:
For more information about the zfs get command, see zfs(1M). Querying ZFS Properties for ScriptingThe zfs get command supports the -H and -o options, which are designed for scripting. The -H option indicates that any header information should be omitted and that all white space be replaced with a tab. Uniform white space allows for easily parseable data. You can use the -o option to customize the output. This option takes a comma-separated list of values to be output. All properties defined in Introducing ZFS Properties, along with the literals name, value, property and source can be supplied in the -o list. The following example shows how to retrieve a single value by using the -H and -o options of zfs get.
The -p option reports numeric values as their exact values. For example, 1 Mbyte would be reported as 1000000. This option can be used as follows:
You can use the -r option along with any of the above options to recursively retrieve the requested values for all descendents. The following example uses the -r, -o, and -H options to retrieve the dataset name and the value of the used property for export/home and its descendents, while omitting any header output:
Mounting and Sharing ZFS File SystemsThis section describes how mount points and shared file systems are managed in ZFS. Managing ZFS Mount PointsBy default, all ZFS file systems are mounted by ZFS at boot by using the Service Management Facility 's (SMF)svc://system/filesystem/local service. File systems are mounted under /path, where path is the name of the file system. You can override the default mount point by setting the mountpoint property to a specific path by using the zfs set command. ZFS automatically creates this mount point, if needed, and automatically mounts this file system when the zfs mount -a command is invoked, without requiring you to edit the /etc/vfstab file. The mountpoint property is inherited. For example, if pool/home has mountpoint set to /export/stuff, then pool/home/user inherits /export/stuff/user for its mountpoint property. The mountpoint property can be set to none to prevent the file system from being mounted. In addition, the canmount property is available for determining whether a file system can be mounted. For more information about the canmount property, see The canmount Property. If desired, file systems can also be explicitly managed through legacy mount interfaces by setting the mountpoint property to legacy by using zfs set. Doing so prevents ZFS from automatically mounting and managing this file system. Legacy tools including the mount and umount commands, and the /etc/vfstab file must be used instead. For more information about legacy mounts, see Legacy Mount Points. When changing mount point management strategies, the following behaviors apply:
Automatic Mount Points
You can also set the default mount point for the root dataset at creation time by using zpool create's -m option. For more information about creating pools, see Creating a ZFS Storage Pool. Any dataset whose mountpoint property is not legacy is managed by ZFS. In the following example, a dataset is created whose mount point is automatically managed by ZFS.
You can also explicitly set the mountpoint property as shown in the following example:
When the mountpoint property is changed, the file system is automatically unmounted from the old mount point and remounted to the new mount point. Mount point directories are created as needed. If ZFS is unable to unmount a file system due to it being active, an error is reported and a forced manual unmount is necessary. Legacy Mount PointsYou can manage ZFS file systems with legacy tools by setting the mountpoint property to legacy. Legacy file systems must be managed through the mount and umount commands and the /etc/vfstab file. ZFS does not automatically mount legacy file systems on boot, and the ZFS mount and umount commands do not operate on datasets of this type. The following examples show how to set up and manage a ZFS dataset in legacy mode:
To automatically mount a legacy file system on boot, you must add an entry to the /etc/vfstab file. The following example shows what the entry in the /etc/vfstab file might look like:
Note that the device to fsck and fsck pass entries are set to -. This syntax is because the fsck command is not applicable to ZFS file systems. For more information regarding data integrity and the lack of need for fsck in ZFS, see Transactional Semantics. Mounting ZFS File SystemsZFS automatically mounts file systems when file systems are created or when the system boots. Use of the zfs mount command is necessary only when changing mount options or explicitly mounting or unmounting file systems. The zfs mount command with no arguments shows all currently mounted file systems that are managed by ZFS. Legacy managed mount points are not displayed. For example:
You can use the -a option to mount all ZFS managed file systems. Legacy managed file systems are not mounted. For example:
By default, ZFS does not allow mounting on top of a nonempty directory. To force a mount on top of a nonempty directory, you must use the -O option. For example:
Legacy mount points must be managed through legacy tools. An attempt to use ZFS tools results in an error. For example:
When a file system is mounted, it uses a set of mount options based on the property values associated with the dataset. The correlation between properties and mount options is as follows:
The mount option nosuid is an alias for nodevices,nosetuid. Using Temporary Mount PropertiesIf any of the above options are set explicitly by using the-o option with the zfs mount command, the associated property value is temporarily overridden. These property values are reported as temporary by the zfs get command and revert back to their original settings when the file system is unmounted. If a property value is changed while the dataset is mounted, the change takes effect immediately, overriding any temporary setting. In the following example, the read-only mount option is temporarily set on the tank/home/perrin file system:
In this example, the file system is assumed to be unmounted. To temporarily change a property on a file system that is currently mounted, you must use the special remount option. In the following example, the atime property is temporarily changed to off for a file system that is currently mounted:
For more information about the zfs mount command, see zfs(1M). Unmounting ZFS File SystemsYou can unmount file systems by using the zfs unmount subcommand. The unmount command can take either the mount point or the file system name as arguments. In the following example, a file system is unmounted by file system name:
In the following example, the file system is unmounted by mount point:
The unmount command fails if the file system is active or busy. To forcibly unmount a file system, you can use the -f option. Be cautious when forcibly unmounting a file system, if its contents are actively being used. Unpredictable application behavior can result.
To provide for backwards compatibility, the legacy umount command can be used to unmount ZFS file systems. For example:
For more information about the zfs umount command, see zfs(1M). Sharing and Unsharing ZFS File SystemsSimilar to mount points, ZFS can automatically share file systems by using the sharenfs property. Using this method, you do not have to modify the /etc/dfs/dfstab file when a new file system is added. The sharenfs property is a comma-separated list of options to pass to the share command. The special value on is an alias for the default share options, which are read/write permissions for anyone. The special value off indicates that the file system is not managed by ZFS and can be shared through traditional means, such as the /etc/dfs/dfstab file. All file systems whose sharenfs property is not off are shared during boot. Controlling Share SemanticsBy default, all file systems are unshared. To share a new file system, use zfs set syntax similar to the following:
The property is inherited, and file systems are automatically shared on creation if their inherited property is not off. For example:
Both tank/home/bricker and tank/home/tabriz are initially shared writable because they inherit the sharenfs property from tank/home. Once the property is set to ro (readonly), tank/home/tabriz is shared read-only regardless of the sharenfs property that is set for tank/home. Unsharing ZFS File SystemsWhile most file systems are automatically shared and unshared during boot, creation, and destruction, file systems sometimes need to be explicitly unshared. To do so, use the zfs unshare command. For example:
This command unshares the tank/home/tabriz file system. To unshare all ZFS file systems on the system, you need to use the -a option.
Sharing ZFS File SystemsMost of the time the automatic behavior of ZFS, sharing on boot and creation, is sufficient for normal operation. If, for some reason, you unshare a file system, you can share it again by using the zfs share command. For example:
You can also share all ZFS file systems on the system by using the -a option.
Legacy Share BehaviorIf the sharenfs property is off, then ZFS does not attempt to share or unshare the file system at any time. This setting enables you to administer through traditional means such as the /etc/dfs/dfstab file. Unlike the traditional mount command, the traditional share and unshare commands can still function on ZFS file systems. As a result, you can manually share a file system with options that are different from the settings of the sharenfs property. This administrative model is discouraged. Choose to either manage NFS shares completely through ZFS or completely through the /etc/dfs/dfstab file. The ZFS administrative model is designed to be simpler and less work than the traditional model. However, in some cases, you might still want to control file system sharing behavior through the familiar model. 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. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||