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