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