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