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