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