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