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