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