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