]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zfs.8
Imported Upstream version 0.6.4.2
[mirror_zfs-debian.git] / man / man8 / zfs.8
CommitLineData
5990da81
YP
1'\" t
2.\"
3.\" CDDL HEADER START
4.\"
5.\" The contents of this file are subject to the terms of the
6.\" Common Development and Distribution License (the "License").
7.\" You may not use this file except in compliance with the License.
8.\"
9.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10.\" or http://www.opensolaris.org/os/licensing.
11.\" See the License for the specific language governing permissions
12.\" and limitations under the License.
13.\"
14.\" When distributing Covered Code, include this CDDL HEADER in each
15.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16.\" If applicable, add the following below this CDDL HEADER, with the
17.\" fields enclosed by brackets "[]" replaced with your own identifying
18.\" information: Portions Copyright [yyyy] [name of copyright owner]
19.\"
20.\" CDDL HEADER END
21.\"
22.\"
058ac9ba 23.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
5990da81 24.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
ea04106b 25.\" Copyright (c) 2014 by Delphix. All rights reserved.
37abac6d 26.\" Copyright (c) 2012, Joyent, Inc. All rights reserved.
5990da81 27.\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved.
9759c60f 28.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
5990da81 29.\"
a08ee875 30.TH zfs 8 "Nov 19, 2013" "ZFS pool 28, filesystem 5" "System Administration Commands"
058ac9ba
BB
31.SH NAME
32zfs \- configures ZFS file systems
33.SH SYNOPSIS
34.LP
35.nf
36\fBzfs\fR [\fB-?\fR]
37.fi
38
39.LP
40.nf
41\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR
42.fi
43
44.LP
45.nf
46\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
47.fi
48
49.LP
50.nf
330d06f9 51\fBzfs\fR \fBdestroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
52.fi
53
54.LP
55.nf
330d06f9 56\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
058ac9ba
BB
57.fi
58
ea04106b
AX
59.LP
60.nf
61\fBzfs\fR \fBdestroy\fR \fIfilesystem\fR|\fIvolume\fR#\fIbookmark\fR
62.fi
63
058ac9ba
BB
64.LP
65.nf
a08ee875
LG
66\fBzfs\fR \fBsnapshot | snap\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ...
67 \fIfilesystem@snapname\fR|\fIvolume@snapname\fR ...
058ac9ba
BB
68.fi
69
70.LP
71.nf
72\fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
73.fi
74
75.LP
76.nf
77\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
78.fi
79
80.LP
81.nf
82\fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR
83.fi
84
85.LP
86.nf
db49968e 87\fBzfs\fR \fBrename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
058ac9ba
BB
88 \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
89.fi
90
91.LP
92.nf
db49968e 93\fBzfs\fR \fBrename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
94.fi
95
96.LP
97.nf
98\fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR
99.fi
100
101.LP
102.nf
a08ee875
LG
103\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIproperty\fR[,\fIproperty\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]..]
104 [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
058ac9ba
BB
105.fi
106
107.LP
108.nf
109\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
110.fi
111
112.LP
113.nf
e346ec25
AS
114\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
115 [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
058ac9ba
BB
116.fi
117
118.LP
119.nf
120\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
121.fi
122
123.LP
124.nf
125\fBzfs\fR \fBupgrade\fR [\fB-v\fR]
126.fi
127
128.LP
129.nf
130\fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR
131.fi
132
133.LP
134.nf
5990da81
YP
135\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ...
136 [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
137.fi
138
139.LP
140.nf
5990da81
YP
141\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ...
142 [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
143.fi
144
145.LP
146.nf
147\fBzfs\fR \fBmount\fR
148.fi
149
150.LP
151.nf
152\fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR
153.fi
154
155.LP
156.nf
10b75496 157\fBzfs\fR \fBunmount | umount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
058ac9ba
BB
158.fi
159
160.LP
161.nf
162\fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR
163.fi
164
165.LP
166.nf
167\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
168.fi
169
170.LP
171.nf
ea04106b
AX
172\fBzfs\fR \fBbookmark\fR \fIsnapshot\fR \fIbookmark\fR
173.fi
174
175.LP
176.nf
177\fBzfs\fR \fBsend\fR [\fB-DnPpRve\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
178.fi
179
180.LP
181.nf
182\fBzfs\fR \fBsend\fR [\fB-e\fR] [\fB-i \fIsnapshot\fR|\fIbookmark\fR]\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
058ac9ba
BB
183.fi
184
185.LP
186.nf
10b75496 187\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
058ac9ba
BB
188.fi
189
190.LP
191.nf
bb8b81ec 192\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR
058ac9ba
BB
193.fi
194
195.LP
196.nf
197\fBzfs\fR \fBallow\fR \fIfilesystem\fR|\fIvolume\fR
198.fi
199
200.LP
201.nf
202\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...]
203 \fIfilesystem\fR|\fIvolume\fR
204.fi
205
206.LP
207.nf
208\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
209.fi
210
211.LP
212.nf
213\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
214.fi
215
216.LP
217.nf
218\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
219.fi
220
221.LP
222.nf
223\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]]
224 \fIfilesystem\fR|\fIvolume\fR
225.fi
226
227.LP
228.nf
229\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
230.fi
231
232.LP
233.nf
234\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR
235.fi
236
237.LP
238.nf
239\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
240.fi
241
242.LP
243.nf
244\fBzfs\fR \fBhold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
245.fi
246
247.LP
248.nf
249\fBzfs\fR \fBholds\fR [\fB-r\fR] \fIsnapshot\fR...
250.fi
251
252.LP
253.nf
254\fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
255.fi
256
0677cb6f
RL
257.LP
258.nf
259\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
260
058ac9ba 261.SH DESCRIPTION
058ac9ba 262.LP
2d1b7b0b 263The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(8). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
058ac9ba
BB
264.sp
265.in +2
266.nf
267pool/{filesystem,volume,snapshot}
268.fi
269.in -2
270.sp
271
272.sp
273.LP
274where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
275.sp
276.LP
277A dataset can be one of the following:
278.sp
279.ne 2
280.mk
281.na
282\fB\fIfile system\fR\fR
283.ad
284.sp .6
285.RS 4n
286A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space.
287.RE
288
289.sp
290.ne 2
291.mk
292.na
293\fB\fIvolume\fR\fR
294.ad
295.sp .6
296.RS 4n
297A 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.
298.RE
299
300.sp
301.ne 2
302.mk
303.na
304\fB\fIsnapshot\fR\fR
305.ad
306.sp .6
307.RS 4n
308A 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.
309.RE
310
311.SS "ZFS File System Hierarchy"
058ac9ba
BB
312.LP
313A \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.
314.sp
315.LP
2d1b7b0b 316The 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(8) command.
058ac9ba
BB
317.sp
318.LP
2d1b7b0b 319See \fBzpool\fR(8) for more information on creating and administering pools.
058ac9ba 320.SS "Snapshots"
058ac9ba
BB
321.LP
322A 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.
323.sp
324.LP
a08ee875 325Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back. Visibility is determined by the \fBsnapdev\fR property of the parent volume.
058ac9ba
BB
326.sp
327.LP
328File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR 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 \fB\&.zfs\fR directory can be controlled by the \fBsnapdir\fR property.
329.SS "Clones"
058ac9ba
BB
330.LP
331A 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.
332.sp
333.LP
334Clones 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 \fBorigin\fR property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
335.sp
336.LP
337The 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 was created from.
338.SS "Mount Points"
058ac9ba 339.LP
9a616b5d 340Creating 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/fstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time.
058ac9ba
BB
341.sp
342.LP
343By 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.
344.sp
345.LP
9a616b5d 346A file system can also have a mount point set in the \fBmountpoint\fR 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/fstab\fR). The \fBmountpoint\fR 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.
058ac9ba
BB
347.sp
348.LP
349A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system from being mounted.
350.sp
351.LP
9a616b5d 352If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/fstab\fR). If a file system's mount point is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
c8f25918 353.SS "Deduplication"
c8f25918
KA
354.LP
355Deduplication is the process for removing redundant data at the block-level, reducing the total amount of data stored. If a file system has the \fBdedup\fR property enabled, duplicate data blocks are removed synchronously. The result is that only unique data is stored and common components are shared among files.
ea04106b
AX
356.sp
357\fBWARNING: DO NOT ENABLE DEDUPLICATION UNLESS YOU NEED IT AND KNOW EXACTLY WHAT YOU ARE DOING!\fR
358.sp
359Deduplicating data is a very resource-intensive operation. It is generally recommended that you have \fIat least\fR 1.25 GB of RAM per 1 TB of storage when you enable deduplication. But calculating the exact requirenments is a somewhat complicated affair. Please see the \fBOracle Dedup Guide\fR for more information..
360.sp
361Enabling deduplication on an improperly-designed system will result in extreme performance issues (extremely slow filesystem and snapshot deletions etc.) and can potentially lead to data loss (i.e. unimportable pool due to memory exhaustion) if your system is not built for this purpose. Deduplication affects the processing power (CPU), disks (and the controller) as well as primary (real) memory.
362.sp
363Before creating a pool with deduplication enabled, ensure that you have planned your hardware requirements appropriately and implemented appropriate recovery practices, such as regular backups.
364.sp
365Unless necessary, deduplication should NOT be enabled on a system. Instead, consider using \fIcompression=lz4\fR, as a less resource-intensive alternative.
058ac9ba 366.SS "Native Properties"
058ac9ba
BB
367.LP
368Properties are divided into two types, native properties and user-defined (or "user") 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, 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, below.
369.sp
370.LP
371Every dataset has a set of properties that export statistics about the dataset as well as control various behaviors. Properties are inherited from the parent unless overridden by the child. Some properties apply only to certain types of datasets (file systems, volumes, or snapshots).
372.sp
373.LP
374The values of numeric properties can be specified using human-readable suffixes (for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR for zettabyte). The following are all valid (and equal) specifications:
375.sp
376.in +2
377.nf
3781536M, 1.5g, 1.50GB
379.fi
380.in -2
381.sp
382
383.sp
384.LP
385The values of non-numeric properties are case sensitive and must be lowercase, except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR.
386.sp
387.LP
388The following native properties consist of read-only statistics about the dataset. These properties can be neither set, nor inherited. Native properties apply to all dataset types unless otherwise noted.
389.sp
390.ne 2
391.mk
392.na
393\fB\fBavailable\fR\fR
394.ad
395.sp .6
396.RS 4n
397The 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 within the pool.
398.sp
399This property can also be referred to by its shortened column name, \fBavail\fR.
400.RE
401
402.sp
403.ne 2
404.mk
405.na
406\fB\fBcompressratio\fR\fR
407.ad
408.sp .6
409.RS 4n
f5fc4aca 410For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier. The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot. For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR.
058ac9ba
BB
411.RE
412
413.sp
414.ne 2
415.mk
416.na
417\fB\fBcreation\fR\fR
418.ad
419.sp .6
420.RS 4n
421The time this dataset was created.
422.RE
423
424.sp
425.ne 2
426.mk
427.na
330d06f9
MA
428\fB\fBclones\fR\fR
429.ad
430.sp .6
431.RS 4n
432For snapshots, this property is a comma-separated list of filesystems or
433volumes which are clones of this snapshot. The clones' \fBorigin\fR property
434is this snapshot. If the \fBclones\fR property is not empty, then this
435snapshot can not be destroyed (even with the \fB-r\fR or \fB-f\fR options).
436.RE
437
438.sp
439.ne 2
440.na
058ac9ba
BB
441\fB\fBdefer_destroy\fR\fR
442.ad
443.sp .6
444.RS 4n
3b204150 445This property is \fBon\fR if the snapshot has been marked for deferred destruction by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is \fBoff\fR.
058ac9ba
BB
446.RE
447
448.sp
449.ne 2
450.mk
451.na
a08ee875
LG
452\fB\fBlogicalreferenced\fR\fR
453.ad
454.sp .6
455.RS 4n
456The amount of space that is "logically" accessible by this dataset. See
457the \fBreferenced\fR property. The logical space ignores the effect of
458the \fBcompression\fR and \fBcopies\fR properties, giving a quantity
459closer to the amount of data that applications see. However, it does
460include space consumed by metadata.
461.sp
462This property can also be referred to by its shortened column name,
463\fBlrefer\fR.
464.RE
465
466.sp
467.ne 2
468.na
469\fB\fBlogicalused\fR\fR
470.ad
471.sp .6
472.RS 4n
473The amount of space that is "logically" consumed by this dataset and all
474its descendents. See the \fBused\fR property. The logical space
475ignores the effect of the \fBcompression\fR and \fBcopies\fR properties,
476giving a quantity closer to the amount of data that applications see.
477However, it does include space consumed by metadata.
478.sp
479This property can also be referred to by its shortened column name,
480\fBlused\fR.
481.RE
482
483.sp
484.ne 2
485.na
058ac9ba
BB
486\fB\fBmounted\fR\fR
487.ad
488.sp .6
489.RS 4n
490For file systems, indicates whether the file system is currently mounted. This property can be either \fByes\fR or \fBno\fR.
491.RE
492
493.sp
494.ne 2
495.mk
496.na
497\fB\fBorigin\fR\fR
498.ad
499.sp .6
500.RS 4n
330d06f9 501For cloned file systems or volumes, the snapshot from which the clone was created. See also the \fBclones\fR property.
058ac9ba
BB
502.RE
503
504.sp
505.ne 2
506.mk
507.na
508\fB\fBreferenced\fR\fR
509.ad
510.sp .6
511.RS 4n
512The 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 identical.
513.sp
514This property can also be referred to by its shortened column name, \fBrefer\fR.
515.RE
516
f5fc4aca
MA
517.sp
518.ne 2
519.mk
520.na
521\fB\fBrefcompressratio\fR\fR
522.ad
523.sp .6
524.RS 4n
525The compression ratio achieved for the \fBreferenced\fR space of this
526dataset, expressed as a multiplier. See also the \fBcompressratio\fR
527property.
528.RE
529
058ac9ba
BB
530.sp
531.ne 2
532.mk
533.na
534\fB\fBtype\fR\fR
535.ad
536.sp .6
537.RS 4n
538The type of dataset: \fBfilesystem\fR, \fBvolume\fR, or \fBsnapshot\fR.
539.RE
540
541.sp
542.ne 2
543.mk
544.na
545\fB\fBused\fR\fR
546.ad
547.sp .6
548.RS 4n
549The 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. 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.
550.sp
551When 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 the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
552.sp
2d1b7b0b 553The 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(2) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
058ac9ba
BB
554.RE
555
556.sp
557.ne 2
558.mk
559.na
560\fB\fBusedby*\fR\fR
561.ad
562.sp .6
563.RS 4n
564The \fBusedby*\fR properties decompose the \fBused\fR properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on \fBzpool\fR "version 13" pools.
565.RE
566
567.sp
568.ne 2
569.mk
570.na
571\fB\fBusedbychildren\fR\fR
572.ad
573.sp .6
574.RS 4n
575The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
576.RE
577
578.sp
579.ne 2
580.mk
581.na
582\fB\fBusedbydataset\fR\fR
583.ad
584.sp .6
585.RS 4n
586The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents).
587.RE
588
589.sp
590.ne 2
591.mk
592.na
593\fB\fBusedbyrefreservation\fR\fR
594.ad
595.sp .6
596.RS 4n
597The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
598.RE
599
600.sp
601.ne 2
602.mk
603.na
604\fB\fBusedbysnapshots\fR\fR
605.ad
606.sp .6
607.RS 4n
608The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' \fBused\fR properties because space can be shared by multiple snapshots.
609.RE
610
611.sp
612.ne 2
613.mk
614.na
615\fB\fBuserused@\fR\fIuser\fR\fR
616.ad
617.sp .6
618.RS 4n
619The amount of space consumed by the specified user in this dataset. Space is charged to the owner of each file, as displayed by \fBls\fR \fB-l\fR. The amount of space charged is displayed by \fBdu\fR and \fBls\fR \fB-s\fR. See the \fBzfs userspace\fR subcommand for more information.
620.sp
621Unprivileged users can access only their own space usage. The root user, or a user who has been granted the \fBuserused\fR privilege with \fBzfs allow\fR, can access everyone's usage.
622.sp
623The \fBuserused@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
624.RS +4
625.TP
626.ie t \(bu
627.el o
628\fIPOSIX name\fR (for example, \fBjoe\fR)
629.RE
630.RS +4
631.TP
632.ie t \(bu
633.el o
634\fIPOSIX numeric ID\fR (for example, \fB789\fR)
635.RE
636.RS +4
637.TP
638.ie t \(bu
639.el o
640\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
641.RE
642.RS +4
643.TP
644.ie t \(bu
645.el o
646\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
647.RE
648.RE
649
650.sp
651.ne 2
652.mk
653.na
654\fB\fBuserrefs\fR\fR
655.ad
656.sp .6
657.RS 4n
658This property is set to the number of user holds on this snapshot. User holds are set by using the \fBzfs hold\fR command.
659.RE
660
661.sp
662.ne 2
663.mk
664.na
665\fB\fBgroupused@\fR\fIgroup\fR\fR
666.ad
667.sp .6
668.RS 4n
669The amount of space consumed by the specified group in this dataset. Space is charged to the group of each file, as displayed by \fBls\fR \fB-l\fR. See the \fBuserused@\fR\fIuser\fR property for more information.
670.sp
671Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBgroupused\fR privilege with \fBzfs allow\fR, can access all groups' usage.
672.RE
673
674.sp
675.ne 2
676.mk
677.na
678\fB\fBvolblocksize\fR=\fIblocksize\fR\fR
679.ad
680.sp .6
681.RS 4n
682For 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 to 128 Kbytes is valid.
683.sp
684This property can also be referred to by its shortened column name, \fBvolblock\fR.
685.RE
686
330d06f9
MA
687.sp
688.ne 2
689.na
690\fB\fBwritten\fR\fR
691.ad
692.sp .6
693.RS 4n
694The amount of \fBreferenced\fR space written to this dataset since the
695previous snapshot.
696.RE
697
698.sp
699.ne 2
700.na
701\fB\fBwritten@\fR\fIsnapshot\fR\fR
702.ad
703.sp .6
704.RS 4n
705The amount of \fBreferenced\fR space written to this dataset since the
706specified snapshot. This is the space that is referenced by this dataset
707but was not referenced by the specified snapshot.
708.sp
709The \fIsnapshot\fR may be specified as a short snapshot name (just the part
710after the \fB@\fR), in which case it will be interpreted as a snapshot in
711the same filesystem as this dataset.
712The \fIsnapshot\fR be a full snapshot name (\fIfilesystem\fR@\fIsnapshot\fR),
713which for clones may be a snapshot in the origin's filesystem (or the origin
714of the origin's filesystem, etc).
715.RE
716
058ac9ba
BB
717.sp
718.LP
719The following native properties can be used to change the behavior of a \fBZFS\fR dataset.
720.sp
721.ne 2
722.mk
723.na
724\fB\fBaclinherit\fR=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
725.ad
726.sp .6
727.RS 4n
728Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an \fBaclinherit\fR property of \fBdiscard\fR does not inherit any \fBACL\fR entries. A file system with an \fBaclinherit\fR 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 \fBaclinherit\fR property value of \fBpassthrough\fR inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough-x\fR has the same meaning as \fBpassthrough\fR, except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit.
729.sp
730When 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 from the application.
a08ee875
LG
731.sp
732The \fBaclinherit\fR property does not apply to Posix ACLs.
058ac9ba
BB
733.RE
734
735.sp
736.ne 2
737.mk
738.na
a08ee875 739\fB\fBacltype\fR=\fBnoacl\fR | \fBposixacl\fR \fR
058ac9ba
BB
740.ad
741.sp .6
742.RS 4n
a08ee875
LG
743Controls whether ACLs are enabled and if so what type of ACL to use. When
744a file system has the \fBacltype\fR property set to \fBnoacl\fR (the default)
745then ACLs are disabled. Setting the \fBacltype\fR property to \fBposixacl\fR
746indicates Posix ACLs should be used. Posix ACLs are specific to Linux and
747are not functional on other platforms. Posix ACLs are stored as an xattr and
748therefore will not overwrite any existing ZFS/NFSv4 ACLs which may be set.
749Currently only \fBposixacls\fR are supported on Linux.
750.sp
751To obtain the best performance when setting \fBposixacl\fR users are strongly
752encouraged to set the \fBxattr=sa\fR property. This will result in the
753Posix ACL being stored more efficiently on disk. But as a consequence of this
754all new xattrs will only be accessable from ZFS implementations which support
755the \fBxattr=sa\fR property. See the \fBxattr\fR property for more details.
058ac9ba
BB
756.RE
757
758.sp
759.ne 2
760.mk
761.na
762\fB\fBatime\fR=\fBon\fR | \fBoff\fR\fR
763.ad
764.sp .6
765.RS 4n
a08ee875 766Controls 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 is \fBon\fR. See also \fBrelatime\fR below.
058ac9ba
BB
767.RE
768
769.sp
770.ne 2
771.mk
772.na
773\fB\fBcanmount\fR=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR
774.ad
775.sp .6
776.RS 4n
777If 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 \fBmountpoint\fR property to \fBnone\fR, except that the dataset still has a normal \fBmountpoint\fR 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 of setting \fBcanmount=\fR\fBoff\fR is to have two datasets with the same \fBmountpoint\fR, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
778.sp
779When 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 by the \fBzfs unmount -a\fR command.
780.sp
781This property is not inherited.
782.RE
783
784.sp
785.ne 2
786.mk
787.na
788\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2,\fR| \fBfletcher4\fR | \fBsha256\fR\fR
789.ad
790.sp .6
791.RS 4n
c06d4368 792Controls the checksum used to verify data integrity. The default value is \fBon\fR, which automatically selects an appropriate algorithm (currently, \fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR disables integrity checking on user data. Disabling checksums is \fBNOT\fR a recommended practice.
058ac9ba
BB
793.sp
794Changing this property affects only newly-written data.
795.RE
796
797.sp
798.ne 2
799.mk
800.na
9759c60f 801\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR | \fBgzip-\fR\fIN\fR | \fBzle\fR | \fBlz4\fR
058ac9ba
BB
802.ad
803.sp .6
804.RS 4n
f4605f07
RL
805Controls the compression algorithm used for this dataset. The \fBlzjb\fR compression algorithm is optimized for performance while providing decent data compression. Setting compression to \fBon\fR uses the \fBlzjb\fR compression algorithm.
806.sp
807The \fBgzip\fR compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR (which is also the default for \fBgzip\fR(1)).
808.sp
809The \fBzle\fR (zero-length encoding) compression algorithm is a fast and simple algorithm to eliminate runs of zeroes.
058ac9ba 810.sp
9759c60f
ED
811The \fBlz4\fR compression algorithm is a high-performance replacement
812for the \fBlzjb\fR algorithm. It features significantly faster
813compression and decompression, as well as a moderately higher
814compression ratio than \fBlzjb\fR, but can only be used on pools with
815the \fBlz4_compress\fR feature set to \fIenabled\fR. See
816\fBzpool-features\fR(5) for details on ZFS feature flags and the
817\fBlz4_compress\fR feature.
818.sp
058ac9ba
BB
819This property can also be referred to by its shortened column name \fBcompress\fR. Changing this property affects only newly-written data.
820.RE
821
822.sp
823.ne 2
824.mk
825.na
826\fB\fBcopies\fR=\fB1\fR | \fB2\fR | \fB3\fR\fR
827.ad
828.sp .6
829.RS 4n
830Controls 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 file and dataset, changing the \fBused\fR property and counting against quotas and reservations.
831.sp
832Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the \fB-o\fR \fBcopies=\fR\fIN\fR option.
833.RE
834
c8f25918
KA
835.sp
836.ne 2
837.mk
838.na
839\fB\fBdedup\fR=\fBon\fR | \fBoff\fR | \fBverify\fR | \fBsha256\fR[,\fBverify\fR]\fR
840.ad
841.sp .6
842.RS 4n
843Controls whether deduplication is in effect for a dataset. The default value is \fBoff\fR. The default checksum used for deduplication is \fBsha256\fR (subject to change). When \fBdedup\fR is enabled, the \fBdedup\fR checksum algorithm overrides the \fBchecksum\fR property. Setting the value to \fBverify\fR is equivalent to specifying \fBsha256,verify\fR.
844.sp
845If the property is set to \fBverify\fR, then, whenever two blocks have the same signature, ZFS will do a byte-for-byte comparison with the existing block to ensure that the contents are identical.
ea04106b
AX
846.sp
847Unless necessary, deduplication should NOT be enabled on a system. See \fBDeduplication\fR above.
c8f25918
KA
848.RE
849
058ac9ba
BB
850.sp
851.ne 2
852.mk
853.na
854\fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR
855.ad
856.sp .6
857.RS 4n
858Controls whether device nodes can be opened on this file system. The default value is \fBon\fR.
859.RE
860
861.sp
862.ne 2
863.mk
864.na
865\fB\fBexec\fR=\fBon\fR | \fBoff\fR\fR
866.ad
867.sp .6
868.RS 4n
869Controls whether processes can be executed from within this file system. The default value is \fBon\fR.
870.RE
871
c8f25918
KA
872.sp
873.ne 2
874.mk
875.na
876\fB\fBmlslabel\fR=\fIlabel\fR | \fBnone\fR\fR
877.ad
878.sp .6
879.RS 4n
880The \fBmlslabel\fR property is a sensitivity label that determines if a dataset can be mounted in a zone on a system with Trusted Extensions enabled. If the labeled dataset matches the labeled zone, the dataset can be mounted and accessed from the labeled zone.
881.sp
882When the \fBmlslabel\fR property is not set, the default value is \fBnone\fR. Setting the \fBmlslabel\fR property to \fBnone\fR is equivalent to removing the property.
883.sp
884The \fBmlslabel\fR property can be modified only when Trusted Extensions is enabled and only with appropriate privilege. Rights to modify it cannot be delegated. When changing a label to a higher label or setting the initial dataset label, the \fB{PRIV_FILE_UPGRADE_SL}\fR privilege is required. When changing a label to a lower label or the default (\fBnone\fR), the \fB{PRIV_FILE_DOWNGRADE_SL}\fR privilege is required. Changing the dataset to labels other than the default can be done only when the dataset is not mounted. When a dataset with the default label is mounted into a labeled-zone, the mount operation automatically sets the \fBmlslabel\fR property to the label of that zone.
885.sp
886When Trusted Extensions is \fBnot\fR enabled, only datasets with the default label (\fBnone\fR) can be mounted.
887.sp
888Zones are a Solaris feature and are not relevant on Linux.
889.RE
890
058ac9ba
BB
891.sp
892.ne 2
893.mk
894.na
895\fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR
896.ad
897.sp .6
898.RS 4n
899Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used.
900.sp
901When the \fBmountpoint\fR 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 \fBlegacy\fR, then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously \fBlegacy\fR or \fBnone\fR, or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
902.RE
903
904.sp
905.ne 2
906.mk
907.na
908\fB\fBnbmand\fR=\fBon\fR | \fBoff\fR\fR
909.ad
910.sp .6
911.RS 4n
2d1b7b0b 912Controls 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(8) for more information on \fBnbmand\fR mounts.
058ac9ba
BB
913.RE
914
915.sp
916.ne 2
917.mk
918.na
919\fB\fBprimarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
920.ad
921.sp .6
922.RS 4n
923Controls what is cached in the primary cache (ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
924.RE
925
926.sp
927.ne 2
928.mk
929.na
930\fB\fBquota\fR=\fIsize\fR | \fBnone\fR\fR
931.ad
932.sp .6
933.RS 4n
934Limits 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 has a quota does not override the ancestor's quota, but rather imposes an additional limit.
935.sp
936Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an implicit quota.
937.RE
938
939.sp
940.ne 2
941.mk
942.na
943\fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR
944.ad
945.sp .6
946.RS 4n
c8f25918 947Limits the amount of space consumed by the specified user. Similar to the \fBrefquota\fR property, the \fBuserquota\fR space calculation does not include space that is used by descendent datasets, such as snapshots and clones. User space consumption is identified by the \fBuserspace@\fR\fIuser\fR property.
058ac9ba
BB
948.sp
949Enforcement of user quotas may be delayed by several seconds. This delay means that a user might exceed their quota before the system notices that they are over quota and begins to refuse additional writes with the \fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more information.
950.sp
951Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs allow\fR, can get and set everyone's quota.
952.sp
953This property is not available on volumes, on file systems before version 4, or on pools before version 15. The \fBuserquota@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
954.RS +4
955.TP
956.ie t \(bu
957.el o
958\fIPOSIX name\fR (for example, \fBjoe\fR)
959.RE
960.RS +4
961.TP
962.ie t \(bu
963.el o
964\fIPOSIX numeric ID\fR (for example, \fB789\fR)
965.RE
966.RS +4
967.TP
968.ie t \(bu
969.el o
970\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
971.RE
972.RS +4
973.TP
974.ie t \(bu
975.el o
976\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
977.RE
978.RE
979
980.sp
981.ne 2
982.mk
983.na
984\fB\fBgroupquota@\fR\fIgroup\fR=\fIsize\fR | \fBnone\fR\fR
985.ad
986.sp .6
987.RS 4n
988Limits the amount of space consumed by the specified group. Group space consumption is identified by the \fBuserquota@\fR\fIuser\fR property.
989.sp
990Unprivileged users can access only their own groups' space usage. The root user, or a user who has been granted the \fBgroupquota\fR privilege with \fBzfs allow\fR, can get and set all groups' quotas.
991.RE
992
993.sp
994.ne 2
995.mk
996.na
997\fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
998.ad
999.sp .6
1000.RS 4n
1001Controls whether this dataset can be modified. The default value is \fBoff\fR.
1002.sp
1003This property can also be referred to by its shortened column name, \fBrdonly\fR.
1004.RE
1005
1006.sp
1007.ne 2
1008.mk
1009.na
1010\fB\fBrecordsize\fR=\fIsize\fR\fR
1011.ad
1012.sp .6
1013.RS 4n
1014Specifies 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 access patterns.
1015.sp
1016For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a \fBrecordsize\fR 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.
1017.sp
1018The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
1019.sp
1020Changing the file system's \fBrecordsize\fR affects only files created afterward; existing files are unaffected.
1021.sp
1022This property can also be referred to by its shortened column name, \fBrecsize\fR.
1023.RE
1024
1025.sp
1026.ne 2
1027.mk
1028.na
ea04106b
AX
1029\fB\fBredundant_metadata\fR=\fBall\fR | \fBmost\fR\fR
1030.ad
1031.sp .6
1032.RS 4n
1033Controls what types of metadata are stored redundantly. ZFS stores an
1034extra copy of metadata, so that if a single block is corrupted, the
1035amount of user data lost is limited. This extra copy is in addition to
1036any redundancy provided at the pool level (e.g. by mirroring or RAID-Z),
1037and is in addition to an extra copy specified by the \fBcopies\fR
1038property (up to a total of 3 copies). For example if the pool is
1039mirrored, \fBcopies\fR=2, and \fBredundant_metadata\fR=most, then ZFS
1040stores 6 copies of most metadata, and 4 copies of data and some
1041metadata.
1042.sp
1043When set to \fBall\fR, ZFS stores an extra copy of all metadata. If a
1044single on-disk block is corrupt, at worst a single block of user data
1045(which is \fBrecordsize\fR bytes long) can be lost.
1046.sp
1047When set to \fBmost\fR, ZFS stores an extra copy of most types of
1048metadata. This can improve performance of random writes, because less
1049metadata must be written. In practice, at worst about 100 blocks (of
1050\fBrecordsize\fR bytes each) of user data can be lost if a single
1051on-disk block is corrupt. The exact behavior of which metadata blocks
1052are stored redundantly may change in future releases.
1053.sp
1054The default value is \fBall\fR.
1055.RE
1056
1057.sp
1058.ne 2
1059.na
058ac9ba
BB
1060\fB\fBrefquota\fR=\fIsize\fR | \fBnone\fR\fR
1061.ad
1062.sp .6
1063.RS 4n
1064Limits 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.
1065.RE
1066
1067.sp
1068.ne 2
1069.mk
1070.na
1071\fB\fBrefreservation\fR=\fIsize\fR | \fBnone\fR\fR
1072.ad
1073.sp .6
1074.RS 4n
1075The 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 is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
1076.sp
1077If \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.
1078.sp
1079This property can also be referred to by its shortened column name, \fBrefreserv\fR.
1080.RE
1081
a08ee875
LG
1082.sp
1083.ne 2
1084.mk
1085.na
1086\fB\fBrelatime\fR=\fBon\fR | \fBoff\fR\fR
1087.ad
1088.sp .6
1089.RS 4n
1090Controls the manner in which the access time is updated when \fBatime=on\fR is set. Turning this property \fBon\fR causes the access time to be updated relative to the modify or change time. Access time is only updated if the previous access time was earlier than the current modify or change time or if the existing access time hasn't been updated within the past 24 hours. The default value is \fBoff\fR.
1091.RE
1092
058ac9ba
BB
1093.sp
1094.ne 2
1095.mk
1096.na
1097\fB\fBreservation\fR=\fIsize\fR | \fBnone\fR\fR
1098.ad
1099.sp .6
1100.RS 4n
1101The 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 used, and count against the parent datasets' quotas and reservations.
1102.sp
1103This property can also be referred to by its shortened column name, \fBreserv\fR.
1104.RE
1105
1106.sp
1107.ne 2
1108.mk
1109.na
1110\fB\fBsecondarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
1111.ad
1112.sp .6
1113.RS 4n
1114Controls what is cached in the secondary cache (L2ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
1115.RE
1116
1117.sp
1118.ne 2
1119.mk
1120.na
1121\fB\fBsetuid\fR=\fBon\fR | \fBoff\fR\fR
1122.ad
1123.sp .6
1124.RS 4n
1125Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is \fBon\fR.
1126.RE
1127
1128.sp
1129.ne 2
1130.mk
1131.na
1132\fB\fBshareiscsi\fR=\fBon\fR | \fBoff\fR\fR
1133.ad
1134.sp .6
1135.RS 4n
1136Like the \fBsharenfs\fR property, \fBshareiscsi\fR indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are \fBon\fR, \fBoff\fR, and \fBtype=disk\fR. The default value is \fBoff\fR. In the future, other target types might be supported. For example, \fBtape\fR.
1137.sp
1138You might want to set \fBshareiscsi=on\fR for a file system so that all \fBZFS\fR volumes within the file system are shared by default. However, setting this property on a file system has no direct effect.
1139.RE
1140
1141.sp
1142.ne 2
1143.mk
1144.na
645fb9cc 1145\fB\fBsharesmb\fR=\fBon\fR | \fBoff\fR
058ac9ba
BB
1146.ad
1147.sp .6
1148.RS 4n
645fb9cc 1149Controls whether the file system is shared by using \fBSamba USERSHARES\fR, and what options are to be used. 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 \fBon\fR, the \fBnet\fR(8) command is invoked to create a \fBUSERSHARE\fR.
058ac9ba 1150.sp
645fb9cc 1151Because \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 (\fB_\fR) characters. The ZFS On Linux driver does not (yet) support additional options which might be availible in the Solaris version.
058ac9ba 1152.sp
645fb9cc 1153If the \fBsharesmb\fR property is set to \fBoff\fR, the file systems are unshared.
058ac9ba 1154.sp
c06d4368
AX
1155In Linux, the share is created with the ACL (Access Control List) "Everyone:F" ("F" stands for "full permissions", ie. read and write permissions) and no guest access (which means samba must be able to authenticate a real user, system passwd/shadow, ldap or smbpasswd based) by default. This means that any additional access control (dissalow specific user specific access etc) must be done on the underlaying filesystem.
1156.sp
1157.in +2
1158Example to mount a SMB filesystem shared through ZFS (share/tmp):
1159.mk
1160Note that a user and his/her password \fBmust\fR be given!
1161.sp
1162.in +2
1163smbmount //127.0.0.1/share_tmp /mnt/tmp -o user=workgroup/turbo,password=obrut,uid=1000
1164.in -2
1165.in -2
645fb9cc
TF
1166.sp
1167.ne 2
1168.mk
1169.na
1170\fBMinimal /etc/samba/smb.conf configuration\fR
1171.sp
1172.in +2
1173* Samba will need to listen to 'localhost' (127.0.0.1) for the zfs utilities to communitate with samba. This is the default behavior for most Linux distributions.
1174.sp
c06d4368
AX
1175* Samba must be able to authenticate a user. This can be done in a number of ways, depending on if using the system password file, LDAP or the Samba specific smbpasswd file. How to do this is outside the scope of this manual. Please refer to the smb.conf(5) manpage for more information.
1176.sp
1177* See the \fBUSERSHARE\fR section of the \fBsmb.conf\fR(5) man page for all configuration options in case you need to modify any options to the share afterwards. Do note that any changes done with the 'net' command will be undone if the share is every unshared (such as at a reboot etc). In the future, ZoL will be able to set specific options directly using sharesmb=<option>.
645fb9cc
TF
1178.sp
1179.in -2
058ac9ba
BB
1180.RE
1181
1182.sp
1183.ne 2
1184.mk
1185.na
1186\fB\fBsharenfs\fR=\fBon\fR | \fBoff\fR | \fIopts\fR\fR
1187.ad
1188.sp .6
1189.RS 4n
ea04106b
AX
1190Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a \fBsharenfs\fR property of \fBoff\fR is managed with the \fBexportfs\fR(8) command and entries in \fB/etc/exports\fR file. 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 \fBon\fR, the dataset is shared using the \fBexportfs\fR(8) command in the following manner (see \fBexportfs\fR(8) for the meaning of the different options):
1191.sp
1192.in +4
1193.nf
1194/usr/sbin/exportfs -i -o sec=sys,rw,no_subtree_check,no_root_squash,mountpoint *:<mountpoint of dataset>
1195.fi
1196.in -4
1197.sp
1198Otherwise, the \fBexportfs\fR(8) command is invoked with options equivalent to the contents of this property.
058ac9ba
BB
1199.sp
1200When the \fBsharenfs\fR 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 \fBoff\fR, or if they were shared before the property was changed. If the new property is \fBoff\fR, the file systems are unshared.
1201.RE
1202
1203.sp
1204.ne 2
1205.mk
1206.na
1207\fB\fBlogbias\fR = \fBlatency\fR | \fBthroughput\fR\fR
1208.ad
1209.sp .6
1210.RS 4n
1211Provide a hint to ZFS about handling of synchronous requests in this dataset. If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS will use pool log devices (if configured) to handle the requests at low latency. If \fBlogbias\fR is set to \fBthroughput\fR, ZFS will not use configured pool log devices. ZFS will instead optimize synchronous operations for global pool throughput and efficient use of resources.
1212.RE
1213
0b4d1b58
ED
1214.sp
1215.ne 2
1216.mk
1217.na
1218\fB\fBsnapdev\fR=\fBhidden\fR | \fBvisible\fR\fR
1219.ad
1220.sp .6
1221.RS 4n
1222Controls whether the snapshots devices of zvol's are hidden or visible. The default value is \fBhidden\fR.
1223.RE
1224
058ac9ba
BB
1225.sp
1226.ne 2
1227.mk
1228.na
1229\fB\fBsnapdir\fR=\fBhidden\fR | \fBvisible\fR\fR
1230.ad
1231.sp .6
1232.RS 4n
1233Controls whether the \fB\&.zfs\fR directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is \fBhidden\fR.
1234.RE
1235
1236.sp
1237.ne 2
1238.mk
1239.na
c06d4368 1240\fB\fBsync\fR=\fBstandard\fR | \fBalways\fR | \fBdisabled\fR\fR
330d06f9
MA
1241.ad
1242.sp .6
1243.RS 4n
1244Controls the behavior of synchronous requests (e.g. fsync, O_DSYNC).
c06d4368 1245\fBstandard\fR is the POSIX specified behavior of ensuring all synchronous
330d06f9
MA
1246requests are written to stable storage and all devices are flushed to ensure
1247data is not cached by device controllers (this is the default). \fBalways\fR
1248causes every file system transaction to be written and flushed before its
1249system call returns. This has a large performance penalty. \fBdisabled\fR
1250disables synchronous requests. File system transactions are only committed to
1251stable storage periodically. This option will give the highest performance.
1252However, it is very dangerous as ZFS would be ignoring the synchronous
1253transaction demands of applications such as databases or NFS. Administrators
1254should only use this option when the risks are understood.
1255.RE
1256
1257.sp
1258.ne 2
1259.na
058ac9ba
BB
1260\fB\fBversion\fR=\fB1\fR | \fB2\fR | \fBcurrent\fR\fR
1261.ad
1262.sp .6
1263.RS 4n
1264The 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 the \fBzfs upgrade\fR command.
1265.RE
1266
1267.sp
1268.ne 2
1269.mk
1270.na
1271\fB\fBvolsize\fR=\fIsize\fR\fR
1272.ad
1273.sp .6
1274.RS 4n
1275For 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 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.
1276.sp
1277The 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 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.
1278.sp
1279Though 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. 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.
1280.RE
1281
1282.sp
1283.ne 2
1284.mk
1285.na
1286\fB\fBvscan\fR=\fBon\fR | \fBoff\fR\fR
1287.ad
1288.sp .6
1289.RS 4n
1290Controls 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 \fBoff\fR.
1291.RE
1292
1293.sp
1294.ne 2
1295.mk
1296.na
a08ee875 1297\fB\fBxattr\fR=\fBon\fR | \fBoff\fR | \fBsa\fR\fR
058ac9ba
BB
1298.ad
1299.sp .6
1300.RS 4n
a08ee875
LG
1301Controls whether extended attributes are enabled for this file system. Two
1302styles of extended attributes are supported either directory based or system
1303attribute based.
1304.sp
1305The default value of \fBon\fR enables directory based extended attributes.
1306This style of xattr imposes no practical limit on either the size or number of
1307xattrs which may be set on a file. Although under Linux the \fBgetxattr\fR(2)
1308and \fBsetxattr\fR(2) system calls limit the maximum xattr size to 64K. This
1309is the most compatible style of xattr and it is supported by the majority of
1310ZFS implementations.
1311.sp
1312System attribute based xattrs may be enabled by setting the value to \fBsa\fR.
1313The key advantage of this type of xattr is improved performance. Storing
1314xattrs as system attributes significantly decreases the amount of disk IO
1315required. Up to 64K of xattr data may be stored per file in the space reserved
1316for system attributes. If there is not enough space available for an xattr then
1317it will be automatically written as a directory based xattr. System attribute
1318based xattrs are not accessable on platforms which do not support the
1319\fBxattr=sa\fR feature.
1320.sp
1321The use of system attribute based xattrs is strongly encouraged for users of
1322SELinux or Posix ACLs. Both of these features heavily rely of xattrs and
1323benefit significantly from the reduced xattr access time.
058ac9ba
BB
1324.RE
1325
1326.sp
1327.ne 2
1328.mk
1329.na
1330\fB\fBzoned\fR=\fBon\fR | \fBoff\fR\fR
1331.ad
1332.sp .6
1333.RS 4n
4da4a9e1 1334Controls whether the dataset is managed from a non-global zone. Zones are a Solaris feature and are not relevant on Linux. The default value is \fBoff\fR.
058ac9ba
BB
1335.RE
1336
1337.sp
1338.LP
1339The 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 or \fBzpool create\fR commands, these properties are inherited from the parent dataset. 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.
1340.sp
1341.ne 2
1342.mk
1343.na
1344\fB\fBcasesensitivity\fR=\fBsensitive\fR | \fBinsensitive\fR | \fBmixed\fR\fR
1345.ad
1346.sp .6
1347.RS 4n
1348Indicates 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. Traditionally, UNIX and POSIX file systems have case-sensitive file names.
1349.sp
1350The \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 that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the \fBmixed\fR value behavior, see the \fISolaris ZFS Administration Guide\fR.
1351.RE
1352
1353.sp
1354.ne 2
1355.mk
1356.na
1357\fB\fBnormalization\fR = \fBnone\fR | \fBformC\fR | \fBformD\fR | \fBformKC\fR | \fBformKD\fR\fR
1358.ad
1359.sp .6
1360.RS 4n
1361Indicates 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 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. The default value of the \fBnormalization\fR property is \fBnone\fR. This property cannot be changed after the file system is created.
1362.RE
1363
1364.sp
1365.ne 2
1366.mk
1367.na
1368\fB\fButf8only\fR=\fBon\fR | \fBoff\fR\fR
1369.ad
1370.sp .6
1371.RS 4n
1372Indicates 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 explicitly set or be set to \fBnone\fR. The default value for the \fButf8only\fR property is \fBoff\fR. This property cannot be changed after the file system is created.
1373.RE
1374
1375.sp
1376.LP
1377The \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 feature.
a08ee875
LG
1378.RE
1379
1380.sp
1381.ne 2
1382.mk
1383.na
1384\fB\fBcontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
1385.ad
1386.sp .6
1387.RS 4n
1388This flag sets the SELinux context for all files in the filesytem under the mountpoint for that filesystem. See \fBselinux\fR(8) for more information.
1389.RE
1390
1391.sp
1392.ne 2
1393.mk
1394.na
1395\fB\fBfscontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
1396.ad
1397.sp .6
1398.RS 4n
1399This flag sets the SELinux context for the filesytem being mounted. See \fBselinux\fR(8) for more information.
1400.RE
1401
1402.sp
1403.ne 2
1404.mk
1405.na
1406\fB\fBdefntext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
1407.ad
1408.sp .6
1409.RS 4n
1410This flag sets the SELinux context for unlabeled files. See \fBselinux\fR(8) for more information.
1411.RE
1412
058ac9ba 1413.sp
a08ee875
LG
1414.ne 2
1415.mk
1416.na
1417\fB\fBrootcontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
1418.ad
1419.sp .6
1420.RS 4n
1421This flag sets the SELinux context for the root inode of the filesystem. See \fBselinux\fR(8) for more information.
1422.RE
1423
ea04106b
AX
1424.sp
1425.ne 2
1426.mk
1427.na
1428\fB\fBoverlay\fR=\fBon\fR | \fBoff\fR\fR
1429.ad
1430.sp .6
1431.RS 4n
1432Allow mounting on a busy directory or a directory which already contains files/directories. This is the default mount behavior for Linux filesystems. However, for consistency with ZFS on other platforms overlay mounts are disabled by default. Set \fBoverlay=on\fR to enable overlay mounts.
1433.RE
1434
a08ee875 1435.SS "Temporary Mount Point Properties"
058ac9ba 1436.LP
2d1b7b0b 1437When a file system is mounted, either through \fBmount\fR(8) for legacy mounts or the \fBzfs mount\fR command for normal file systems, its mount options are set according to its properties. The correlation between properties and mount options is as follows:
058ac9ba
BB
1438.sp
1439.in +2
1440.nf
1441 PROPERTY MOUNT OPTION
1442 devices devices/nodevices
1443 exec exec/noexec
1444 readonly ro/rw
1445 setuid setuid/nosetuid
1446 xattr xattr/noxattr
1447.fi
1448.in -2
1449.sp
1450
1451.sp
1452.LP
1453In 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 \fBnodevices,nosetuid\fR. 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.
1454.SS "User Properties"
058ac9ba
BB
1455.LP
1456In 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 (file systems, volumes, and snapshots).
1457.sp
1458.LP
1459User property names must contain a colon (\fB:\fR) character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (\fB:\fR), dash (\fB-\fR), period (\fB\&.\fR), and underscore (\fB_\fR). The expected convention is that the property name is divided into two portions such as \fImodule\fR\fB:\fR\fIproperty\fR, but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters, and cannot begin with a dash (\fB-\fR).
1460.sp
1461.LP
4da4a9e1 1462When 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 different purposes. For example, property names beginning with \fBcom.sun\fR. are reserved for use by Oracle Corporation (which acquired Sun Microsystems).
058ac9ba
BB
1463.sp
1464.LP
1465The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties (\fBzfs list\fR, \fBzfs get\fR, \fBzfs set\fR, and so forth) can be used to manipulate both native properties and user properties. 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.
4da4a9e1 1466.SS "ZFS Volumes as Swap"
058ac9ba 1467.LP
52768784
BB
1468\fBZFS\fR volumes may be used as Linux swap devices. After creating the volume
1469with the \fBzfs create\fR command set up and enable the swap area using the
1470\fBmkswap\fR(8) and \fBswapon\fR(8) commands. Do not swap to a file on a
1471\fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
058ac9ba 1472.SH SUBCOMMANDS
058ac9ba
BB
1473.LP
1474All subcommands that modify state are logged persistently to the pool in their original form.
1475.sp
1476.ne 2
1477.mk
1478.na
1479\fB\fBzfs ?\fR\fR
1480.ad
1481.sp .6
1482.RS 4n
1483Displays a help message.
1484.RE
1485
1486.sp
1487.ne 2
1488.mk
1489.na
1490\fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR\fR
1491.ad
1492.sp .6
1493.RS 4n
1494Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the \fBmountpoint\fR property inherited from the parent.
1495.sp
1496.ne 2
1497.mk
1498.na
1499\fB\fB-p\fR\fR
1500.ad
1501.sp .6
1502.RS 4n
1503Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
1504.RE
1505
1506.sp
1507.ne 2
1508.mk
1509.na
1510\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1511.ad
1512.sp .6
1513.RS 4n
1514Sets the specified property as if the command \fBzfs set\fR \fIproperty\fR=\fIvalue\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 error results if the same property is specified in multiple \fB-o\fR options.
1515.RE
1516
1517.RE
1518
1519.sp
1520.ne 2
1521.mk
1522.na
1523\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
1524.ad
1525.sp .6
1526.RS 4n
1fe2e237 1527Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/\fR\fIpath\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
058ac9ba
BB
1528.sp
1529\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.
1530.sp
1531.ne 2
1532.mk
1533.na
1534\fB\fB-p\fR\fR
1535.ad
1536.sp .6
1537.RS 4n
1538Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
1539.RE
1540
1541.sp
1542.ne 2
1543.mk
1544.na
1545\fB\fB-s\fR\fR
1546.ad
1547.sp .6
1548.RS 4n
1549Creates a sparse volume with no reservation. See \fBvolsize\fR in the Native Properties section for more information about sparse volumes.
1550.RE
1551
1552.sp
1553.ne 2
1554.mk
1555.na
1556\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1557.ad
1558.sp .6
1559.RS 4n
1560Sets the specified property as if the \fBzfs set\fR \fIproperty\fR=\fIvalue\fR command 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 error results if the same property is specified in multiple \fB-o\fR options.
1561.RE
1562
1563.sp
1564.ne 2
1565.mk
1566.na
1567\fB\fB-b\fR \fIblocksize\fR\fR
1568.ad
1569.sp .6
1570.RS 4n
1571Equivalent to \fB-o\fR \fBvolblocksize\fR=\fIblocksize\fR. If this option is specified in conjunction with \fB-o\fR \fBvolblocksize\fR, the resulting behavior is undefined.
1572.RE
1573
1574.RE
1575
1576.sp
1577.ne 2
1578.mk
1579.na
330d06f9 1580\fBzfs destroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
1581.ad
1582.sp .6
1583.RS 4n
1584Destroys 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 or clones).
1585.sp
1586.ne 2
1587.mk
1588.na
1589\fB\fB-r\fR\fR
1590.ad
1591.sp .6
1592.RS 4n
1593Recursively destroy all children.
1594.RE
1595
1596.sp
1597.ne 2
1598.mk
1599.na
1600\fB\fB-R\fR\fR
1601.ad
1602.sp .6
1603.RS 4n
1604Recursively destroy all dependents, including cloned file systems outside the target hierarchy.
1605.RE
1606
1607.sp
1608.ne 2
1609.mk
1610.na
1611\fB\fB-f\fR\fR
1612.ad
1613.sp .6
1614.RS 4n
1615Force 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.
1616.RE
1617
330d06f9
MA
1618.sp
1619.ne 2
1620.na
1621\fB\fB-n\fR\fR
1622.ad
1623.sp .6
1624.RS 4n
1625Do a dry-run ("No-op") deletion. No data will be deleted. This is
1626useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
1627data would be deleted.
1628.RE
1629
1630.sp
1631.ne 2
1632.na
1633\fB\fB-p\fR\fR
1634.ad
1635.sp .6
1636.RS 4n
1637Print machine-parsable verbose information about the deleted data.
1638.RE
1639
1640.sp
1641.ne 2
1642.na
1643\fB\fB-v\fR\fR
1644.ad
1645.sp .6
1646.RS 4n
1647Print verbose information about the deleted data.
1648.RE
1649.sp
1650
f5fc4aca 1651Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use.
058ac9ba
BB
1652.RE
1653
1654.sp
1655.ne 2
1656.mk
1657.na
330d06f9 1658\fBzfs destroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
058ac9ba
BB
1659.ad
1660.sp .6
1661.RS 4n
330d06f9
MA
1662The given snapshots are destroyed immediately if and only if the \fBzfs destroy\fR command without the \fB-d\fR option would have destroyed it. Such immediate destruction would occur, for example, if the snapshot had no clones and the user-initiated reference count were zero.
1663.sp
1664If a snapshot does not qualify for immediate destruction, it is marked for deferred destruction. In this state, it exists as a usable, visible snapshot until both of the preconditions listed above are met, at which point it is destroyed.
1665.sp
1666An inclusive range of snapshots may be specified by separating the
1667first and last snapshots with a percent sign.
1668The first and/or last snapshots may be left blank, in which case the
1669filesystem's oldest or newest snapshot will be implied.
058ac9ba 1670.sp
330d06f9
MA
1671Multiple snapshots
1672(or ranges of snapshots) of the same filesystem or volume may be specified
1673in a comma-separated list of snapshots.
1674Only the snapshot's short name (the
1675part after the \fB@\fR) should be specified when using a range or
1676comma-separated list to identify multiple snapshots.
058ac9ba
BB
1677.sp
1678.ne 2
1679.mk
1680.na
1681\fB\fB-d\fR\fR
1682.ad
1683.sp .6
1684.RS 4n
1685Defer snapshot deletion.
1686.RE
1687
1688.sp
1689.ne 2
1690.mk
1691.na
1692\fB\fB-r\fR\fR
1693.ad
1694.sp .6
1695.RS 4n
3b204150 1696Destroy (or mark for deferred destruction) all snapshots with this name in descendent file systems.
058ac9ba
BB
1697.RE
1698
1699.sp
1700.ne 2
1701.mk
1702.na
1703\fB\fB-R\fR\fR
1704.ad
1705.sp .6
1706.RS 4n
a08ee875
LG
1707Recursively destroy all clones of these snapshots, including the clones,
1708snapshots, and children. If this flag is specified, the \fB-d\fR flag will
1709have no effect.
058ac9ba
BB
1710.RE
1711
330d06f9
MA
1712.sp
1713.ne 2
1714.na
1715\fB\fB-n\fR\fR
1716.ad
1717.sp .6
1718.RS 4n
1719Do a dry-run ("No-op") deletion. No data will be deleted. This is
1720useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
1721data would be deleted.
1722.RE
1723
1724.sp
1725.ne 2
1726.na
1727\fB\fB-p\fR\fR
1728.ad
1729.sp .6
1730.RS 4n
1731Print machine-parsable verbose information about the deleted data.
1732.RE
1733
1734.sp
1735.ne 2
1736.na
1737\fB\fB-v\fR\fR
1738.ad
1739.sp .6
1740.RS 4n
1741Print verbose information about the deleted data.
1742.RE
1743
1744.sp
a08ee875 1745Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR
330d06f9
MA
1746options, as they can destroy large portions of a pool and cause unexpected
1747behavior for mounted file systems in use.
1748.RE
1749
058ac9ba
BB
1750.RE
1751
1752.sp
1753.ne 2
1754.mk
1755.na
ea04106b
AX
1756\fBzfs destroy\fR \fIfilesystem\fR|\fIvolume\fR#\fIbookmark\fR
1757.ad
1758.sp .6
1759.RS 4n
1760The given bookmark is destroyed.
1761
1762.RE
1763
1764.sp
1765.ne 2
1766.na
a08ee875 1767\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR ...
058ac9ba
BB
1768.ad
1769.sp .6
1770.RS 4n
a08ee875 1771Creates snapshots with the given names. All previous modifications by successful system calls to the file system are part of the snapshots. Snapshots are taken atomically, so that all snapshots correspond to the same moment in time. See the "Snapshots" section for details.
058ac9ba
BB
1772.sp
1773.ne 2
1774.mk
1775.na
1776\fB\fB-r\fR\fR
1777.ad
1778.sp .6
1779.RS 4n
a08ee875 1780Recursively create snapshots of all descendent datasets.
058ac9ba
BB
1781.RE
1782
1783.sp
1784.ne 2
1785.mk
1786.na
1787\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1788.ad
1789.sp .6
1790.RS 4n
1791Sets the specified property; see \fBzfs create\fR for details.
1792.RE
1793
1794.RE
1795
1796.sp
1797.ne 2
1798.mk
1799.na
1800\fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
1801.ad
1802.sp .6
1803.RS 4n
ea04106b 1804Roll 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 the most recent one. In order to do so, all intermediate snapshots and bookmarks must be destroyed by specifying the \fB-r\fR option.
058ac9ba 1805.sp
ea04106b 1806The \fB-rR\fR options do not recursively destroy the child snapshots of a recursive snapshot. Only direct snapshots of the specified filesystem are destroyed by either of these options. To completely roll back a recursive snapshot, you must rollback the individual child snapshots.
058ac9ba
BB
1807.sp
1808.ne 2
1809.mk
1810.na
1811\fB\fB-r\fR\fR
1812.ad
1813.sp .6
1814.RS 4n
ea04106b 1815Destroy any snapshots and bookmarks more recent than the one specified.
058ac9ba
BB
1816.RE
1817
1818.sp
1819.ne 2
1820.mk
1821.na
1822\fB\fB-R\fR\fR
1823.ad
1824.sp .6
1825.RS 4n
ea04106b 1826Recursively destroy any more recent snapshots and bookmarks, as well as any clones of those snapshots.
058ac9ba
BB
1827.RE
1828
1829.sp
1830.ne 2
1831.mk
1832.na
1833\fB\fB-f\fR\fR
1834.ad
1835.sp .6
1836.RS 4n
1837Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
1838.RE
1839
1840.RE
1841
1842.sp
1843.ne 2
1844.mk
1845.na
1846\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
1847.ad
1848.sp .6
1849.RS 4n
1850Creates 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.
1851.sp
1852.ne 2
1853.mk
1854.na
1855\fB\fB-p\fR\fR
1856.ad
1857.sp .6
1858.RS 4n
1859Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
1860.RE
1861
1862.sp
1863.ne 2
1864.mk
1865.na
1866\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1867.ad
1868.sp .6
1869.RS 4n
1870Sets the specified property; see \fBzfs create\fR for details.
1871.RE
1872
1873.RE
1874
1875.sp
1876.ne 2
1877.mk
1878.na
1879\fB\fBzfs promote\fR \fIclone-filesystem\fR\fR
1880.ad
1881.sp .6
1882.RS 4n
1883Promotes 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 becomes a clone of the specified file system.
1884.sp
1885The 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 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.
1886.RE
1887
1888.sp
1889.ne 2
1890.mk
1891.na
db49968e 1892\fB\fBzfs rename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
058ac9ba
BB
1893.ad
1894.br
1895.na
1896\fB\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1897.ad
1898.br
1899.na
db49968e 1900\fB\fBzfs rename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
058ac9ba
BB
1901.ad
1902.sp .6
1903.RS 4n
1904Renames 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 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.
1905.sp
1906.ne 2
1907.mk
1908.na
1909\fB\fB-p\fR\fR
1910.ad
1911.sp .6
1912.RS 4n
1913Creates all the nonexistent parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent.
1914.RE
1915
db49968e
ES
1916.sp
1917.ne 2
1918.na
1919\fB\fB-f\fR\fR
1920.ad
1921.sp .6
1922.RS 4n
1923Force unmount any filesystems that need to be unmounted in the process.
1924.RE
1925
058ac9ba
BB
1926.RE
1927
1928.sp
1929.ne 2
1930.mk
1931.na
1932\fB\fBzfs rename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR\fR
1933.ad
1934.sp .6
1935.RS 4n
1936Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively.
1937.RE
1938
1939.sp
1940.ne 2
1941.mk
1942.na
a08ee875 1943\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR
058ac9ba
BB
1944.ad
1945.sp .6
1946.RS 4n
a08ee875 1947Lists 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 file systems and volumes are displayed. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR (the default is \fBoff\fR). When listing hundreds or thousands of snapshots performance can be improved by restricting the output to only the name. In that case, it is recommended to use \fB-o name -s name\fR. The following fields are displayed by default, \fBname,used,available,referenced,mountpoint\fR.
058ac9ba
BB
1948.sp
1949.ne 2
1950.mk
1951.na
1952\fB\fB-H\fR\fR
1953.ad
1954.sp .6
1955.RS 4n
1956Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space.
1957.RE
1958
a08ee875
LG
1959.sp
1960.ne 2
1961.mk
1962.na
1963\fB\fB-p\fR\fR
1964.sp .6
1965.RS 4n
1966Display numbers in parsable (exact) values.
1967.RE
1968
058ac9ba
BB
1969.sp
1970.ne 2
1971.mk
1972.na
1973\fB\fB-r\fR\fR
1974.ad
1975.sp .6
1976.RS 4n
1977Recursively display any children of the dataset on the command line.
1978.RE
1979
1980.sp
1981.ne 2
1982.mk
1983.na
1984\fB\fB-d\fR \fIdepth\fR\fR
1985.ad
1986.sp .6
1987.RS 4n
1988Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
1989.RE
1990
1991.sp
1992.ne 2
1993.mk
1994.na
1995\fB\fB-o\fR \fIproperty\fR\fR
1996.ad
1997.sp .6
1998.RS 4n
1999A comma-separated list of properties to display. The property must be:
2000.RS +4
2001.TP
2002.ie t \(bu
2003.el o
2004One of the properties described in the "Native Properties" section
2005.RE
2006.RS +4
2007.TP
2008.ie t \(bu
2009.el o
2010A user property
2011.RE
2012.RS +4
2013.TP
2014.ie t \(bu
2015.el o
2016The value \fBname\fR to display the dataset name
2017.RE
2018.RS +4
2019.TP
2020.ie t \(bu
2021.el o
2022The value \fBspace\fR to display space usage properties on file systems and volumes. This is a shortcut for specifying \fB-o name,avail,used,usedsnap,usedds,usedrefreserv,usedchild\fR \fB-t filesystem,volume\fR syntax.
2023.RE
2024.RE
2025
2026.sp
2027.ne 2
2028.mk
2029.na
2030\fB\fB-s\fR \fIproperty\fR\fR
2031.ad
2032.sp .6
2033.RS 4n
2034A property 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 \fBname\fR to sort by the dataset name. Multiple 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.
2035.sp
2036The following is a list of sorting criteria:
2037.RS +4
2038.TP
2039.ie t \(bu
2040.el o
2041Numeric types sort in numeric order.
2042.RE
2043.RS +4
2044.TP
2045.ie t \(bu
2046.el o
2047String types sort in alphabetical order.
2048.RE
2049.RS +4
2050.TP
2051.ie t \(bu
2052.el o
2053Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
2054.RE
2055.RS +4
2056.TP
2057.ie t \(bu
2058.el o
2059If no sorting options are specified the existing behavior of \fBzfs list\fR is preserved.
2060.RE
2061.RE
2062
2063.sp
2064.ne 2
2065.mk
2066.na
2067\fB\fB-S\fR \fIproperty\fR\fR
2068.ad
2069.sp .6
2070.RS 4n
2071Same as the \fB-s\fR option, but sorts by property in descending order.
2072.RE
2073
2074.sp
2075.ne 2
2076.mk
2077.na
2078\fB\fB-t\fR \fItype\fR\fR
2079.ad
2080.sp .6
2081.RS 4n
ea04106b 2082A comma-separated list of types to display, where \fItype\fR is one of \fBfilesystem\fR, \fBsnapshot\fR, \fBsnap\fR, \fBvolume\fR, \fBbookmark\fR, or \fBall\fR. For example, specifying \fB-t snapshot\fR displays only snapshots.
058ac9ba
BB
2083.RE
2084
2085.RE
2086
2087.sp
2088.ne 2
2089.mk
2090.na
2091\fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
2092.ad
2093.sp .6
2094.RS 4n
2095Sets 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 form with a suffix of \fBB\fR, \fBK\fR, \fBM\fR, \fBG\fR, \fBT\fR, \fBP\fR, \fBE\fR, \fBZ\fR (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). User properties can be set on snapshots. For more information, see the "User Properties" section.
2096.RE
2097
2098.sp
2099.ne 2
a08ee875 2100.mk .na
e346ec25 2101\fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR \fIfield\fR[,...] [\fB-t\fR \fItype\fR[,...]] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
058ac9ba
BB
2102.ad
2103.sp .6
2104.RS 4n
2105Displays 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:
2106.sp
2107.in +2
2108.nf
2109 name Dataset name
2110 property Property name
2111 value Property value
2112 source Property source. Can either be local, default,
2113 temporary, inherited, or none (-).
2114.fi
2115.in -2
2116.sp
2117
2118All 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.
2119.sp
ea04106b 2120The special value \fBall\fR can be used to display all properties that apply to the given dataset's type (filesystem, volume snapshot, or bookmark).
058ac9ba
BB
2121.sp
2122.ne 2
2123.mk
2124.na
2125\fB\fB-r\fR\fR
2126.ad
2127.sp .6
2128.RS 4n
2129Recursively display properties for any children.
2130.RE
2131
2132.sp
2133.ne 2
2134.mk
2135.na
2136\fB\fB-d\fR \fIdepth\fR\fR
2137.ad
2138.sp .6
2139.RS 4n
2140Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
2141.RE
2142
2143.sp
2144.ne 2
2145.mk
2146.na
2147\fB\fB-H\fR\fR
2148.ad
2149.sp .6
2150.RS 4n
2151Display 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.
2152.RE
2153
2154.sp
2155.ne 2
2156.mk
2157.na
2158\fB\fB-o\fR \fIfield\fR\fR
2159.ad
2160.sp .6
2161.RS 4n
2162A comma-separated list of columns to display. \fBname,property,value,source\fR is the default value.
2163.RE
2164
2165.sp
2166.ne 2
2167.mk
2168.na
2169\fB\fB-s\fR \fIsource\fR\fR
2170.ad
2171.sp .6
2172.RS 4n
2173A 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: \fBlocal,default,inherited,temporary,none\fR. The default value is all sources.
2174.RE
2175
2176.sp
2177.ne 2
2178.mk
2179.na
2180\fB\fB-p\fR\fR
2181.ad
2182.sp .6
2183.RS 4n
a08ee875 2184Display numbers in parsable (exact) values.
058ac9ba
BB
2185.RE
2186
2187.RE
2188
2189.sp
2190.ne 2
2191.mk
2192.na
2193\fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
2194.ad
2195.sp .6
2196.RS 4n
2197Clears 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.
2198.sp
2199.ne 2
2200.mk
2201.na
2202\fB\fB-r\fR\fR
2203.ad
2204.sp .6
2205.RS 4n
2206Recursively inherit the given property for all children.
2207.RE
2208
2209.RE
2210
2211.sp
2212.ne 2
2213.mk
2214.na
2215\fB\fBzfs upgrade\fR [\fB-v\fR]\fR
2216.ad
2217.sp .6
2218.RS 4n
2219Displays a list of file systems that are not the most recent version.
2220.RE
2221
2222.sp
2223.ne 2
2224.mk
2225.na
2226\fB\fBzfs upgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] [\fB-a\fR | \fIfilesystem\fR]\fR
2227.ad
2228.sp .6
2229.RS 4n
2230Upgrades 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 cannot be accessed on systems running older versions of the software.
2231.sp
2d1b7b0b 2232In general, the file system version is independent of the pool version. See \fBzpool\fR(8) for information on the \fBzpool upgrade\fR command.
058ac9ba
BB
2233.sp
2234In some cases, the file system version and the pool version are interrelated and the pool version must be upgraded before the file system version can be upgraded.
2235.sp
2236.ne 2
2237.mk
2238.na
2239\fB\fB-a\fR\fR
2240.ad
2241.sp .6
2242.RS 4n
2243Upgrade all file systems on all imported pools.
2244.RE
2245
2246.sp
2247.ne 2
2248.mk
2249.na
2250\fB\fIfilesystem\fR\fR
2251.ad
2252.sp .6
2253.RS 4n
2254Upgrade the specified file system.
2255.RE
2256
2257.sp
2258.ne 2
2259.mk
2260.na
2261\fB\fB-r\fR\fR
2262.ad
2263.sp .6
2264.RS 4n
2265Upgrade the specified file system and all descendent file systems
2266.RE
2267
2268.sp
2269.ne 2
2270.mk
2271.na
2272\fB\fB-V\fR \fIversion\fR\fR
2273.ad
2274.sp .6
2275.RS 4n
2276Upgrade 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 software.
2277.RE
2278
2279.RE
2280
2281.sp
2282.ne 2
2283.mk
2284.na
5990da81
YP
2285\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]]
2286[\fB-s\fR \fIfield\fR] ...
2287[\fB-S\fR \fIfield\fR] ...
2288[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
2289.ad
2290.sp .6
2291.RS 4n
5990da81
YP
2292Displays space consumed by, and quotas on, each user in the specified
2293filesystem or snapshot. This corresponds to the \fBuserused@\fR\fIuser\fR and
2294\fBuserquota@\fR\fIuser\fR properties.
058ac9ba
BB
2295.sp
2296.ne 2
2297.mk
2298.na
2299\fB\fB-n\fR\fR
2300.ad
2301.sp .6
2302.RS 4n
2303Print numeric ID instead of user/group name.
2304.RE
2305
2306.sp
2307.ne 2
2308.mk
2309.na
2310\fB\fB-H\fR\fR
2311.ad
2312.sp .6
2313.RS 4n
2314Do not print headers, use tab-delimited output.
2315.RE
2316
2317.sp
2318.ne 2
2319.mk
2320.na
2321\fB\fB-p\fR\fR
2322.ad
2323.sp .6
2324.RS 4n
5990da81 2325Use exact (parsable) numeric output.
058ac9ba
BB
2326.RE
2327
2328.sp
2329.ne 2
2330.mk
2331.na
2332\fB\fB-o\fR \fIfield\fR[,...]\fR
2333.ad
2334.sp .6
2335.RS 4n
5990da81
YP
2336Display only the specified fields from the following
2337set: \fBtype, name, used, quota\fR. The default is to display all fields.
058ac9ba
BB
2338.RE
2339
2340.sp
2341.ne 2
2342.mk
2343.na
2344\fB\fB-s\fR \fIfield\fR\fR
2345.ad
2346.sp .6
2347.RS 4n
5990da81
YP
2348Sort output by this field. The \fIs\fR and \fIS\fR flags may be specified
2349multiple times to sort first by one field, then by another. The default is
2350\fB-s type\fR \fB-s name\fR.
058ac9ba
BB
2351.RE
2352
2353.sp
2354.ne 2
2355.mk
2356.na
2357\fB\fB-S\fR \fIfield\fR\fR
2358.ad
2359.sp .6
2360.RS 4n
2361Sort by this field in reverse order. See \fB-s\fR.
2362.RE
2363
2364.sp
2365.ne 2
2366.mk
2367.na
2368\fB\fB-t\fR \fItype\fR[,...]\fR
2369.ad
2370.sp .6
2371.RS 4n
5990da81
YP
2372Print only the specified types from the following
2373set: \fBall, posixuser, smbuser, posixgroup, smbgroup\fR. The default
2374is \fB-t posixuser,smbuser\fR. The default can be changed to include group
2375types.
058ac9ba
BB
2376.RE
2377
2378.sp
2379.ne 2
2380.mk
2381.na
2382\fB\fB-i\fR\fR
2383.ad
2384.sp .6
2385.RS 4n
5990da81
YP
2386Translate SID to POSIX ID. The POSIX ID may be ephemeral if no mapping exists.
2387Normal POSIX interfaces (for example, \fBstat\fR(2), \fBls\fR \fB-l\fR) perform
2388this translation, so the \fB-i\fR option allows the output from \fBzfs
2389userspace\fR to be compared directly with those utilities. However, \fB-i\fR
2390may lead to confusion if some files were created by an SMB user before a
2391SMB-to-POSIX name mapping was established. In such a case, some files will be owned
2392by the SMB entity and some by the POSIX entity. However, the \fB-i\fR option
2393will report that the POSIX entity has the total usage and quota for both.
058ac9ba
BB
2394.RE
2395
2396.RE
2397
2398.sp
2399.ne 2
2400.mk
2401.na
5990da81
YP
2402\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]]
2403[\fB-s\fR \fIfield\fR] ...
2404[\fB-S\fR \fIfield\fR] ...
2405[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
2406.ad
2407.sp .6
2408.RS 4n
5990da81
YP
2409Displays space consumed by, and quotas on, each group in the specified
2410filesystem or snapshot. This subcommand is identical to \fBzfs userspace\fR,
2411except that the default types to display are \fB-t posixgroup,smbgroup\fR.
058ac9ba
BB
2412.RE
2413
2414.sp
2415.ne 2
2416.mk
2417.na
2418\fB\fBzfs mount\fR\fR
2419.ad
2420.sp .6
2421.RS 4n
2422Displays all \fBZFS\fR file systems currently mounted.
2423.RE
2424
2425.sp
2426.ne 2
2427.mk
2428.na
2429\fB\fBzfs mount\fR [\fB-vO\fR] [\fB-o\fR \fIoptions\fR] \fB-a\fR | \fIfilesystem\fR\fR
2430.ad
2431.sp .6
2432.RS 4n
2433Mounts \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2434.sp
2435.ne 2
2436.mk
2437.na
2438\fB\fB-o\fR \fIoptions\fR\fR
2439.ad
2440.sp .6
2441.RS 4n
5990da81
YP
2442An optional, comma-separated list of mount options to use temporarily for the
2443duration of the mount. See the "Temporary Mount Point Properties" section for
2444details.
058ac9ba
BB
2445.RE
2446
2447.sp
2448.ne 2
2449.mk
2450.na
2451\fB\fB-O\fR\fR
2452.ad
2453.sp .6
2454.RS 4n
2d1b7b0b 2455Perform an overlay mount. See \fBmount\fR(8) for more information.
058ac9ba
BB
2456.RE
2457
2458.sp
2459.ne 2
2460.mk
2461.na
2462\fB\fB-v\fR\fR
2463.ad
2464.sp .6
2465.RS 4n
2466Report mount progress.
2467.RE
2468
2469.sp
2470.ne 2
2471.mk
2472.na
2473\fB\fB-a\fR\fR
2474.ad
2475.sp .6
2476.RS 4n
5990da81
YP
2477Mount all available \fBZFS\fR file systems. Invoked automatically as part of
2478the boot process.
058ac9ba
BB
2479.RE
2480
2481.sp
2482.ne 2
2483.mk
2484.na
2485\fB\fIfilesystem\fR\fR
2486.ad
2487.sp .6
2488.RS 4n
2489Mount the specified filesystem.
2490.RE
2491
2492.RE
2493
2494.sp
2495.ne 2
2496.mk
2497.na
2498\fB\fBzfs unmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
2499.ad
2500.sp .6
2501.RS 4n
2502Unmounts currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
2503.sp
2504.ne 2
2505.mk
2506.na
2507\fB\fB-f\fR\fR
2508.ad
2509.sp .6
2510.RS 4n
2511Forcefully unmount the file system, even if it is currently in use.
2512.RE
2513
2514.sp
2515.ne 2
2516.mk
2517.na
2518\fB\fB-a\fR\fR
2519.ad
2520.sp .6
2521.RS 4n
2522Unmount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2523.RE
2524
2525.sp
2526.ne 2
2527.mk
2528.na
2529\fB\fIfilesystem\fR|\fImountpoint\fR\fR
2530.ad
2531.sp .6
2532.RS 4n
2533Unmount the specified filesystem. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
2534.RE
2535
2536.RE
2537
2538.sp
2539.ne 2
2540.mk
2541.na
2542\fB\fBzfs share\fR \fB-a\fR | \fIfilesystem\fR\fR
2543.ad
2544.sp .6
2545.RS 4n
2546Shares available \fBZFS\fR file systems.
2547.sp
2548.ne 2
2549.mk
2550.na
2551\fB\fB-a\fR\fR
2552.ad
2553.sp .6
2554.RS 4n
2555Share all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2556.RE
2557
2558.sp
2559.ne 2
2560.mk
2561.na
2562\fB\fIfilesystem\fR\fR
2563.ad
2564.sp .6
2565.RS 4n
2566Share the specified filesystem according to the \fBsharenfs\fR and \fBsharesmb\fR properties. File systems are shared when the \fBsharenfs\fR or \fBsharesmb\fR property is set.
2567.RE
2568
2569.RE
2570
2571.sp
2572.ne 2
2573.mk
2574.na
2575\fB\fBzfs unshare\fR \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
2576.ad
2577.sp .6
2578.RS 4n
2579Unshares currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
2580.sp
2581.ne 2
2582.mk
2583.na
2584\fB\fB-a\fR\fR
2585.ad
2586.sp .6
2587.RS 4n
2588Unshare all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2589.RE
2590
2591.sp
2592.ne 2
2593.mk
2594.na
2595\fB\fIfilesystem\fR|\fImountpoint\fR\fR
2596.ad
2597.sp .6
2598.RS 4n
2599Unshare the specified filesystem. The command can also be given a path to a \fBZFS\fR file system shared on the system.
2600.RE
2601
2602.RE
2603
2604.sp
2605.ne 2
2606.mk
2607.na
ea04106b
AX
2608\fB\fBzfs bookmark\fR \fIsnapshot\fR \fIbookmark\fR\fR
2609.ad
2610.sp .6
2611.RS 4n
2612Creates a bookmark of the given snapshot. Bookmarks mark the point in time
2613when the snapshot was created, and can be used as the incremental source for
2614a \fBzfs send\fR command.
2615.sp
2616This feature must be enabled to be used.
2617See \fBzpool-features\fR(5) for details on ZFS feature flags and the
2618\fBbookmarks\fR feature.
2619.RE
2620
2621
2622.RE
2623.sp
2624.ne 2
2625.na
2626\fBzfs send\fR [\fB-DnPpRve\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
058ac9ba
BB
2627.ad
2628.sp .6
2629.RS 4n
2630Creates 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.
2631.sp
2632.ne 2
2633.mk
2634.na
2635\fB\fB-i\fR \fIsnapshot\fR\fR
2636.ad
2637.sp .6
2638.RS 4n
ea04106b 2639Generate an incremental stream from the first \fIsnapshot\fR (the incremental source) to the second \fIsnapshot\fR (the incremental target). The incremental source can be specified as the last component of the snapshot name (the \fB@\fR character and following) and it is assumed to be from the same file system as the incremental target.
058ac9ba
BB
2640.sp
2641If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, \fBpool/fs@origin\fR, not just \fB@origin\fR).
2642.RE
2643
2644.sp
2645.ne 2
2646.mk
2647.na
2648\fB\fB-I\fR \fIsnapshot\fR\fR
2649.ad
2650.sp .6
2651.RS 4n
ea04106b 2652Generate 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 may be specified as with the \fB-i\fR option.
058ac9ba
BB
2653.RE
2654
e0f86c98
BB
2655.sp
2656.ne 2
2657.mk
2658.na
9566fb1a 2659\fB\fB-R\fR\fR
e0f86c98
BB
2660.ad
2661.sp .6
2662.RS 4n
9566fb1a
SB
2663Generate a replication stream package, which will replicate the specified filesystem, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
2664.sp
2665If 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 received, snapshots and file systems that do not exist on the sending side are destroyed.
e0f86c98
BB
2666.RE
2667
058ac9ba
BB
2668.sp
2669.ne 2
2670.mk
2671.na
9566fb1a 2672\fB\fB-D\fR\fR
058ac9ba
BB
2673.ad
2674.sp .6
2675.RS 4n
ea04106b 2676Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must also support this feature to receive a deduplicated stream. This flag can be used regardless of the dataset's dedup property, but performance will be much better if the filesystem uses a dedup-capable checksum (eg. sha256).
058ac9ba
BB
2677.RE
2678
2679.sp
2680.ne 2
2681.mk
2682.na
ea04106b
AX
2683\fB\fB-e\fR\fR
2684.ad
2685.sp .6
2686.RS 4n
2687Generate a more compact stream by using WRITE_EMBEDDED records for blocks
2688which are stored more compactly on disk by the \fBembedded_data\fR pool
2689feature. This flag has no effect if the \fBembedded_data\fR feature is
2690disabled. The receiving system must have the \fBembedded_data\fR feature
2691enabled. If the \fBlz4_compress\fR feature is active on the sending system,
2692then the receiving system must have that feature enabled as well. See
2693\fBzpool-features\fR(5) for details on ZFS feature flags and the
2694\fBembedded_data\fR feature.
2695.RE
2696
2697.sp
2698.ne 2
2699.na
9566fb1a
SB
2700\fB\fB-p\fR\fR
2701.ad
2702.sp .6
2703.RS 4n
2704Include the dataset's properties in the stream. This flag is implicit when -R is specified. The receiving system must also support this feature.
2705.RE
2706
2707.sp
2708.ne 2
2709.na
2710\fB\fB-n\fR\fR
058ac9ba
BB
2711.ad
2712.sp .6
2713.RS 4n
9566fb1a
SB
2714Do a dry-run ("No-op") send. Do not generate any actual send data. This is
2715useful in conjunction with the \fB-v\fR or \fB-P\fR flags to determine what
2716data will be sent.
2717.RE
2718
e0f86c98 2719.sp
9566fb1a
SB
2720.ne 2
2721.na
2722\fB\fB-P\fR\fR
2723.ad
2724.sp .6
2725.RS 4n
2726Print machine-parsable verbose information about the stream package generated.
e0f86c98
BB
2727.RE
2728
2729.sp
2730.ne 2
2731.mk
2732.na
9566fb1a 2733\fB\fB-v\fR\fR
e0f86c98
BB
2734.ad
2735.sp .6
2736.RS 4n
9566fb1a
SB
2737Print verbose information about the stream package generated. This information
2738includes a per-second report of how much data has been sent.
058ac9ba
BB
2739.RE
2740
2741The format of the stream is committed. You will be able to receive your streams on future versions of \fBZFS\fR.
2742.RE
2743
ea04106b
AX
2744.RE
2745.sp
2746.ne 2
2747.na
2748\fBzfs send\fR [\fB-e\fR] [\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
2749.ad
2750.sp .6
2751.RS 4n
2752Generate a send stream, which may be of a filesystem, and may be
2753incremental from a bookmark. If the destination is a filesystem or volume,
2754the pool must be read-only, or the filesystem must not be mounted. When the
2755stream generated from a filesystem or volume is received, the default snapshot
2756name will be "--head--".
2757
2758.sp
2759.ne 2
2760.na
2761\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR
2762.ad
2763.sp .6
2764.RS 4n
2765Generate an incremental send stream. The incremental source must be an earlier
2766snapshot in the destination's history. It will commonly be an earlier
2767snapshot in the destination's filesystem, in which case it can be
2768specified as the last component of the name (the \fB#\fR or \fB@\fR character
2769and following).
2770.sp
2771If the incremental target is a clone, the incremental source can
2772be the origin snapshot, or an earlier snapshot in the origin's filesystem,
2773or the origin's origin, etc.
2774.RE
2775
2776.sp
2777.ne 2
2778.mk
2779.na
2780\fB\fB-e\fR\fR
2781.ad
2782.sp .6
2783.RS 4n
2784Generate a more compact stream by using WRITE_EMBEDDED records for blocks
2785which are stored more compactly on disk by the \fBembedded_data\fR pool
2786feature. This flag has no effect if the \fBembedded_data\fR feature is
2787disabled. The receiving system must have the \fBembedded_data\fR feature
2788enabled. If the \fBlz4_compress\fR feature is active on the sending system,
2789then the receiving system must have that feature enabled as well. See
2790\fBzpool-features\fR(5) for details on ZFS feature flags and the
2791\fBembedded_data\fR feature.
2792.RE
2793
2794.RE
058ac9ba
BB
2795.sp
2796.ne 2
2797.mk
2798.na
2799\fB\fBzfs receive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
2800.ad
2801.br
2802.na
bb8b81ec 2803\fB\fBzfs receive\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR\fR
058ac9ba
BB
2804.ad
2805.sp .6
2806.RS 4n
2807Creates 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 stream. \fBzfs recv\fR can be used as an alias for \fBzfs receive\fR.
2808.sp
2809If 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 recreated, which means the \fBzvol\fR cannot be accessed during the \fBreceive\fR operation.
2810.sp
2811When a snapshot replication package stream that is generated by using the \fBzfs send\fR \fB-R\fR command is received, any snapshots that do not exist on the sending location are destroyed by using the \fBzfs destroy\fR \fB-d\fR command.
2812.sp
bb8b81ec 2813The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the use of the \fB-d\fR or \fB-e\fR options.
058ac9ba 2814.sp
bb8b81ec
BB
2815If 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. If neither of the \fB-d\fR or \fB-e\fR options are specified, the provided target snapshot name is used exactly as provided.
2816.sp
2817The \fB-d\fR and \fB-e\fR options cause the file system name of the target snapshot to be determined by appending a portion of the sent snapshot's name to the specified target \fIfilesystem\fR. If the \fB-d\fR option is specified, all but the first element of the sent snapshot's file system path (usually the pool name) is used and any required intermediate file systems within the specified one are created. If the \fB-e\fR option is specified, then only the last element of the sent snapshot's file system name (i.e. the name of the source file system itself) is used as the target file system name.
058ac9ba
BB
2818.sp
2819.ne 2
2820.mk
2821.na
2822\fB\fB-d\fR\fR
2823.ad
2824.sp .6
2825.RS 4n
bb8b81ec
BB
2826Discard the first element of the sent snapshot's file system name, using the remaining elements to determine the name of the target file system for the new snapshot as described in the paragraph above.
2827.RE
2828
ea04106b 2829
bb8b81ec
BB
2830.sp
2831.ne 2
2832.na
2833\fB\fB-e\fR\fR
2834.ad
2835.sp .6
2836.RS 4n
2837Discard all but the last element of the sent snapshot's file system name, using that element to determine the name of the target file system for the new snapshot as described in the paragraph above.
058ac9ba
BB
2838.RE
2839
2840.sp
2841.ne 2
2842.mk
2843.na
2844\fB\fB-u\fR\fR
2845.ad
2846.sp .6
2847.RS 4n
2848File system that is associated with the received stream is not mounted.
2849.RE
2850
330d06f9
MA
2851.sp
2852.ne 2
2853.na
058ac9ba
BB
2854\fB\fB-v\fR\fR
2855.ad
2856.sp .6
2857.RS 4n
2858Print verbose information about the stream and the time required to perform the receive operation.
2859.RE
2860
2861.sp
2862.ne 2
2863.mk
2864.na
2865\fB\fB-n\fR\fR
2866.ad
2867.sp .6
2868.RS 4n
2869Do 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.
2870.RE
2871
2872.sp
2873.ne 2
2874.mk
2875.na
2876\fB\fB-F\fR\fR
2877.ad
2878.sp .6
2879.RS 4n
2880Force 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 \fBzfs send -R -[iI]\fR), destroy snapshots and file systems that do not exist on the sending side.
2881.RE
2882
058ac9ba
BB
2883.sp
2884.ne 2
2885.mk
2886.na
2887\fB\fBzfs allow\fR \fIfilesystem\fR | \fIvolume\fR\fR
2888.ad
2889.sp .6
2890.RS 4n
2891Displays permissions that have been delegated on the specified filesystem or volume. See the other forms of \fBzfs allow\fR for more information.
2892.RE
2893
2894.sp
2895.ne 2
2896.mk
2897.na
2898\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR
2899.ad
2900.br
2901.na
2902\fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR | \fIvolume\fR\fR
2903.ad
2904.sp .6
2905.RS 4n
2906Delegates \fBZFS\fR administration permission for the file systems to non-privileged users.
2907.sp
2908.ne 2
2909.mk
2910.na
2911\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR
2912.ad
2913.sp .6
2914.RS 4n
2915Specifies 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, 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.
2916.RE
2917
2918.sp
2919.ne 2
2920.mk
2921.na
2922\fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR
2923.ad
2924.sp .6
2925.RS 4n
2926Specifies 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 begin with an at sign (\fB@\fR) , may be specified. See the \fB-s\fR form below for details.
2927.RE
2928
2929.sp
2930.ne 2
2931.mk
2932.na
2933\fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR
2934.ad
2935.sp .6
2936.RS 4n
2937Specifies 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" only for the specified file system. If only the \fB-d\fR option is used, then is allowed only for the descendent file systems.
2938.RE
2939
2940.RE
2941
2942.sp
2943.LP
2944Permissions are generally the ability to use a \fBZFS\fR subcommand or change a \fBZFS\fR property. The following permissions are available:
2945.sp
2946.in +2
2947.nf
2948NAME TYPE NOTES
2949allow subcommand Must also have the permission that is being
2950 allowed
2951clone subcommand Must also have the 'create' ability and 'mount'
2952 ability in the origin file system
2953create subcommand Must also have the 'mount' ability
2954destroy subcommand Must also have the 'mount' ability
0677cb6f
RL
2955diff subcommand Allows lookup of paths within a dataset
2956 given an object number, and the ability to
2957 create snapshots necessary to 'zfs diff'.
058ac9ba
BB
2958mount subcommand Allows mount/umount of ZFS datasets
2959promote subcommand Must also have the 'mount'
2960 and 'promote' ability in the origin file system
2961receive subcommand Must also have the 'mount' and 'create' ability
2962rename subcommand Must also have the 'mount' and 'create'
2963 ability in the new parent
2964rollback subcommand Must also have the 'mount' ability
2965send subcommand
2966share subcommand Allows sharing file systems over NFS or SMB
2967 protocols
2968snapshot subcommand Must also have the 'mount' ability
2969groupquota other Allows accessing any groupquota@... property
2970groupused other Allows reading any groupused@... property
2971userprop other Allows changing any user property
2972userquota other Allows accessing any userquota@... property
2973userused other Allows reading any userused@... property
2974
a08ee875 2975acltype property
058ac9ba 2976aclinherit property
058ac9ba
BB
2977atime property
2978canmount property
2979casesensitivity property
2980checksum property
2981compression property
2982copies property
c8f25918 2983dedup property
058ac9ba
BB
2984devices property
2985exec property
c8f25918
KA
2986logbias property
2987mlslabel property
058ac9ba
BB
2988mountpoint property
2989nbmand property
2990normalization property
2991primarycache property
2992quota property
2993readonly property
2994recordsize property
2995refquota property
2996refreservation property
2997reservation property
2998secondarycache property
2999setuid property
3000shareiscsi property
3001sharenfs property
3002sharesmb property
3003snapdir property
3004utf8only property
3005version property
3006volblocksize property
3007volsize property
3008vscan property
3009xattr property
3010zoned property
3011.fi
3012.in -2
3013.sp
3014
3015.sp
3016.ne 2
3017.mk
3018.na
3019\fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
3020.ad
3021.sp .6
3022.RS 4n
3023Sets "create time" permissions. These permissions are granted (locally) to the creator of any newly-created descendent file system.
3024.RE
3025
3026.sp
3027.ne 2
3028.mk
3029.na
3030\fB\fBzfs allow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
3031.ad
3032.sp .6
3033.RS 4n
3034Defines 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 naming restrictions as ZFS file systems, but the name must begin with an "at sign" (\fB@\fR), and can be no more than 64 characters long.
3035.RE
3036
3037.sp
3038.ne 2
3039.mk
3040.na
3041\fB\fBzfs unallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR
3042.ad
3043.br
3044.na
3045\fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] \fIfilesystem\fR|\fIvolume\fR\fR
3046.ad
3047.br
3048.na
3049\fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
3050.ad
3051.br
3052.na
3053\fB\fIfilesystem\fR|\fIvolume\fR\fR
3054.ad
3055.sp .6
3056.RS 4n
3057Removes 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, 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", not all permissions for every user and group. See the \fBzfs allow\fR command for a description of the \fB-ldugec\fR options.
3058.sp
3059.ne 2
3060.mk
3061.na
3062\fB\fB-r\fR\fR
3063.ad
3064.sp .6
3065.RS 4n
3066Recursively remove the permissions from this file system and all descendents.
3067.RE
3068
3069.RE
3070
3071.sp
3072.ne 2
3073.mk
3074.na
3075\fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
3076.ad
3077.br
3078.na
3079\fB\fIfilesystem\fR|\fIvolume\fR\fR
3080.ad
3081.sp .6
3082.RS 4n
3083Removes permissions from a permission set. If no permissions are specified, then all permissions are removed, thus removing the set entirely.
3084.RE
3085
3086.sp
3087.ne 2
3088.mk
3089.na
3090\fB\fBzfs hold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
3091.ad
3092.sp .6
3093.RS 4n
3094Adds a single reference, named with the \fItag\fR argument, to the specified snapshot or snapshots. Each snapshot has its own tag namespace, and tags must be unique within that space.
3095.sp
3096If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
3097.sp
3098.ne 2
3099.mk
3100.na
3101\fB\fB-r\fR\fR
3102.ad
3103.sp .6
3104.RS 4n
3105Specifies that a hold with the given tag is applied recursively to the snapshots of all descendent file systems.
3106.RE
3107
3108.RE
3109
3110.sp
3111.ne 2
3112.mk
3113.na
3114\fB\fBzfs holds\fR [\fB-r\fR] \fIsnapshot\fR...\fR
3115.ad
3116.sp .6
3117.RS 4n
3118Lists all existing user references for the given snapshot or snapshots.
3119.sp
3120.ne 2
3121.mk
3122.na
3123\fB\fB-r\fR\fR
3124.ad
3125.sp .6
3126.RS 4n
3127Lists the holds that are set on the named descendent snapshots, in addition to listing the holds on the named snapshot.
3128.RE
3129
3130.RE
3131
3132.sp
3133.ne 2
3134.mk
3135.na
3136\fB\fBzfs release\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
3137.ad
3138.sp .6
3139.RS 4n
3140Removes a single reference, named with the \fItag\fR argument, from the specified snapshot or snapshots. The tag must already exist for each snapshot.
3141.sp
3142If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
3143.sp
3144.ne 2
3145.mk
3146.na
3147\fB\fB-r\fR\fR
3148.ad
3149.sp .6
3150.RS 4n
3151Recursively releases a hold with the given tag on the snapshots of all descendent file systems.
3152.RE
3153
3154.RE
3155
0677cb6f
RL
3156.sp
3157.ne 2
3158.mk
3159.na
3160\fB\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
3161.ad
3162.sp .6
3163.RS 4n
3164Display the difference between a snapshot of a given filesystem and another
3165snapshot of that filesystem from a later time or the current contents of the
3166filesystem. The first column is a character indicating the type of change,
3167the other columns indicate pathname, new pathname (in case of rename), change
3168in link count, and optionally file type and/or change time.
3169
3170The types of change are:
3171.in +2
3172.nf
3173- The path has been removed
3174+ The path has been created
3175M The path has been modified
3176R The path has been renamed
3177.fi
3178.in -2
3179.sp
3180.ne 2
3181.na
3182\fB-F\fR
3183.ad
3184.sp .6
3185.RS 4n
3186Display an indication of the type of file, in a manner similar to the \fB-F\fR
3187option of \fBls\fR(1).
3188.in +2
3189.nf
3190B Block device
3191C Character device
3192/ Directory
3193> Door
3194| Named pipe
3195@ Symbolic link
3196P Event port
3197= Socket
3198F Regular file
3199.fi
3200.in -2
3201.RE
3202.sp
3203.ne 2
3204.na
3205\fB-H\fR
3206.ad
3207.sp .6
3208.RS 4n
a08ee875 3209Give more parsable tab-separated output, without header lines and without arrows.
0677cb6f
RL
3210.RE
3211.sp
3212.ne 2
3213.na
3214\fB-t\fR
3215.ad
3216.sp .6
3217.RS 4n
3218Display the path's inode change time as the first column of output.
3219.RE
3220
058ac9ba
BB
3221.SH EXAMPLES
3222.LP
3223\fBExample 1 \fRCreating a ZFS File System Hierarchy
3224.sp
3225.LP
3226The 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 is automatically inherited by the child file system.
3227
3228.sp
3229.in +2
3230.nf
3231# \fBzfs create pool/home\fR
3232# \fBzfs set mountpoint=/export/home pool/home\fR
3233# \fBzfs create pool/home/bob\fR
3234.fi
3235.in -2
3236.sp
3237
3238.LP
3239\fBExample 2 \fRCreating a ZFS Snapshot
3240.sp
3241.LP
3242The following command creates a snapshot named \fByesterday\fR. This snapshot is mounted on demand in the \fB\&.zfs/snapshot\fR directory at the root of the \fBpool/home/bob\fR file system.
3243
3244.sp
3245.in +2
3246.nf
3247# \fBzfs snapshot pool/home/bob@yesterday\fR
3248.fi
3249.in -2
3250.sp
3251
3252.LP
3253\fBExample 3 \fRCreating and Destroying Multiple Snapshots
3254.sp
3255.LP
3256The 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 \fB\&.zfs/snapshot\fR directory at the root of its file system. The second command destroys the newly created snapshots.
3257
3258.sp
3259.in +2
3260.nf
3261# \fBzfs snapshot -r pool/home@yesterday\fR
3262# \fBzfs destroy -r pool/home@yesterday\fR
3263.fi
3264.in -2
3265.sp
3266
3267.LP
3268\fBExample 4 \fRDisabling and Enabling File System Compression
3269.sp
3270.LP
3271The following command disables the \fBcompression\fR property for all file systems under \fBpool/home\fR. The next command explicitly enables \fBcompression\fR for \fBpool/home/anne\fR.
3272
3273.sp
3274.in +2
3275.nf
3276# \fBzfs set compression=off pool/home\fR
3277# \fBzfs set compression=on pool/home/anne\fR
3278.fi
3279.in -2
3280.sp
3281
3282.LP
3283\fBExample 5 \fRListing ZFS Datasets
3284.sp
3285.LP
2d1b7b0b 3286The following command lists all active file systems and volumes in the system. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR. The default is \fBoff\fR. See \fBzpool\fR(8) for more information on pool properties.
058ac9ba
BB
3287
3288.sp
3289.in +2
3290.nf
3291# \fBzfs list\fR
3292 NAME USED AVAIL REFER MOUNTPOINT
3293 pool 450K 457G 18K /pool
3294 pool/home 315K 457G 21K /export/home
3295 pool/home/anne 18K 457G 18K /export/home/anne
3296 pool/home/bob 276K 457G 276K /export/home/bob
3297.fi
3298.in -2
3299.sp
3300
3301.LP
3302\fBExample 6 \fRSetting a Quota on a ZFS File System
3303.sp
3304.LP
3305The following command sets a quota of 50 Gbytes for \fBpool/home/bob\fR.
3306
3307.sp
3308.in +2
3309.nf
3310# \fBzfs set quota=50G pool/home/bob\fR
3311.fi
3312.in -2
3313.sp
3314
3315.LP
3316\fBExample 7 \fRListing ZFS Properties
3317.sp
3318.LP
3319The following command lists all properties for \fBpool/home/bob\fR.
3320
3321.sp
3322.in +2
3323.nf
3324# \fBzfs get all pool/home/bob\fR
3325NAME PROPERTY VALUE SOURCE
3326pool/home/bob type filesystem -
3327pool/home/bob creation Tue Jul 21 15:53 2009 -
3328pool/home/bob used 21K -
3329pool/home/bob available 20.0G -
3330pool/home/bob referenced 21K -
3331pool/home/bob compressratio 1.00x -
3332pool/home/bob mounted yes -
3333pool/home/bob quota 20G local
3334pool/home/bob reservation none default
3335pool/home/bob recordsize 128K default
3336pool/home/bob mountpoint /pool/home/bob default
3337pool/home/bob sharenfs off default
3338pool/home/bob checksum on default
3339pool/home/bob compression on local
3340pool/home/bob atime on default
3341pool/home/bob devices on default
3342pool/home/bob exec on default
3343pool/home/bob setuid on default
3344pool/home/bob readonly off default
3345pool/home/bob zoned off default
3346pool/home/bob snapdir hidden default
a08ee875 3347pool/home/bob acltype off default
058ac9ba
BB
3348pool/home/bob aclinherit restricted default
3349pool/home/bob canmount on default
3350pool/home/bob shareiscsi off default
3351pool/home/bob xattr on default
3352pool/home/bob copies 1 default
3353pool/home/bob version 4 -
3354pool/home/bob utf8only off -
3355pool/home/bob normalization none -
3356pool/home/bob casesensitivity sensitive -
3357pool/home/bob vscan off default
3358pool/home/bob nbmand off default
3359pool/home/bob sharesmb off default
3360pool/home/bob refquota none default
3361pool/home/bob refreservation none default
3362pool/home/bob primarycache all default
3363pool/home/bob secondarycache all default
3364pool/home/bob usedbysnapshots 0 -
3365pool/home/bob usedbydataset 21K -
3366pool/home/bob usedbychildren 0 -
3367pool/home/bob usedbyrefreservation 0 -
c8f25918
KA
3368pool/home/bob logbias latency default
3369pool/home/bob dedup off default
3370pool/home/bob mlslabel none default
a08ee875 3371pool/home/bob relatime off default
058ac9ba
BB
3372.fi
3373.in -2
3374.sp
3375
3376.sp
3377.LP
3378The following command gets a single property value.
3379
3380.sp
3381.in +2
3382.nf
3383# \fBzfs get -H -o value compression pool/home/bob\fR
3384on
3385.fi
3386.in -2
3387.sp
3388
3389.sp
3390.LP
3391The following command lists all properties with local settings for \fBpool/home/bob\fR.
3392
3393.sp
3394.in +2
3395.nf
3396# \fBzfs get -r -s local -o name,property,value all pool/home/bob\fR
3397NAME PROPERTY VALUE
3398pool/home/bob quota 20G
3399pool/home/bob compression on
3400.fi
3401.in -2
3402.sp
3403
3404.LP
3405\fBExample 8 \fRRolling Back a ZFS File System
3406.sp
3407.LP
3408The following command reverts the contents of \fBpool/home/anne\fR to the snapshot named \fByesterday\fR, deleting all intermediate snapshots.
3409
3410.sp
3411.in +2
3412.nf
3413# \fBzfs rollback -r pool/home/anne@yesterday\fR
3414.fi
3415.in -2
3416.sp
3417
3418.LP
3419\fBExample 9 \fRCreating a ZFS Clone
3420.sp
3421.LP
3422The following command creates a writable file system whose initial contents are the same as \fBpool/home/bob@yesterday\fR.
3423
3424.sp
3425.in +2
3426.nf
3427# \fBzfs clone pool/home/bob@yesterday pool/clone\fR
3428.fi
3429.in -2
3430.sp
3431
3432.LP
3433\fBExample 10 \fRPromoting a ZFS Clone
3434.sp
3435.LP
3436The 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:
3437
3438.sp
3439.in +2
3440.nf
3441# \fBzfs create pool/project/production\fR
3442 populate /pool/project/production with data
3443# \fBzfs snapshot pool/project/production@today\fR
3444# \fBzfs clone pool/project/production@today pool/project/beta\fR
3445make changes to /pool/project/beta and test them
3446# \fBzfs promote pool/project/beta\fR
3447# \fBzfs rename pool/project/production pool/project/legacy\fR
3448# \fBzfs rename pool/project/beta pool/project/production\fR
3449once the legacy version is no longer needed, it can be destroyed
3450# \fBzfs destroy pool/project/legacy\fR
3451.fi
3452.in -2
3453.sp
3454
3455.LP
3456\fBExample 11 \fRInheriting ZFS Properties
3457.sp
3458.LP
3459The following command causes \fBpool/home/bob\fR and \fBpool/home/anne\fR to inherit the \fBchecksum\fR property from their parent.
3460
3461.sp
3462.in +2
3463.nf
3464# \fBzfs inherit checksum pool/home/bob pool/home/anne\fR
3465.fi
3466.in -2
3467.sp
3468
3469.LP
3470\fBExample 12 \fRRemotely Replicating ZFS Data
3471.sp
3472.LP
3473The following commands send a full stream and then an incremental stream to a remote machine, restoring them into \fBpoolB/received/fs@a\fRand \fBpoolB/received/fs@b\fR, respectively. \fBpoolB\fR must contain the file system \fBpoolB/received\fR, and must not initially contain \fBpoolB/received/fs\fR.
3474
3475.sp
3476.in +2
3477.nf
3478# \fBzfs send pool/fs@a | \e\fR
3479 \fBssh host zfs receive poolB/received/fs@a\fR
3480# \fBzfs send -i a pool/fs@b | ssh host \e\fR
3481 \fBzfs receive poolB/received/fs\fR
3482.fi
3483.in -2
3484.sp
3485
3486.LP
3487\fBExample 13 \fRUsing the \fBzfs receive\fR \fB-d\fR Option
3488.sp
3489.LP
3490The 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 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 created as an empty file system.
3491
3492.sp
3493.in +2
3494.nf
3495# \fBzfs send poolA/fsA/fsB@snap | \e
3496 ssh host zfs receive -d poolB/received\fR
3497.fi
3498.in -2
3499.sp
3500
3501.LP
3502\fBExample 14 \fRSetting User Properties
3503.sp
3504.LP
3505The following example sets the user-defined \fBcom.example:department\fR property for a dataset.
3506
3507.sp
3508.in +2
3509.nf
3510# \fBzfs set com.example:department=12345 tank/accounting\fR
3511.fi
3512.in -2
3513.sp
3514
3515.LP
3516\fBExample 15 \fRCreating a ZFS Volume as an iSCSI Target Device
3517.sp
3518.LP
3519The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target.
3520
3521.sp
3522.in +2
3523.nf
3524# \fBzfs create -V 2g pool/volumes/vol1\fR
3525# \fBzfs set shareiscsi=on pool/volumes/vol1\fR
3526# \fBiscsitadm list target\fR
3527Target: pool/volumes/vol1
3528 iSCSI Name:
3529 iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
3530 Connections: 0
3531.fi
3532.in -2
3533.sp
3534
3535.sp
3536.LP
3537After the \fBiSCSI\fR target is created, set up the \fBiSCSI\fR initiator. For more information about the Solaris \fBiSCSI\fR initiator, see \fBiscsitadm\fR(1M).
3538.LP
3539\fBExample 16 \fRPerforming a Rolling Snapshot
3540.sp
3541.LP
3542The 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:
3543
3544.sp
3545.in +2
3546.nf
3547# \fBzfs destroy -r pool/users@7daysago\fR
3548# \fBzfs rename -r pool/users@6daysago @7daysago\fR
3549# \fBzfs rename -r pool/users@5daysago @6daysago\fR
c06d4368
AX
3550# \fBzfs rename -r pool/users@4daysago @5daysago\fR
3551# \fBzfs rename -r pool/users@3daysago @4daysago\fR
3552# \fBzfs rename -r pool/users@2daysago @3daysago\fR
058ac9ba
BB
3553# \fBzfs rename -r pool/users@yesterday @2daysago\fR
3554# \fBzfs rename -r pool/users@today @yesterday\fR
3555# \fBzfs snapshot -r pool/users@today\fR
3556.fi
3557.in -2
3558.sp
3559
3560.LP
3561\fBExample 17 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System
3562.sp
3563.LP
3564The following commands show how to set \fBsharenfs\fR 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.
3565
3566.sp
3567.in +2
3568.nf
0677cb6f 3569# \fBzfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
058ac9ba
BB
3570.fi
3571.in -2
3572.sp
3573
3574.sp
3575.LP
3576If you are using \fBDNS\fR for host name resolution, specify the fully qualified hostname.
3577
3578.LP
3579\fBExample 18 \fRDelegating ZFS Administration Permissions on a ZFS Dataset
3580.sp
3581.LP
3582The 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.
3583
3584.sp
3585.in +2
3586.nf
3587# \fBzfs allow cindys create,destroy,mount,snapshot tank/cindys\fR
3588# \fBzfs allow tank/cindys\fR
3589-------------------------------------------------------------
3590Local+Descendent permissions on (tank/cindys)
3591 user cindys create,destroy,mount,snapshot
3592-------------------------------------------------------------
3593.fi
3594.in -2
3595.sp
3596
3597.sp
3598.LP
3599Because 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:
3600.sp
3601.in +2
3602.nf
3603# \fBchmod A+user:cindys:add_subdirectory:allow /tank/cindys\fR
3604.fi
3605.in -2
3606.sp
3607
3608.LP
3609\fBExample 19 \fRDelegating Create Time Permissions on a ZFS Dataset
3610.sp
3611.LP
3612The 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.
3613
3614.sp
3615.in +2
3616.nf
0677cb6f 3617# \fBzfs allow staff create,mount tank/users\fR
058ac9ba
BB
3618# \fBzfs allow -c destroy tank/users\fR
3619# \fBzfs allow tank/users\fR
3620-------------------------------------------------------------
3621Create time permissions on (tank/users)
3622 create,destroy
3623Local+Descendent permissions on (tank/users)
3624 group staff create,mount
3625-------------------------------------------------------------
3626.fi
3627.in -2
3628.sp
3629
3630.LP
3631\fBExample 20 \fRDefining and Granting a Permission Set on a ZFS Dataset
3632.sp
3633.LP
3634The 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.
3635
3636.sp
3637.in +2
3638.nf
3639# \fBzfs allow -s @pset create,destroy,snapshot,mount tank/users\fR
3640# \fBzfs allow staff @pset tank/users\fR
3641# \fBzfs allow tank/users\fR
3642-------------------------------------------------------------
3643Permission sets on (tank/users)
3644 @pset create,destroy,mount,snapshot
3645Create time permissions on (tank/users)
3646 create,destroy
3647Local+Descendent permissions on (tank/users)
3648 group staff @pset,create,mount
3649-------------------------------------------------------------
3650.fi
3651.in -2
3652.sp
3653
3654.LP
3655\fBExample 21 \fRDelegating Property Permissions on a ZFS Dataset
3656.sp
3657.LP
3658The 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.
3659
3660.sp
3661.in +2
3662.nf
3663# \fBzfs allow cindys quota,reservation users/home\fR
3664# \fBzfs allow users/home\fR
3665-------------------------------------------------------------
3666Local+Descendent permissions on (users/home)
3667 user cindys quota,reservation
3668-------------------------------------------------------------
3669cindys% \fBzfs set quota=10G users/home/marks\fR
3670cindys% \fBzfs get quota users/home/marks\fR
3671NAME PROPERTY VALUE SOURCE
3672users/home/marks quota 10G local
3673.fi
3674.in -2
3675.sp
3676
3677.LP
3678\fBExample 22 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset
3679.sp
3680.LP
3681The 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.
3682
3683.sp
3684.in +2
3685.nf
3686# \fBzfs unallow staff snapshot tank/users\fR
3687# \fBzfs allow tank/users\fR
3688-------------------------------------------------------------
3689Permission sets on (tank/users)
3690 @pset create,destroy,mount,snapshot
3691Create time permissions on (tank/users)
3692 create,destroy
3693Local+Descendent permissions on (tank/users)
3694 group staff @pset,create,mount
3695-------------------------------------------------------------
3696.fi
3697.in -2
3698.sp
3699
0677cb6f
RL
3700.LP
3701\fBExample 23\fR Showing the differences between a snapshot and a ZFS Dataset
3702.sp
3703.LP
3704The following example shows how to see what has changed between a prior
3705snapshot of a ZFS Dataset and its current state. The \fB-F\fR option is used
3706to indicate type information for the files affected.
3707
3708.sp
3709.in +2
3710.nf
3711# zfs diff -F tank/test@before tank/test
3712M / /tank/test/
3713M F /tank/test/linked (+1)
3714R F /tank/test/oldname -> /tank/test/newname
3715- F /tank/test/deleted
3716+ F /tank/test/created
3717M F /tank/test/modified
3718.fi
3719.in -2
3720.sp
3721
ea04106b
AX
3722.LP
3723\fBExample 24\fR Creating a bookmark
3724.sp
3725.LP
3726The following example create a bookmark to a snapshot. This bookmark can then
3727be used instead of snapshot in send streams.
3728
3729.sp
3730.in +2
3731.nf
3732# zfs bookmark rpool@snapshot rpool#bookmark
3733.fi
3734.in -2
3735.sp
3736
3737.SH "ENVIRONMENT VARIABLES"
3738.TP
3739.B "ZFS_ABORT
3740Cause \fBzfs\fR to dump core on exit for the purposes of running \fB::findleaks\fR.
3741
058ac9ba 3742.SH EXIT STATUS
058ac9ba
BB
3743.LP
3744The following exit values are returned:
3745.sp
3746.ne 2
3747.mk
3748.na
3749\fB\fB0\fR\fR
3750.ad
3751.sp .6
3752.RS 4n
3753Successful completion.
3754.RE
3755
3756.sp
3757.ne 2
3758.mk
3759.na
3760\fB\fB1\fR\fR
3761.ad
3762.sp .6
3763.RS 4n
3764An error occurred.
3765.RE
3766
3767.sp
3768.ne 2
3769.mk
3770.na
3771\fB\fB2\fR\fR
3772.ad
3773.sp .6
3774.RS 4n
3775Invalid command line options were specified.
3776.RE
3777
058ac9ba 3778.SH SEE ALSO
058ac9ba 3779.LP
4da4a9e1 3780\fBchmod\fR(2), \fBfsync\fR(2), \fBgzip\fR(1), \fBmount\fR(8), \fBssh\fR(1), \fBstat\fR(2), \fBwrite\fR(2), \fBzpool\fR(8)