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