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