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