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