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