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