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