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