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