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