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