4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
20 .\" Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
21 .TH zfs 1M "8 Apr 2008" "SunOS 5.11" "System Administration Commands"
23 zfs \- configures ZFS file systems
32 \fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR
37 \fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR
42 \fBzfs\fR \fBdestroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
47 \fBzfs\fR \fBsnapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
52 \fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
57 \fBzfs\fR \fBclone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
62 \fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR
67 \fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
68 \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
73 \fBzfs\fR \fBrename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR
78 \fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR
83 \fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
84 [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
89 \fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...
94 \fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...]
95 \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
100 \fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...
105 \fBzfs\fR \fBupgrade\fR [\fB-v\fR]
110 \fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR
115 \fBzfs\fR \fBmount\fR
120 \fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR
125 \fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
130 \fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR
135 \fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
140 \fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fB-iI\fR] \fIsnapshot\fR] \fIsnapshot\fR
145 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
150 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR
155 \fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...]
156 \fIfilesystem\fR|\fIvolume\fR
161 \fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
166 \fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
171 \fBzfs\fR \fBallow\fR \fB-s\fR @setname \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
176 \fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]]
177 \fIfilesystem\fR|\fIvolume\fR
182 \fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
187 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR
192 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
197 \fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
201 \fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
207 The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A
208 dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
212 pool/{filesystem,volume,snapshot}
219 where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
222 A dataset can be one of the following:
227 \fB\fIfile system\fR\fR
231 A standard \fBPOSIX\fR file system. \fBZFS\fR file systems can be mounted within the standard file system namespace and behave like any other file system.
242 A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments. Volumes cannot be used in a non-global zone.
253 A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
256 .SS "ZFS File System Hierarchy"
259 A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system hierarchy.
262 The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage characteristics, however, are managed by the \fBzpool\fR(1M) command.
265 See \fBzpool\fR(1M) for more information on creating and administering pools.
269 A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset.
272 Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
275 File system snapshots can be accessed under the ".zfs/snapshot" directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the ".zfs" directory can be controlled by the "snapdir"
280 A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
283 Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The "origin"
284 property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
287 The clone parent-child dependency relationship can be reversed by using the "\fBpromote\fR" subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone
292 Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system is likely to be numerous. To cope with this, \fBZFS\fR automatically manages mounting and unmounting file systems without the need to edit the \fB/etc/vfstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time.
295 By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR is the name of the file system in the \fBZFS\fR namespace. Directories are created and destroyed as needed.
298 A file system can also have a mount point set in the "mountpoint" property. This directory is created as needed, and \fBZFS\fR automatically mounts the file system when the "\fBzfs mount -a\fR" command is invoked (without editing \fB/etc/vfstab\fR). The mountpoint property can be inherited, so if \fBpool/home\fR has a mount point of \fB/export/stuff\fR, then \fBpool/home/user\fR automatically inherits a mount point of \fB/export/stuff/user\fR.
301 A file system mountpoint property of "none" prevents the file system from being mounted.
304 If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage
305 the file system, and the administrator is responsible for mounting and unmounting the file system.
309 A \fBZFS\fR file system can be added to a non-global zone by using zonecfg's "\fBadd fs\fR" subcommand. A \fBZFS\fR file system that is added to a non-global zone must have its mountpoint property set to legacy.
312 The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted.
315 A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or
316 any of its children. However, the "quota" property is controlled by the global administrator.
319 A \fBZFS\fR volume can be added as a device to a non-global zone by using zonecfg's "\fBadd device\fR" subcommand. However, its physical properties can only be modified by the global administrator.
322 For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M).
325 After a dataset is delegated to a non-global zone, the "zoned" property is automatically set. A zoned file system cannot be mounted in the global zone, since the zone administrator might have to set the mount point to an unacceptable value.
328 The global administrator can forcibly clear the "zoned" property, though this should be done with extreme care. The global administrator should verify that all the mount points are acceptable before clearing the property.
329 .SS "Native Properties"
332 Properties are divided into two types, native properties and user defined properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior,
333 but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section.
336 Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Snapshot properties can not be edited; they always inherit their inheritable properties. Properties
337 that are not applicable to snapshots are not displayed.
340 The values of numeric properties can be specified using the following human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications:
344 "1536M", "1.5g", "1.50GB".
351 The values of non-numeric properties are case sensitive and must be lowercase, except for "mountpoint", "sharenfs" and "sharesmb".
354 The following native properties consist of read-only statistics about the dataset. These properties cannot be set, nor are they inherited. Native properties apply to all dataset types unless otherwise noted.
363 The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets
366 This property can also be referred to by its shortened column name, "avail".
377 The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running "zfs set compression=on \fIdataset\fR". The default value is "off".
388 The time this dataset was created.
399 For file systems, indicates whether the file system is currently mounted. This property can be either "yes" or "no".
410 For cloned file systems or volumes, the snapshot from which the clone was created. The origin cannot be destroyed (even with the \fB-r\fR or \fB-f\fR options) so long as a clone exists.
421 The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are
424 This property can also be referred to by its shortened column name, "refer".
435 The type of dataset: "filesystem", "volume", "snapshot", or "clone".
446 The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets.
447 The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
449 When snapshots (see the "Snapshots" section) 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
450 the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
452 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 \fBfsync\fR(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
459 \fBvolblocksize=\fIblocksize\fR\fR
463 For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes
464 to 128 Kbytes is valid.
466 This property can also be referred to by its shortened column name, "volblock".
471 The following native properties can be used to change the behavior of a \fBZFS\fR dataset.
476 \fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR\fR
480 Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit"
481 property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBrestricted\fR" (the default) removes the "\fBwrite_acl\fR" and "\fBwrite_owner\fR" permissions when the \fBACL\fR entry is inherited. A file system with an "aclinherit" property value of "\fBpassthrough\fR" inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited.
483 When the property value is set to "\fBpassthrough\fR," files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode
484 from the application.
491 \fBaclmode=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR
495 Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR"
496 deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" property of "\fBgroupmask\fR" (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission
497 bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an "aclmode" property of "\fBpassthrough\fR" indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
504 \fBatime=\fIon\fR | \fIoff\fR\fR
508 Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value
516 \fBcanmount=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR
520 If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". Setting this property to "\fBoff\fR" is similar to setting the "mountpoint"
521 property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" property, which can be inherited. Setting this property to "\fBoff\fR" allows datasets to be used solely as a mechanism to inherit properties. One example
522 of setting canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
524 When the "\fBnoauto\fR" option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the "\fBzfs mount -a\fR" command or unmounted
525 by the "\fBzfs unmount -a\fR" command.
527 This property is not inherited.
534 \fBchecksum=\fIon\fR | \fIoff\fR | \fIfletcher2\fR, | \fIfletcher4\fR | \fIsha256\fR\fR
538 Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher4\fR, but this may change in future releases). The value "off" disables integrity
539 checking on user data. Disabling checksums is NOT a recommended practice.
546 \fBcompression=\fIon\fR | \fIoff\fR | \fIlzjb\fR | \fIgzip\fR | \fIgzip-N\fR\fR
550 Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip"
551 compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is
552 an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
554 This property can also be referred to by its shortened column name "compress".
561 \fBcopies=\fB1\fR | \fB2\fR | \fB3\fR\fR
565 Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or raid-z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated
566 file and dataset, changing the "used" property and counting against quotas and reservations.
568 Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "\fB-o\fR copies=" option.
575 \fBdevices=\fIon\fR | \fIoff\fR\fR
579 Controls whether device nodes can be opened on this file system. The default value is "on".
586 \fBexec=\fIon\fR | \fIoff\fR\fR
590 Controls whether processes can be executed from within this file system. The default value is "on".
597 \fBmountpoint=\fIpath\fR | \fInone\fR | \fIlegacy\fR\fR
601 Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used.
603 When the mountpoint property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was
604 previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
611 \fBnbmand=\fIon\fR | \fIoff\fR\fR
615 Controls whether the file system should be mounted with "\fBnbmand\fR" (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(1M) for more information on "\fBnbmand\fR" mounts.
622 \fBquota=\fIsize\fR | \fInone\fR\fR
626 Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already
627 has a quota does not override the ancestor's quota, but rather imposes an additional limit.
629 Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
636 \fBreadonly=\fIon\fR | \fIoff\fR\fR
640 Controls whether this dataset can be modified. The default value is "off".
642 This property can also be referred to by its shortened column name, "rdonly".
649 \fBrecordsize=\fIsize\fR\fR
653 Specifies 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. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical
656 For databases that create very large files but access them 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
657 purpose file systems is strongly discouraged, and may adversely affect performance.
659 The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
661 Changing the file system's \fBrecordsize\fR only affects files created afterward; existing files are unaffected.
663 This property can also be referred to by its shortened column name, "recsize".
670 \fBrefquota=\fIsize\fR | \fInone\fR\fR
674 Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used by descendents, including file systems and snapshots.
681 \fBrefreservation=\fIsize\fR | \fInone\fR\fR
685 The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation
686 is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
688 If \fBrefreservation\fR is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
690 This property can also be referred to by its shortened column name, "refreserv".
697 \fBreservation=\fIsize\fR | \fInone\fR\fR
701 The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space
702 used, and count against the parent datasets' quotas and reservations.
704 This property can also be referred to by its shortened column name, "reserv".
711 \fBsetuid=\fIon\fR | \fIoff\fR\fR
715 Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is "on".
722 \fBshareiscsi=\fIon\fR | \fIoff\fR\fR
726 Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk".
727 The default value is "off". In the future, other target types might be supported. For example, "tape".
729 You might want to set "shareiscsi=on" for a file system so that all \fBZFS\fR volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
736 \fBsharesmb=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
740 Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the "\fBsharesmb\fR" property set to "off" is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the "zfs share" and "zfs unshare" commands. If the property is set to "on",
741 the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
743 Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore
744 (_) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset "\fBdata/home/john\fR"
745 is set to "name=john", then "\fBdata/home/john\fR" has a resource name of "john". If a child dataset of "\fBdata/home/john/backups\fR", it has a resource name of "john_backups".
747 When the "sharesmb" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to "off", or if they were shared before the property was changed. If the new property
748 is set to "off", the file systems are unshared.
755 \fBsharenfs=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
759 Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on",
760 the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
762 When the "sharenfs" property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously "off", or if they were shared before the property was changed. If the new property is "off",
763 the file systems are unshared.
770 \fBsnapdir=\fIhidden\fR | \fIvisible\fR\fR
774 Controls whether the ".zfs" directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is "hidden".
781 \fBversion=\fB1\fR|\fB2\fR|\fBcurrent\fR\fR
785 The on-disk version of this file system, which is independent of the pool version. This property can only be set to later supported versions. See "\fBzfs upgrade\fR".
792 \fBvolsize=\fIsize\fR\fR
796 For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are
797 reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
799 The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when
800 the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
802 Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the "\fBzfs create -V\fR" command, or by changing the reservation after the volume has been created.
803 A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
810 \fBvscan=\fBon\fR|\fBoff\fR\fR
814 Controls whether regular files should be scanned for viruses when a file is opened and closed. In addition to enabling this property, the virus scan service must also be enabled for virus scanning to occur. The default value is "off".
821 \fBxattr=\fBon\fR | \fBoff\fR\fR
825 Controls whether extended attributes are enabled for this file system. The default value is "\fBon\fR".
832 \fBzoned=\fIon\fR | \fIoff\fR\fR
836 Controls whether the dataset is managed from a non-global zone. See the "Zones" section for more information. The default value is "off".
841 The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the "\fBzfs create\fR" command, these properties are inherited from the parent dataset.
842 If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
847 \fBcasesensitivity = \fBsensitive\fR | \fBinsensitive\fR | \fBmixed\fR\fR
851 Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the "\fBcasesensitivity\fR" property is "\fBsensitive\fR."
852 Traditionally, UNIX and POSIX file systems have case-sensitive file names.
854 The "\fBmixed\fR" value for the "\fBcasesensitivity\fR" property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system
855 that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the "mixed" value behavior, see the \fIZFS Administration Guide\fR.
862 \fBnormalization =\fBnone\fR | \fBformD\fR | \fBformKCf\fR\fR
866 Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison
867 process. If this property is set to a legal value other than "\fBnone\fR," and the "\fButf8only\fR" property was left unspecified, the "\fButf8only\fR" property is automatically set to "\fBon\fR."
868 The default value of the "\fBnormalization\fR" property is "\fBnone\fR." This property cannot be changed after the file system is created.
875 \fBjailed =\fIon\fR | \fIoff\fR\fR
879 Controls whether the dataset is managed from within a jail. The default value is "off".
886 \fButf8only =\fBon\fR | \fBoff\fR\fR
890 Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to "\fBoff\fR," the normalization property must either not be
891 explicitly set or be set to "\fBnone\fR." The default value for the "\fButf8only\fR" property is "off." This property cannot be changed after the file system is created.
896 The "\fBcasesensitivity\fR," "\fBnormalization\fR," and "\fButf8only\fR" properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration
898 .SS "Temporary Mount Point Properties"
901 When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems,
902 its mount options are set according to its properties. The correlation between properties and mount options is as follows:
906 PROPERTY MOUNT OPTION
907 devices devices/nodevices
910 setuid setuid/nosetuid
918 In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for "nodevices,nosetuid".
919 These properties are reported as "temporary" by the "\fBzfs get\fR" command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
920 .SS "User Properties"
923 In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets.
926 User property names must contain a colon (":") character, to distinguish them from native properties. They might contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore
927 ("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\fR:\fIproperty\fR", but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters,
928 and cannot begin with a dash ("-").
931 When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for
932 different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
935 The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) can be used to manipulate both native properties and user properties.
936 Use the "\fBzfs inherit\fR" command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
937 .SS "Volumes as Swap or Dump Devices"
940 To set up a swap area, create a \fBZFS\fR volume of a specific size and then enable swap on that device. For more information, see the EXAMPLES section.
943 Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
946 Using a \fBZFS\fR volume as a dump device is not supported.
950 All subcommands that modify state are logged persistently to the pool in their original form.
959 Displays a help message.
966 \fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR\fR
970 Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the "mountpoint" property inherited from the parent.
979 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
980 the target filesystem already exists, the operation completes successfully.
987 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
991 Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
992 error results if the same property is specified in multiple \fB-o\fR options.
1001 \fB\fBzfs create\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR\fR
1005 Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents
1006 the logical size as exported by the device. By default, a reservation of equal size is created.
1008 \fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
1017 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If
1018 the target filesystem already exists, the operation completes successfully.
1029 Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
1036 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1040 Sets the specified property as if "\fBzfs set property=value\fR" was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An
1041 error results if the same property is specified in multiple \fB-o\fR options.
1048 \fB\fB-b\fR \fIblocksize\fR\fR
1052 Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting
1053 behavior is undefined.
1062 \fB\fBzfs destroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1066 Destroys the given dataset. By default, the command unshares any file systems that are currently shared, unmounts any file systems that are currently mounted, and refuses to destroy a dataset that has active dependents (children, snapshots, clones).
1075 Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
1086 Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
1097 Force an unmount of any file systems using the "\fBunmount -f\fR" command. This option has no effect on non-file systems or unmounted file systems.
1100 Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use.
1107 \fB\fBzfs snapshot\fR [\fB-r\fR] \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
1111 Creates a snapshot with the given name. See the "Snapshots" section for details.
1120 Recursively create snapshots of all descendent datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
1129 \fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
1133 Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than
1134 the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
1143 Recursively destroy any snapshots more recent than the one specified.
1154 Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
1165 Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
1174 \fB\fBzfs clone\fR [\fB-p\fR] \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
1178 Creates a clone of the given snapshot. See the "Clones" section for details. The target dataset can be located anywhere in the \fBZFS\fR hierarchy, and is created as the same type as the original.
1187 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
1196 \fB\fBzfs promote\fR \fIclone-filesystem\fR\fR
1200 Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the "origin" file system
1201 becomes a clone of the specified file system.
1203 The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the "origin" file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed
1204 by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The "\fBrename\fR" subcommand can be used to rename any conflicting snapshots.
1211 \fB\fBzfs rename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1215 \fB\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1220 rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
1224 Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does
1225 not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
1234 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent.
1243 \fB\fBzfs rename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR\fR
1247 Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively.
1254 \fB\fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]]\fR
1258 \fB[ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR
1262 Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all datasets are displayed and contain the following fields:
1266 name,used,available,referenced,mountpoint
1279 Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary whitespace.
1290 Recursively display any children of the dataset on the command line.
1297 \fB\fB-o\fR \fIproperty\fR\fR
1301 A comma-separated list of properties to display. The property must be one of the properties described in the "Native Properties" section, or the special value "name" to display the dataset name.
1308 \fB\fB-s\fR \fIproperty\fR\fR
1312 A property to use for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in the "Properties" section, or the special value "name" to sort by the dataset name. Multiple
1313 properties can be specified at one time using multiple \fB-s\fR property options. Multiple \fB-s\fR options are evaluated from left to right in decreasing order of importance.
1315 The following is a list of sorting criteria:
1320 Numeric types sort in numeric order.
1326 String types sort in alphabetical order.
1332 Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
1338 If no sorting options are specified the existing behavior of "\fBzfs list\fR" is preserved.
1346 \fB\fB-S\fR \fIproperty\fR\fR
1350 Same as the \fB-s\fR option, but sorts by property in descending order.
1357 \fB\fB-t\fR \fItype\fR\fR
1361 A comma-separated list of types to display, where "type" is one of "filesystem", "snapshot" or "volume". For example, specifying "\fB-t snapshot\fR" displays only snapshots.
1370 \fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
1374 Sets the property to the given value for each dataset. Only some properties can be edited. See the "Properties" section for more information on what properties can be set and acceptable values. Numeric values can be specified as exact values, or in a human-readable
1375 form with a suffix of "B", "K", "M", "G", "T", "P", "E", "Z" (for bytes, Kbytes, Mbytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). Properties cannot be set on snapshots.
1382 \fB\fBzfs get\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1386 Displays properties for the given datasets. If no datasets are specified, then the command displays properties for all datasets on the system. For each property, the following columns are displayed:
1391 property Property name
1392 value Property value
1393 source Property source. Can either be local, default,
1394 temporary, inherited, or none (-).
1399 All columns are displayed by default, though this can be controlled by using the \fB-o\fR option. This command takes a comma-separated list of properties as described in the "Native Properties" and "User Properties" sections.
1401 The special value "all" can be used to display all properties for the given dataset.
1410 Recursively display properties for any children.
1421 Display output in a form more easily parsed by scripts. Any headers are omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space.
1428 \fB\fB-o\fR \fIfield\fR\fR
1432 A comma-separated list of columns to display. "name,property,value,source" is the default value.
1439 \fB\fB-s\fR \fIsource\fR\fR
1443 A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following: "local,default,inherited,temporary,none". The default value is all sources.
1454 Display numbers in parsable (exact) values.
1463 \fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
1467 Clears the specified property, causing it to be inherited from an ancestor. If no ancestor has the property set, then the default value is used. See the "Properties" section for a listing of default values, and details on which properties can be inherited.
1476 Recursively inherit the given property for all children.
1485 \fB\fBzfs upgrade\fR [\fB-v\fR]\fR
1489 Displays a list of file systems that are not the most recent version.
1496 \fB\fBzfs upgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] [\fB-a\fR | \fIfilesystem\fR]\fR
1500 Upgrades file systems to a new on-disk version. Once this is done, the file systems will no longer be accessible on systems running older versions of the software. "\fBzfs send\fR" streams generated from new snapshots of these file systems can not be accessed
1501 on systems running older versions of the software.
1503 The file system version is independent of the pool version (see \fBzpool\fR(1M) for information on the "\fBzpool upgrade\fR" command).
1505 The file system version does not have to be upgraded when the pool version is upgraded, and vice versa.
1514 Upgrade all file systems on all imported pools.
1521 \fB\fIfilesystem\fR\fR
1525 Upgrade the specified file system.
1536 Upgrade the specified file system and all descendent file systems
1543 \fB\fB-V\fR \fIversion\fR\fR
1547 Upgrade to the specified \fIversion\fR. If the \fB-V\fR flag is not specified, this command upgrades to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this
1557 \fB\fBzfs mount\fR\fR
1561 Displays all \fBZFS\fR file systems currently mounted.
1568 \fB\fBzfs mount\fR [\fB-vO\fR] [\fB-o\fR \fIoptions\fR] \fB-a\fR | \fIfilesystem\fR\fR
1572 Mounts \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1577 \fB\fB-o\fR \fIoptions\fR\fR
1581 An optional comma-separated list of mount options to use temporarily for the duration of the mount. See the "Temporary Mount Point Properties" section for details.
1592 Perform an overlay mount. See \fBmount\fR(1M) for more information.
1603 Report mount progress.
1614 Mount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1621 \fB\fIfilesystem\fR\fR
1625 Mount the specified filesystem.
1634 \fB\fBzfs unmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
1638 Unmounts currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
1647 Forcefully unmount the file system, even if it is currently in use.
1658 Unmount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1665 \fB\fIfilesystem\fR|\fImountpoint\fR\fR
1669 Unmount the specified filesystem. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
1678 \fB\fBzfs share\fR \fB-a\fR | \fIfilesystem\fR\fR
1682 Shares available \fBZFS\fR file systems.
1691 Share all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1698 \fB\fIfilesystem\fR\fR
1702 Share the specified filesystem according to the "sharenfs" and "sharesmb" properties. File systems are shared when the "sharenfs" or "sharesmb" property is set.
1711 \fB\fBzfs unshare\fR \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
1715 Unshares currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
1724 Unshare all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1731 \fB\fIfilesystem\fR|\fImountpoint\fR\fR
1735 Unshare the specified filesystem. The command can also be given a path to a \fBZFS\fR file system shared on the system.
1744 \fB\fBzfs send\fR [\fB-vR\fR] [\fB-\fR[\fB-iI\fR] \fIsnapshot\fR] \fIsnapshot\fR\fR
1748 Creates a stream representation of the second \fIsnapshot\fR, which is written to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated.
1753 \fB\fB-i\fR \fIsnapshot\fR\fR
1757 Generate an incremental stream from the first \fIsnapshot\fR to the second \fIsnapshot\fR. The incremental source (the first \fIsnapshot\fR) can be specified as the last component of the snapshot name (for example,
1758 the part after the "@"), and it is assumed to be from the same file system as the second \fIsnapshot\fR.
1760 If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, "pool/fs@origin", not just "@origin").
1767 \fB\fB-I\fR \fIsnapshot\fR\fR
1771 Generate a stream package that sends all intermediary snapshots from the first snapshot to the second snapshot. For example, "\fB-I @a fs@d\fR" is similar to "\fB-i @a fs@b; -i @b fs@c; -i @c fs@d\fR". The incremental source snapshot
1772 may be specified as with the \fB-i\fR option.
1783 Generate a replication stream package, which will replicate the specified filesystem, and all descendant file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
1785 If the \fB-i\fR or \fB-I\fR flags are used in conjunction with the \fB-R\fR flag, an incremental replication stream is generated. The current values of properties, and current snapshot and file system names are set when the stream is received. If the \fB-F\fR flag is specified when this stream is recieved, snapshots and file systems that do not exist on the sending side are destroyed.
1796 Print verbose information about the stream package generated.
1799 The format of the stream is evolving. No backwards compatibility is guaranteed. You may not be able to receive your streams on future versions of \fBZFS\fR.
1806 \fB\fBzfs receive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1810 \fB\fBzfs receive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR\fR
1814 Creates a snapshot whose contents are as specified in the stream provided on standard input. If a full stream is received, then a new file system is created as well. Streams are created using the "\fBzfs send\fR" subcommand, which by default creates a full
1815 stream. "\fBzfs recv\fR" can be used as an alias for "\fBzfs receive\fR".
1817 If an incremental stream is received, then the destination file system must already exist, and its most recent snapshot must match the incremental stream's source. For \fBzvols\fR, the destination device link is destroyed and re-created, which means the \fBzvol\fR cannot
1818 be accessed during the \fBreceive\fR operation.
1820 The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the \fB-d\fR option.
1822 If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or \fIvolume\fR.
1823 If the \fB-d\fR option is specified, the snapshot name is determined by appending the sent snapshot's name to the specified \fIfilesystem\fR. If the \fB-d\fR option is specified, any required file systems within the specified one are created.
1832 Use the name of the sent snapshot to determine the name of the new snapshot as described in the paragraph above.
1843 Print verbose information about the stream and the time required to perform the receive operation.
1854 Do not actually receive the stream. This can be useful in conjunction with the \fB-v\fR option to verify the name the receive operation would use.
1865 Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication stream (for example, one generated by "z\fBfs send -R -[iI]\fR"), destroy snapshots and file systems that do
1866 not exist on the sending side.
1875 \fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR
1879 \fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
1883 Delegates \fBZFS\fR administration permission for the file systems to non-privileged users.
1888 \fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR
1892 Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword "everyone", then as a user name,
1893 and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options.
1900 \fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR
1904 Specifies that the permissions be delegated to "everyone." Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which
1905 begin with an "at sign" ("@") , may be specified. See the \fB-s\fR form below for details.
1912 \fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR
1916 Specifies where the permissions are delegated. If neither of the \fB-ld\fR options are specified, or both are, then the permissions are allowed for the file system or volume, and all of its descendents. If only the \fB-l\fR option is used, then is allowed "locally"
1917 only for the specified file system. If only the \fB-d\fR option is used, then is allowed only for the descendent file systems.
1924 Permissions are generally the ability to use a \fBZFS\fR subcommand or change a \fBZFS\fR property. The following permissions are available:
1929 allow subcommand Must also have the permission
1930 that is being allowed.
1931 clone subcommand Must also have the 'create' ability
1932 and the 'mount' ability in the origin
1934 create subcommand Must also have the 'mount' ability.
1935 destroy subcommand Must also have the 'mount' ability.
1936 mount subcommand Allows mount, unmount, and
1937 create/remove zvol device links.
1938 promote subcommand Must also have the 'mount' ability and
1939 'promote' ability in the origin file system.
1940 receive subcommand Must also have the 'mount' ability and
1941 the 'create' ability.
1942 rename subcommand Must also have the 'mount' ability and
1943 the 'create' ability in the new parent.
1944 rollback subcommand Must also have the 'mount' ability.
1945 snapshot subcommand Must also have the 'mount' ability.
1946 share subcommand Allows share and unshare.
1955 compression property
1963 reservation property
1972 userprop other Allows changing any user property.
1981 \fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
1985 Sets "create time" permissions. These permissions are granted (locally) to the creator of any newly-created descendent file system.
1992 \fB\fBzfs allow\fR \fB-s\fR @setname \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
1996 Defines or adds permissions to a permission set. The set can be used by other \fBzfs allow\fR commands for the specified file system and its descendents. Sets are evaluated dynamically, so changes to a set are immediately reflected. Permission sets follow the same
1997 naming restrictions as ZFS file systems, but the name must begin with an "at sign" ("@"), and can be no more than 64 characters long.
2004 \fB\fBzfs unallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR
2008 \fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] \fIfilesystem\fR|\fIvolume\fR\fR
2012 \fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2016 \fB\fIfilesystem\fR|\fIvolume\fR\fR
2020 Removes permissions that were granted with the "\fBzfs allow\fR" command. No permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified,
2021 then all permissions for the specified \fIuser\fR, \fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the \fB-e\fR option) only removes the permissions that were granted to "everyone",
2022 not all permissions for every user and group. See the "\fBzfs allow\fR" command for a description of the \fB-ldugec\fR options.
2031 Recursively remove the permissions from this file system and all descendents.
2040 \fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2044 \fB\fIfilesystem\fR|\fIvolume\fR\fR
2048 Removes permissions from a permission set. If no permissions are specified, then all permissions are removed, thus removing the set entirely.
2055 \fB\fBzfs jail\fR \fIjailid\fR \fIfilesystem\fR\fR
2059 Attaches the given file system to the given jail. From now on this file system tree can be managed from within a jail if the "\fBjailed\fR" property has been set.
2060 To use this functionality, sysctl \fBsecurity.jail.enforce_statfs\fR should be set to 0 and sysctl \fBsecurity.jail.mount_allowed\fR should be set to 1.
2067 \fB\fBzfs unjail\fR \fIjailid\fR \fIfilesystem\fR\fR
2071 Detaches the given file system from the given jail.
2076 \fBExample 1 \fRCreating a ZFS File System Hierarchy
2079 The following commands create a file system named "\fBpool/home\fR" and a file system named "\fBpool/home/bob\fR". The mount point "\fB/export/home\fR" is set for the parent file system, and automatically inherited
2080 by the child file system.
2085 # zfs create pool/home
2086 # zfs set mountpoint=/export/home pool/home
2087 # zfs create pool/home/bob
2093 \fBExample 2 \fRCreating a ZFS Snapshot
2096 The following command creates a snapshot named "yesterday". This snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of the "\fBpool/home/bob\fR" file system.
2101 # zfs snapshot pool/home/bob@yesterday
2107 \fBExample 3 \fRTaking and destroying multiple snapshots
2110 The following command creates snapshots named "\fByesterday\fR" of "\fBpool/home\fR" and all of its descendent file systems. Each snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of its file system. The
2111 second command destroys the newly created snapshots.
2116 # \fBzfs snapshot -r pool/home@yesterday\fR
2117 \fB# zfs destroy -r pool/home@yesterday\fR
2123 \fBExample 4 \fRTurning Off Compression
2126 The following commands turn compression off for all file systems under "\fBpool/home\fR", but explicitly turns it on for "\fBpool/home/anne\fR".
2131 \fB# zfs set compression=off pool/home
2132 # zfs set compression=on pool/home/anne\fR
2138 \fBExample 5 \fRListing ZFS Datasets
2141 The following command lists all active file systems and volumes in the system.
2149 NAME USED AVAIL REFER MOUNTPOINT
2150 pool 450K 457G 18K /pool
2151 pool/home 315K 457G 21K /export/home
2152 pool/home/anne 18K 457G 18K /export/home/anne
2153 pool/home/bob 276K 457G 276K /export/home/bob
2154 pool/home/bob@yesterday 0 - 276K -
2160 \fBExample 6 \fRSetting a Quota on a ZFS File System
2163 The following command sets a quota of 50 gbytes for "\fBpool/home/bob\fR".
2168 \fB# zfs set quota=50G pool/home/bob\fR
2174 \fBExample 7 \fRListing ZFS Properties
2177 The following command lists all properties for "\fBpool/home/bob\fR".
2182 \fB# zfs get all pool/home/bob\fR
2185 NAME PROPERTY VALUE SOURCE
2186 pool/home/bob type filesystem -
2187 pool/home/bob creation Thu Jul 12 14:44 2007 -
2188 pool/home/bob used 276K -
2189 pool/home/bob available 50.0G -
2190 pool/home/bob referenced 276K -
2191 pool/home/bob compressratio 1.00x -
2192 pool/home/bob mounted yes -
2193 pool/home/bob quota 50G local
2194 pool/home/bob reservation none default
2195 pool/home/bob recordsize 128K default
2196 pool/home/bob mountpoint /export/home/bob inherited from
2198 pool/home/bob checksum on default
2199 pool/home/bob compression off default
2200 pool/home/bob atime on default
2201 pool/home/bob devices on default
2202 pool/home/bob exec on default
2203 pool/home/bob setuid on default
2204 pool/home/bob readonly off default
2205 pool/home/bob zoned off default
2206 pool/home/bob snapdir hidden default
2207 pool/home/bob aclmode groupmask default
2208 pool/home/bob aclinherit restricted default
2209 pool/home/bob canmount on default
2210 pool/home/bob nbmand off default
2211 pool/home/bob shareiscsi off default
2212 pool/home/bob sharesmb off default
2213 pool/home/bob sharenfs off default
2214 pool/home/bob xattr on default
2215 pool/home/bob refquota 10M local
2216 pool/home/bob refreservation none default
2217 pool/home/bob copies 1 default
2218 pool/home/bob version 1 -
2227 The following command gets a single property value.
2232 \fB# zfs get -H -o value compression pool/home/bob\fR
2240 The following command lists all properties with local settings for "\fBpool/home/bob\fR".
2245 \fB# zfs get -r -s local -o name,property,value all pool/home/bob\fR
2249 pool/home checksum off
2255 \fBExample 8 \fRRolling Back a ZFS File System
2258 The following command reverts the contents of "\fBpool/home/anne\fR" to the snapshot named "\fByesterday\fR", deleting all intermediate snapshots.
2263 \fB# zfs rollback -r pool/home/anne@yesterday\fR
2269 \fBExample 9 \fRCreating a ZFS Clone
2272 The following command creates a writable file system whose initial contents are the same as "\fBpool/home/bob@yesterday\fR".
2277 \fB# zfs clone pool/home/bob@yesterday pool/clone\fR
2283 \fBExample 10 \fRPromoting a ZFS Clone
2286 The following commands illustrate how to test out changes to a file system, and then replace the original file system with the changed one, using clones, clone promotion, and renaming:
2291 \fB# zfs create pool/project/production\fR
2292 populate /pool/project/production with data
2293 \fB# zfs snapshot pool/project/production@today
2294 # zfs clone pool/project/production@today pool/project/beta\fR
2295 make changes to /pool/project/beta and test them
2296 \fB# zfs promote pool/project/beta
2297 # zfs rename pool/project/production pool/project/legacy
2298 # zfs rename pool/project/beta pool/project/production\fR
2299 once the legacy version is no longer needed, it can be
2301 \fB# zfs destroy pool/project/legacy\fR
2307 \fBExample 11 \fRInheriting ZFS Properties
2310 The following command causes "\fBpool/home/bob\fR" and "\fBpool/home/anne\fR" to inherit the "checksum" property from their parent.
2315 \fB# zfs inherit checksum pool/home/bob pool/home/anne\fR
2321 \fBExample 12 \fRRemotely Replicating ZFS Data
2324 The following commands send a full stream and then an incremental stream to a remote machine, restoring them into "\fBpoolB/received/fs\fR@a" and "\fBpoolB/received/fs@b\fR", respectively. "\fBpoolB\fR" must contain
2325 the file system "\fBpoolB/received\fR", and must not initially contain "\fBpoolB/received/fs\fR".
2330 # zfs send pool/fs@a | \e
2331 ssh host zfs receive poolB/received/fs@a
2332 # zfs send -i a pool/fs@b | ssh host \e
2333 zfs receive poolB/received/fs
2339 \fBExample 13 \fRUsing the zfs receive -d Option
2342 The following command sends a full stream of "\fBpoolA/fsA/fsB@snap\fR" to a remote machine, receiving it into "\fBpoolB/received/fsA/fsB@snap\fR". The "\fBfsA/fsB@snap\fR" portion of the received snapshot's name
2343 is determined from the name of the sent snapshot. "\fBpoolB\fR" must contain the file system "\fBpoolB/received\fR". If "\fBpoolB/received/fsA\fR" does not exist, it is be created as an empty file system.
2348 \fB# zfs send poolA/fsA/fsB@snap | \e
2349 ssh host zfs receive -d poolB/received\fR
2355 \fBExample 14 \fRCreating a ZFS volume as a Swap Device
2358 The following example shows how to create a 5-Gbyte ZFS volume and then add the volume as a swap device.
2363 \fB# zfs create -V 5gb tank/vol
2364 # swap -a /dev/zvol/dsk/tank/vol\fR
2370 \fBExample 15 \fRSetting User Properties
2373 The following example sets the user defined "com.example:department" property for a dataset.
2378 \fB# zfs set com.example:department=12345 tank/accounting\fR
2384 \fBExample 16 \fRCreating a ZFS Volume as a iSCSI Target Device
2387 The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target.
2392 \fB# zfs create -V 2g pool/volumes/vol1
2393 # zfs set shareiscsi=on pool/volumes/vol1
2394 # iscsitadm list target\fR
2395 Target: pool/volumes/vol1
2397 iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
2405 After the \fBiSCSI\fR target is created, set up the \fBiSCSI\fR initiator. For more information about the Solaris \fBiSCSI\fR initiator, see the Solaris Administration Guide: Devices and File Systems.
2407 \fBExample 17 \fRPerforming a Rolling Snapshot
2410 The following example shows how to maintain a history of snapshots with a consistent naming scheme. To keep a week's worth of snapshots, the user destroys the oldest snapshot, renames the remaining snapshots, and then creates a new snapshot, as follows:
2415 \fB# zfs destroy -r pool/users@7daysago
2416 # zfs rename -r pool/users@6daysago @7daysago
2417 # zfs rename -r pool/users@5daysago @6daysago
2419 # zfs rename -r pool/users@yesterday @2daysago
2420 # zfs rename -r pool/users@today @yesterday
2421 # zfs snapshot -r pool/users@today\fR
2427 \fBExample 18 \fRSetting sharenfs Property Options on a ZFS File System
2430 The following commands show how to set "sharenfs" property options to enable \fBrw\fR access for a set of \fBIP\fR addresses and to enable root access for system \fBneo\fR on the \fBtank/home\fR file system.
2435 \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
2443 If you are using \fBDNS\fR for host name resolution, specify the fully qualified hostname.
2446 \fBExample 19 \fRDelegating ZFS Administration Permissions on a ZFS Dataset
2449 The following example shows how to set permissions so that user "\fBcindys\fR" can create, destroy, mount and take snapshots on \fBtank/cindys\fR. The permissions on \fBtank/cindys\fR are also displayed.
2454 \fB# zfs allow cindys create,destroy,mount,snapshot tank/cindys
2455 # zfs allow tank/cindys\fR
2456 -------------------------------------------------------------
2457 Local+Descendent permissions on (tank/cindys)
2458 user cindys create,destroy,mount,snapshot
2459 -------------------------------------------------------------
2467 Because the \fBtank/cindys\fR mount point permission is set to 755 by default, user \fBcindys\fR will be unable to mount file systems under \fBtank/cindys\fR. Set an \fBACL\fR similar to the following syntax to provide mount point access:
2471 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
2477 \fBExample 20 \fRDelegating Create Time Permissions on a ZFS Dataset
2480 The following example shows how to grant anyone in the group \fBstaff\fR to create file systems in \fBtank/users\fR. This syntax also allows staff members to destroy their own file systems, but not destroy anyone else's file system. The permissions on \fBtank/users\fR are also displayed.
2485 \fB# zfs allow staff create,mount tank/users
2486 # zfs allow -c destroy tank/users
2487 # zfs allow tank/users\fR
2488 -------------------------------------------------------------
2489 Create time permissions on (tank/users)
2491 Local+Descendent permissions on (tank/users)
2492 group staff create,mount
2493 -------------------------------------------------------------
2499 \fBExample 21 \fRDefining and Granting a Permission Set on a ZFS Dataset
2502 The following example shows how to define and grant a permission set on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
2507 \fB# zfs allow -s @pset create,destroy,snapshot,mount tank/users
2508 # zfs allow staff @pset tank/users
2509 # zfs allow tank/users
2510 -------------------------------------------------------------
2511 Permission sets on (tank/users)
2512 @pset create,destroy,mount,snapshot
2513 Create time permissions on (tank/users)
2515 Local+Descendent permissions on (tank/users)
2516 group staff @pset,create,mount
2517 -------------------------------------------------------------\fR
2523 \fBExample 22 \fRDelegating Property Permissions on a ZFS Dataset
2526 The following example shows to grant the ability to set quotas and reservations on the \fBusers/home\fR file system. The permissions on \fBusers/home\fR are also displayed.
2531 \fB# zfs allow cindys quota,reservation users/home
2532 # zfs allow users/home\fR
2533 -------------------------------------------------------------
2534 Local+Descendent permissions on (users/home)
2535 user cindys quota,reservation
2536 -------------------------------------------------------------
2537 cindys% zfs set quota=10G users/home/marks
2538 cindys% zfs get quota users/home/marks
2539 NAME PROPERTY VALUE SOURCE
2540 users/home/marks quota 10G local
2546 \fBExample 23 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset
2549 The following example shows how to remove the snapshot permission from the \fBstaff\fR group on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
2554 \fB# zfs unallow staff snapshot tank/users
2555 # zfs allow tank/users\fR
2556 -------------------------------------------------------------
2557 Permission sets on (tank/users)
2558 @pset create,destroy,mount,snapshot
2559 Create time permissions on (tank/users)
2561 Local+Descendent permissions on (tank/users)
2562 group staff @pset,create,mount
2563 -------------------------------------------------------------
2571 The following exit values are returned:
2580 Successful completion.
2602 Invalid command line options were specified.
2608 See \fBattributes\fR(5) for descriptions of the following attributes:
2614 cw(2.75i) |cw(2.75i)
2615 lw(2.75i) |lw(2.75i)
2617 ATTRIBUTE TYPE
\aATTRIBUTE VALUE
2619 Availability
\aSUNWzfsu
2621 Interface Stability
\aCommitted
2627 \fBgzip\fR(1), \fBssh\fR(1), \fBmount\fR(1M), \fBshare\fR(1M), \fBsharemgr\fR(1M), \fBunshare\fR(1M), \fBzonecfg\fR(1M), \fBzpool\fR(1M), \fBchmod\fR(2), \fBstat\fR(2), \fBfsync\fR(3c), \fBdfstab\fR(4), \fBattributes\fR(5)
2630 For information about using the \fBZFS\fR web-based management tool and other \fBZFS\fR features, see the \fIZFS Administration Guide\fR.