]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - cddl/contrib/opensolaris/cmd/zfs/zfs.8
Sync with upstream version (20130520) that includes same fixes made last week.
[FreeBSD/FreeBSD.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) 2012, Joyent, Inc. All rights reserved.
23 .\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
24 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
25 .\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
26 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
27 .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved.
28 .\"
29 .\" $FreeBSD$
30 .\"
31 .Dd March 21, 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
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. Disabling checksums is
902 .Em NOT
903 a recommended practice.
904 .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4
905 Controls the compression algorithm used for this dataset. The
906 .Cm lzjb
907 compression algorithm is optimized for performance while providing decent data
908 compression. Setting compression to
909 .Cm on
910 uses the
911 .Cm lzjb
912 compression algorithm. The
913 .Cm gzip
914 compression algorithm uses the same compression as the
915 .Xr gzip 1
916 command. You can specify the
917 .Cm gzip
918 level by using the value
919 .Cm gzip- Ns Ar N
920 where
921 .Ar N
922 is an integer from 1 (fastest) to 9 (best compression ratio). Currently,
923 .Cm gzip
924 is equivalent to
925 .Cm gzip-6
926 (which is also the default for
927 .Xr gzip 1 ) .
928 The
929 .Cm zle
930 compression algorithm compresses runs of zeros.
931 .Pp
932 The
933 .Sy lz4
934 compression algorithm is a high-performance replacement
935 for the
936 .Sy lzjb
937 algorithm. It features significantly faster
938 compression and decompression, as well as a moderately higher
939 compression ratio than
940 .Sy lzjb ,
941 but can only be used on pools with
942 the
943 .Sy lz4_compress
944 feature set to
945 .Sy enabled .
946 See
947 .Xr zpool-features 7
948 for details on ZFS feature flags and the
949 .Sy lz4_compress
950 feature.
951 .Pp
952 This property can also be referred to by its shortened column name
953 .Cm compress .
954 Changing this property affects only newly-written data.
955 .It Sy copies Ns = Ns Cm 1 | 2 | 3
956 Controls the number of copies of data stored for this dataset. These copies are
957 in addition to any redundancy provided by the pool, for example, mirroring or
958 RAID-Z. The copies are stored on different disks, if possible. The space used
959 by multiple copies is charged to the associated file and dataset, changing the
960 .Sy used
961 property and counting against quotas and reservations.
962 .Pp
963 Changing this property only affects newly-written data. Therefore, set this
964 property at file system creation time by using the
965 .Fl o Cm copies= Ns Ar N
966 option.
967 .It Sy dedup Ns = Ns Cm on | off | verify | sha256 Ns Op Cm ,verify
968 Configures deduplication for a dataset. The default value is
969 .Cm off .
970 The default deduplication checksum is
971 .Cm sha256
972 (this may change in the future).
973 When
974 .Sy dedup
975 is enabled, the checksum defined here overrides the
976 .Sy checksum
977 property. Setting the value to
978 .Cm verify
979 has the same effect as the setting
980 .Cm sha256,verify .
981 .Pp
982 If set to
983 .Cm verify ,
984 .Tn ZFS
985 will do a byte-to-byte comparsion in case of two blocks having the same
986 signature to make sure the block contents are identical.
987 .It Sy devices Ns = Ns Cm on | off
988 The
989 .Sy devices
990 property is currently not supported on
991 .Fx .
992 .It Sy exec Ns = Ns Cm on | off
993 Controls whether processes can be executed from within this file system. The
994 default value is
995 .Cm on .
996 .It Sy mlslabel Ns = Ns Ar label | Cm none
997 The
998 .Sy mlslabel
999 property is currently not supported on
1000 .Fx .
1001 .It Sy mountpoint Ns = Ns Ar path | Cm none | legacy
1002 Controls the mount point used for this file system. See the
1003 .Qq Sx Mount Points
1004 section for more information on how this property is used.
1005 .Pp
1006 When the
1007 .Sy mountpoint
1008 property is changed for a file system, the file system and any children that
1009 inherit the mount point are unmounted. If the new value is
1010 .Cm legacy ,
1011 then they remain unmounted. Otherwise, they are automatically remounted in the
1012 new location if the property was previously
1013 .Cm legacy
1014 or
1015 .Cm none ,
1016 or if they were mounted before the property was changed. In addition, any
1017 shared file systems are unshared and shared in the new location.
1018 .It Sy nbmand Ns = Ns Cm on | off
1019 The
1020 .Sy nbmand
1021 property is currently not supported on
1022 .Fx .
1023 .It Sy primarycache Ns = Ns Cm all | none | metadata
1024 Controls what is cached in the primary cache (ARC). If this property is set to
1025 .Cm all ,
1026 then both user data and metadata is cached. If this property is set to
1027 .Cm none ,
1028 then neither user data nor metadata is cached. If this property is set to
1029 .Cm metadata ,
1030 then only metadata is cached. The default value is
1031 .Cm all .
1032 .It Sy quota Ns = Ns Ar size | Cm none
1033 Limits the amount of space a dataset and its descendents can consume. This
1034 property enforces a hard limit on the amount of space used. This includes all
1035 space consumed by descendents, including file systems and snapshots. Setting a
1036 quota on a descendent of a dataset that already has a quota does not override
1037 the ancestor's quota, but rather imposes an additional limit.
1038 .Pp
1039 Quotas cannot be set on volumes, as the
1040 .Sy volsize
1041 property acts as an implicit quota.
1042 .It Sy userquota@ Ns Ar user Ns = Ns Ar size | Cm none
1043 Limits the amount of space consumed by the specified user.
1044 Similar to the
1045 .Sy refquota
1046 property, the
1047 .Sy userquota
1048 space calculation does not include space that is used by descendent datasets,
1049 such as snapshots and clones. User space consumption is identified by the
1050 .Sy userspace@ Ns Ar user
1051 property.
1052 .Pp
1053 Enforcement of user quotas may be delayed by several seconds. This delay means
1054 that a user might exceed their quota before the system notices that they are
1055 over quota and begins to refuse additional writes with the
1056 .Em EDQUOT
1057 error message. See the
1058 .Cm userspace
1059 subcommand for more information.
1060 .Pp
1061 Unprivileged users can only access their own groups' space usage. The root
1062 user, or a user who has been granted the
1063 .Sy userquota
1064 privilege with
1065 .Qq Nm Cm allow ,
1066 can get and set everyone's quota.
1067 .Pp
1068 This property is not available on volumes, on file systems before version 4, or
1069 on pools before version 15. The
1070 .Sy userquota@ Ns ...
1071 properties are not displayed by
1072 .Qq Nm Cm get all .
1073 The user's name must be appended after the
1074 .Sy @
1075 symbol, using one of the following forms:
1076 .Bl -bullet -offset 2n
1077 .It
1078 POSIX name (for example,
1079 .Em joe )
1080 .It
1081 POSIX numeric ID (for example,
1082 .Em 1001 )
1083 .El
1084 .It Sy groupquota@ Ns Ar group Ns = Ns Ar size | Cm none
1085 Limits the amount of space consumed by the specified group. Group space
1086 consumption is identified by the
1087 .Sy userquota@ Ns Ar user
1088 property.
1089 .Pp
1090 Unprivileged users can access only their own groups' space usage. The root
1091 user, or a user who has been granted the
1092 .Sy groupquota
1093 privilege with
1094 .Qq Nm Cm allow ,
1095 can get and set all groups' quotas.
1096 .It Sy readonly Ns = Ns Cm on | off
1097 Controls whether this dataset can be modified. The default value is
1098 .Cm off .
1099 .It Sy recordsize Ns = Ns Ar size
1100 Specifies a suggested block size for files in the file system. This property is
1101 designed solely for use with database workloads that access files in fixed-size
1102 records.
1103 .Tn ZFS
1104 automatically tunes block sizes according to internal algorithms optimized for
1105 typical access patterns.
1106 .Pp
1107 For databases that create very large files but access them in small random
1108 chunks, these algorithms may be suboptimal. Specifying a
1109 .Sy recordsize
1110 greater than or equal to the record size of the database can result in
1111 significant performance gains. Use of this property for general purpose file
1112 systems is strongly discouraged, and may adversely affect performance.
1113 .Pp
1114 The size specified must be a power of two greater than or equal to 512 and less
1115 than or equal to 128 Kbytes.
1116 .Pp
1117 Changing the file system's
1118 .Sy recordsize
1119 affects only files created afterward; existing files are unaffected.
1120 .Pp
1121 This property can also be referred to by its shortened column name,
1122 .Sy recsize .
1123 .It Sy refquota Ns = Ns Ar size | Cm none
1124 Limits the amount of space a dataset can consume. This property enforces a hard
1125 limit on the amount of space used. This hard limit does not include space used
1126 by descendents, including file systems and snapshots.
1127 .It Sy refreservation Ns = Ns Ar size | Cm none
1128 The minimum amount of space guaranteed to a dataset, not including its
1129 descendents. When the amount of space used is below this value, the dataset is
1130 treated as if it were taking up the amount of space specified by
1131 .Sy refreservation .
1132 The
1133 .Sy refreservation
1134 reservation is accounted for in the parent datasets' space used, and counts
1135 against the parent datasets' quotas and reservations.
1136 .Pp
1137 If
1138 .Sy refreservation
1139 is set, a snapshot is only allowed if there is enough free pool space outside
1140 of this reservation to accommodate the current number of "referenced" bytes in
1141 the dataset.
1142 .Pp
1143 This property can also be referred to by its shortened column name,
1144 .Sy refreserv .
1145 .It Sy reservation Ns = Ns Ar size | Cm none
1146 The minimum amount of space guaranteed to a dataset and its descendents. When
1147 the amount of space used is below this value, the dataset is treated as if it
1148 were taking up the amount of space specified by its reservation. Reservations
1149 are accounted for in the parent datasets' space used, and count against the
1150 parent datasets' quotas and reservations.
1151 .Pp
1152 This property can also be referred to by its shortened column name,
1153 .Sy reserv .
1154 .It Sy secondarycache Ns = Ns Cm all | none | metadata
1155 Controls what is cached in the secondary cache (L2ARC). If this property is set
1156 to
1157 .Cm all ,
1158 then both user data and metadata is cached. If this property is set to
1159 .Cm none ,
1160 then neither user data nor metadata is cached. If this property is set to
1161 .Cm metadata ,
1162 then only metadata is cached. The default value is
1163 .Cm all .
1164 .It Sy setuid Ns = Ns Cm on | off
1165 Controls whether the
1166 .No set- Ns Tn UID
1167 bit is respected for the file system. The default value is
1168 .Cm on .
1169 .It Sy sharesmb Ns = Ns Cm on | off | Ar opts
1170 The
1171 .Sy sharesmb
1172 property currently has no effect on
1173 .Fx .
1174 .It Sy sharenfs Ns = Ns Cm on | off | Ar opts
1175 Controls whether the file system is shared via
1176 .Tn NFS ,
1177 and what options are used. A file system with a
1178 .Sy sharenfs
1179 property of
1180 .Cm off
1181 is managed the traditional way via
1182 .Xr exports 5 .
1183 Otherwise, the file system is automatically shared and unshared with the
1184 .Qq Nm Cm share
1185 and
1186 .Qq Nm Cm unshare
1187 commands. If the property is set to
1188 .Cm on
1189 no
1190 .Tn NFS
1191 export options are used. Otherwise,
1192 .Tn NFS
1193 export options are equivalent to the contents of this property. The export
1194 options may be comma-separated. See
1195 .Xr exports 5
1196 for a list of valid options.
1197 .Pp
1198 When the
1199 .Sy sharenfs
1200 property is changed for a dataset, the
1201 .Xr mountd 8
1202 daemon is reloaded.
1203 .It Sy logbias Ns = Ns Cm latency | throughput
1204 Provide a hint to
1205 .Tn ZFS
1206 about handling of synchronous requests in this dataset.
1207 If
1208 .Sy logbias
1209 is set to
1210 .Cm latency
1211 (the default),
1212 .Tn ZFS
1213 will use pool log devices (if configured) to handle the requests at low
1214 latency. If
1215 .Sy logbias
1216 is set to
1217 .Cm throughput ,
1218 .Tn ZFS
1219 will not use configured pool log devices.
1220 .Tn ZFS
1221 will instead optimize synchronous operations for global pool throughput and
1222 efficient use of resources.
1223 .It Sy snapdir Ns = Ns Cm hidden | visible
1224 Controls whether the
1225 .Pa \&.zfs
1226 directory is hidden or visible in the root of the file system as discussed in
1227 the
1228 .Qq Sx Snapshots
1229 section. The default value is
1230 .Cm hidden .
1231 .It Sy sync Ns = Ns Cm standard | always | disabled
1232 Controls the behavior of synchronous requests (e.g.
1233 .Xr fsync 2 ,
1234 O_DSYNC). This property accepts the following values:
1235 .Bl -tag -offset 4n -width 8n
1236 .It Sy standard
1237 This is the POSIX specified behavior of ensuring all synchronous requests are
1238 written to stable storage and all devices are flushed to ensure data is not
1239 cached by device controllers (this is the default).
1240 .It Sy always
1241 All file system transactions are written and flushed before their system calls
1242 return. This has a large performance penalty.
1243 .It Sy disabled
1244 Disables synchronous requests. File system transactions are only committed to
1245 stable storage periodically. This option will give the highest performance.
1246 However, it is very dangerous as
1247 .Tn ZFS
1248 would be ignoring the synchronous transaction demands of applications such as
1249 databases or
1250 .Tn NFS .
1251 Administrators should only use this option when the risks are understood.
1252 .El
1253 .It Sy volsize Ns = Ns Ar size
1254 For volumes, specifies the logical size of the volume. By default, creating a
1255 volume establishes a reservation of equal size. For storage pools with a
1256 version number of 9 or higher, a
1257 .Sy refreservation
1258 is set instead. Any changes to
1259 .Sy volsize
1260 are reflected in an equivalent change to the reservation (or
1261 .Sy refreservation ) .
1262 The
1263 .Sy volsize
1264 can only be set to a multiple of
1265 .Cm volblocksize ,
1266 and cannot be zero.
1267 .Pp
1268 The reservation is kept equal to the volume's logical size to prevent
1269 unexpected behavior for consumers. Without the reservation, the volume could
1270 run out of space, resulting in undefined behavior or data corruption, depending
1271 on how the volume is used. These effects can also occur when the volume size is
1272 changed while it is in use (particularly when shrinking the size). Extreme care
1273 should be used when adjusting the volume size.
1274 .Pp
1275 Though not recommended, a "sparse volume" (also known as "thin provisioning")
1276 can be created by specifying the
1277 .Fl s
1278 option to the
1279 .Qq Nm Cm create Fl V
1280 command, or by changing the reservation after the volume has been created. A
1281 "sparse volume" is a volume where the reservation is less then the volume size.
1282 Consequently, writes to a sparse volume can fail with
1283 .Sy ENOSPC
1284 when the pool is low on space. For a sparse volume, changes to
1285 .Sy volsize
1286 are not reflected in the reservation.
1287 .It Sy vscan Ns = Ns Cm off | on
1288 The
1289 .Sy vscan
1290 property is currently not supported on
1291 .Fx .
1292 .It Sy xattr Ns = Ns Cm off | on
1293 The
1294 .Sy xattr
1295 property is currently not supported on
1296 .Fx .
1297 .It Sy jailed Ns = Ns Cm off | on
1298 Controls whether the dataset is managed from a jail. See the
1299 .Qq Sx Jails
1300 section for more information. The default value is
1301 .Cm off .
1302 .El
1303 .Pp
1304 The following three properties cannot be changed after the file system is
1305 created, and therefore, should be set when the file system is created. If the
1306 properties are not set with the
1307 .Qq Nm Cm create
1308 or
1309 .Nm zpool Cm create
1310 commands, these properties are inherited from the parent dataset. If the parent
1311 dataset lacks these properties due to having been created prior to these
1312 features being supported, the new file system will have the default values for
1313 these properties.
1314 .Bl -tag -width 4n
1315 .It Sy casesensitivity Ns = Ns Cm sensitive | insensitive | mixed
1316 The
1317 .Sy casesensitivity
1318 property is currently not supported on
1319 .Fx .
1320 .It Sy normalization Ns = Ns Cm none | formC | formD | formKC | formKD
1321 Indicates whether the file system should perform a
1322 .Sy unicode
1323 normalization of file names whenever two file names are compared, and which
1324 normalization algorithm should be used. File names are always stored
1325 unmodified, names are normalized as part of any comparison process. If this
1326 property is set to a legal value other than
1327 .Cm none ,
1328 and the
1329 .Sy utf8only
1330 property was left unspecified, the
1331 .Sy utf8only
1332 property is automatically set to
1333 .Cm on .
1334 The default value of the
1335 .Sy normalization
1336 property is
1337 .Cm none .
1338 This property cannot be changed after the file system is created.
1339 .It Sy utf8only Ns = Ns Cm on | off
1340 Indicates whether the file system should reject file names that include
1341 characters that are not present in the
1342 .Sy UTF-8
1343 character code set. If this property is explicitly set to
1344 .Cm off ,
1345 the normalization property must either not be explicitly set or be set to
1346 .Cm none .
1347 The default value for the
1348 .Sy utf8only
1349 property is
1350 .Cm off .
1351 This property cannot be changed after the file system is created.
1352 .El
1353 .Pp
1354 The
1355 .Sy casesensitivity , normalization , No and Sy utf8only
1356 properties are also new permissions that can be assigned to non-privileged
1357 users by using the
1358 .Tn ZFS
1359 delegated administration feature.
1360 .Ss Temporary Mount Point Properties
1361 When a file system is mounted, either through
1362 .Xr mount 8
1363 for legacy mounts or the
1364 .Qq Nm Cm mount
1365 command for normal file systems, its mount options are set according to its
1366 properties. The correlation between properties and mount options is as follows:
1367 .Bl -column -offset 4n "PROPERTY" "MOUNT OPTION"
1368 .It "PROPERTY   MOUNT OPTION"
1369 .It "atime      atime/noatime"
1370 .It "exec       exec/noexec"
1371 .It "readonly   ro/rw"
1372 .It "setuid     suid/nosuid"
1373 .El
1374 .Pp
1375 In addition, these options can be set on a per-mount basis using the
1376 .Fl o
1377 option, without affecting the property that is stored on disk. The values
1378 specified on the command line override the values stored in the dataset. These
1379 properties are reported as "temporary" by the
1380 .Qq Nm Cm get
1381 command. If the properties are changed while the dataset is mounted, the new
1382 setting overrides any temporary settings.
1383 .Ss User Properties
1384 In addition to the standard native properties,
1385 .Tn ZFS
1386 supports arbitrary user properties. User properties have no effect on
1387 .Tn ZFS
1388 behavior, but applications or administrators can use them to annotate datasets
1389 (file systems, volumes, and snapshots).
1390 .Pp
1391 User property names must contain a colon
1392 .Pq Sy \&:
1393 character to distinguish them from native properties. They may contain
1394 lowercase letters, numbers, and the following punctuation characters: colon
1395 .Pq Sy \&: ,
1396 dash
1397 .Pq Sy \&- ,
1398 period
1399 .Pq Sy \&.
1400 and underscore
1401 .Pq Sy \&_ .
1402 The expected convention is that the property name is divided into two portions
1403 such as
1404 .Em module Ns Sy \&: Ns Em property ,
1405 but this namespace is not enforced by
1406 .Tn ZFS .
1407 User property names can be at most 256 characters, and cannot begin with a dash
1408 .Pq Sy \&- .
1409 .Pp
1410 When making programmatic use of user properties, it is strongly suggested to
1411 use a reversed
1412 .Tn DNS
1413 domain name for the
1414 .Ar module
1415 component of property names to reduce the chance that two
1416 independently-developed packages use the same property name for different
1417 purposes. Property names beginning with
1418 .Em com.sun
1419 are reserved for use by Sun Microsystems.
1420 .Pp
1421 The values of user properties are arbitrary strings, are always inherited, and
1422 are never validated. All of the commands that operate on properties
1423 .Po
1424 .Qq Nm Cm list ,
1425 .Qq Nm Cm get ,
1426 .Qq Nm Cm set
1427 and so forth
1428 .Pc
1429 can be used to manipulate both native properties and user properties. Use the
1430 .Qq Nm Cm inherit
1431 command to clear a user property. If the property is not defined in any parent
1432 dataset, it is removed entirely. Property values are limited to 1024
1433 characters.
1434 .Sh SUBCOMMANDS
1435 All subcommands that modify state are logged persistently to the pool in their
1436 original form.
1437 .Bl -tag -width 2n
1438 .It Xo
1439 .Nm
1440 .Op Fl \&?
1441 .Xc
1442 .Pp
1443 Displays a help message.
1444 .It Xo
1445 .Nm
1446 .Cm create
1447 .Op Fl pu
1448 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1449 .Ar filesystem
1450 .Xc
1451 .Pp
1452 Creates a new
1453 .Tn ZFS
1454 file system. The file system is automatically mounted according to the
1455 .Sy mountpoint
1456 property inherited from the parent.
1457 .Bl -tag -width indent
1458 .It Fl p
1459 Creates all the non-existing parent datasets. Datasets created in this manner
1460 are automatically mounted according to the
1461 .Sy mountpoint
1462 property inherited from their parent. Any property specified on the command
1463 line using the
1464 .Fl o
1465 option is ignored. If the target filesystem already exists, the operation
1466 completes successfully.
1467 .It Fl u
1468 Newly created file system is not mounted.
1469 .It Fl o Ar property Ns = Ns Ar value
1470 Sets the specified property as if the command
1471 .Qq Nm Cm set Ar property Ns = Ns Ar value
1472 was invoked at the same time the dataset was created. Any editable
1473 .Tn ZFS
1474 property can also be set at creation time. Multiple
1475 .Fl o
1476 options can be specified. An error results if the same property is specified in
1477 multiple
1478 .Fl o
1479 options.
1480 .El
1481 .It Xo
1482 .Nm
1483 .Cm create
1484 .Op Fl ps
1485 .Op Fl b Ar blocksize
1486 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1487 .Fl V
1488 .Ar size volume
1489 .Xc
1490 .Pp
1491 Creates a volume of the given size. The volume is exported as a block device in
1492 .Pa /dev/zvol/path ,
1493 where
1494 .Ar path
1495 is the name of the volume in the
1496 .Tn ZFS
1497 namespace. The size represents the logical size as exported by the device. By
1498 default, a reservation of equal size is created.
1499 .Pp
1500 .Ar size
1501 is automatically rounded up to the nearest 128 Kbytes to ensure that
1502 the volume has an integral number of blocks regardless of
1503 .Ar blocksize .
1504 .Bl -tag -width indent
1505 .It Fl p
1506 Creates all the non-existing parent datasets. Datasets created in this manner
1507 are automatically mounted according to the
1508 .Sy mountpoint
1509 property inherited from their parent. Any property specified on the command
1510 line using the
1511 .Fl o
1512 option is ignored. If the target filesystem already exists, the operation
1513 completes successfully.
1514 .It Fl s
1515 Creates a sparse volume with no reservation. See
1516 .Sy volsize
1517 in the
1518 .Qq Sx Native Properties
1519 section for more information about sparse volumes.
1520 .It Fl b Ar blocksize
1521 Equivalent to
1522 .Fl o Cm volblocksize Ns = Ns Ar blocksize .
1523 If this option is specified in conjunction with
1524 .Fl o Cm volblocksize ,
1525 the resulting behavior is undefined.
1526 .It Fl o Ar property Ns = Ns Ar value
1527 Sets the specified property as if the
1528 .Qq Nm Cm set Ar property Ns = Ns Ar value
1529 command was invoked at the same time the dataset was created. Any editable
1530 .Tn ZFS
1531 property can also be set at creation time. Multiple
1532 .Fl o
1533 options can be specified. An error results if the same property is specified in
1534 multiple
1535 .Fl o
1536 options.
1537 .El
1538 .It Xo
1539 .Nm
1540 .Cm destroy
1541 .Op Fl fnpRrv
1542 .Ar filesystem Ns | Ns Ar volume
1543 .Xc
1544 .Pp
1545 Destroys the given dataset. By default, the command unshares any file systems
1546 that are currently shared, unmounts any file systems that are currently
1547 mounted, and refuses to destroy a dataset that has active dependents (children
1548 or clones).
1549 .Bl -tag -width indent
1550 .It Fl r
1551 Recursively destroy all children.
1552 .It Fl R
1553 Recursively destroy all dependents, including cloned file systems outside the
1554 target hierarchy.
1555 .It Fl f
1556 Force an unmount of any file systems using the
1557 .Qq Nm Cm unmount Fl f
1558 command. This option has no effect on non-file systems or unmounted file
1559 systems.
1560 .It Fl n
1561 Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in
1562 conjunction with the
1563 .Fl v
1564 or
1565 .Fl p
1566 flags to determine what data would be deleted.
1567 .It Fl p
1568 Print machine-parsable verbose information about the deleted data.
1569 .It Fl v
1570 Print verbose information about the deleted data.
1571 .El
1572 .Pp
1573 Extreme care should be taken when applying either the
1574 .Fl r
1575 or the
1576 .Fl R
1577 options, as they can destroy large portions of a pool and cause unexpected
1578 behavior for mounted file systems in use.
1579 .It Xo
1580 .Nm
1581 .Cm destroy
1582 .Op Fl dnpRrv
1583 .Sm off
1584 .Ar snapshot
1585 .Op % Ns Ar snapname
1586 .Op , Ns ...
1587 .Sm on
1588 .Xc
1589 .Pp
1590 The given snapshots are destroyed immediately if and only if the
1591 .Qq Nm Cm destroy
1592 command without the
1593 .Fl d
1594 option would have destroyed it. Such immediate destruction would occur, for
1595 example, if the snapshot had no clones and the user-initiated reference count
1596 were zero.
1597 .Pp
1598 If a snapshot does not qualify for immediate destruction, it is marked for
1599 deferred deletion. In this state, it exists as a usable, visible snapshot until
1600 both of the preconditions listed above are met, at which point it is destroyed.
1601 .Pp
1602 An inclusive range of snapshots may be specified by separating the
1603 first and last snapshots with a percent sign
1604 .Pq Sy % .
1605 The first and/or last snapshots may be left blank, in which case the
1606 filesystem's oldest or newest snapshot will be implied.
1607 .Pp
1608 Multiple snapshots
1609 (or ranges of snapshots) of the same filesystem or volume may be specified
1610 in a comma-separated list of snapshots.
1611 Only the snapshot's short name (the
1612 part after the
1613 .Sy @ )
1614 should be specified when using a range or comma-separated list to identify
1615 multiple snapshots.
1616 .Bl -tag -width indent
1617 .It Fl r
1618 Destroy (or mark for deferred deletion) all snapshots with this name in
1619 descendent file systems.
1620 .It Fl R
1621 Recursively destroy all clones of these snapshots, including the clones,
1622 snapshots, and children.
1623 If this flag is specified, the
1624 .Op fl d
1625 flag will have no effect.
1626 .It Fl n
1627 Do a dry-run ("No-op") deletion. No data will be deleted. This is useful in
1628 conjunction with the
1629 .Fl v
1630 or
1631 .Fl p
1632 flags to determine what data would be deleted.
1633 .It Fl p
1634 Print machine-parsable verbose information about the deleted data.
1635 .It Fl v
1636 Print verbose information about the deleted data.
1637 .It Fl d
1638 Defer snapshot deletion.
1639 .El
1640 .Pp
1641 Extreme care should be taken when applying either the
1642 .Fl r
1643 or the
1644 .Fl R
1645 options, as they can destroy large portions of a pool and cause unexpected
1646 behavior for mounted file systems in use.
1647 .It Xo
1648 .Nm
1649 .Cm snapshot
1650 .Op Fl r
1651 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1652 .Ar filesystem@snapname Ns | Ns volume@snapname
1653 .Ar filesystem@snapname Ns | Ns volume@snapname Ns ...
1654 .Xc
1655 .Pp
1656 Creates snapshots with the given names. All previous modifications by
1657 successful system calls to the file system are part of the snapshots.
1658 Snapshots are taken atomically, so that all snapshots correspond to the same
1659 moment in time. See the
1660 .Qq Sx Snapshots
1661 section for details.
1662 .Bl -tag -width indent
1663 .It Fl r
1664 Recursively create snapshots of all descendent datasets
1665 .It Fl o Ar property Ns = Ns Ar value
1666 Sets the specified property; see
1667 .Qq Nm Cm create
1668 for details.
1669 .El
1670 .It Xo
1671 .Nm
1672 .Cm rollback
1673 .Op Fl rRf
1674 .Ar snapshot
1675 .Xc
1676 .Pp
1677 Roll back the given dataset to a previous snapshot. When a dataset is rolled
1678 back, all data that has changed since the snapshot is discarded, and the
1679 dataset reverts to the state at the time of the snapshot. By default, the
1680 command refuses to roll back to a snapshot other than the most recent one. In
1681 order to do so, all intermediate snapshots must be destroyed by specifying the
1682 .Fl r
1683 option.
1684 .Bl -tag -width indent
1685 .It Fl r
1686 Recursively destroy any snapshots more recent than the one specified.
1687 .It Fl R
1688 Recursively destroy any more recent snapshots, as well as any clones of those
1689 snapshots.
1690 .It Fl f
1691 Used with the
1692 .Fl R
1693 option to force an unmount of any clone file systems that are to be destroyed.
1694 .El
1695 .It Xo
1696 .Nm
1697 .Cm clone
1698 .Op Fl p
1699 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1700 .Ar snapshot filesystem Ns | Ns Ar volume
1701 .Xc
1702 .Pp
1703 Creates a clone of the given snapshot. See the
1704 .Qq Sx Clones
1705 section for details. The target dataset can be located anywhere in the
1706 .Tn ZFS
1707 hierarchy, and is created as the same type as the original.
1708 .Bl -tag -width indent
1709 .It Fl p
1710 Creates all the non-existing parent datasets. Datasets created in this manner
1711 are automatically mounted according to the
1712 .Sy mountpoint
1713 property inherited from their parent. If the target filesystem or volume
1714 already exists, the operation completes successfully.
1715 .It Fl o Ar property Ns = Ns Ar value
1716 Sets the specified property; see
1717 .Qq Nm Cm create
1718 for details.
1719 .El
1720 .It Xo
1721 .Nm
1722 .Cm promote
1723 .Ar clone-filesystem
1724 .Xc
1725 .Pp
1726 Promotes a clone file system to no longer be dependent on its "origin"
1727 snapshot. This makes it possible to destroy the file system that the clone was
1728 created from. The clone parent-child dependency relationship is reversed, so
1729 that the origin file system becomes a clone of the specified file system.
1730 .Pp
1731 The snapshot that was cloned, and any snapshots previous to this snapshot, are
1732 now owned by the promoted clone. The space they use moves from the origin file
1733 system to the promoted clone, so enough space must be available to accommodate
1734 these snapshots. No new space is consumed by this operation, but the space
1735 accounting is adjusted. The promoted clone must not have any conflicting
1736 snapshot names of its own. The
1737 .Cm rename
1738 subcommand can be used to rename any conflicting snapshots.
1739 .It Xo
1740 .Nm
1741 .Cm rename
1742 .Op Fl f
1743 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
1744 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
1745 .Xc
1746 .It Xo
1747 .Nm
1748 .Cm rename
1749 .Op Fl f
1750 .Fl p
1751 .Ar filesystem Ns | Ns Ar volume
1752 .Ar filesystem Ns | Ns Ar volume
1753 .Xc
1754 .It Xo
1755 .Nm
1756 .Cm rename
1757 .Fl u
1758 .Op Fl p
1759 .Ar filesystem filesystem
1760 .Xc
1761 .Pp
1762 Renames the given dataset. The new target can be located anywhere in the
1763 .Tn ZFS
1764 hierarchy, with the exception of snapshots. Snapshots can only be renamed
1765 within the parent file system or volume. When renaming a snapshot, the parent
1766 file system of the snapshot does not need to be specified as part of the second
1767 argument. Renamed file systems can inherit new mount points, in which case they
1768 are unmounted and remounted at the new mount point.
1769 .Bl -tag -width indent
1770 .It Fl p
1771 Creates all the nonexistent parent datasets. Datasets created in this manner
1772 are automatically mounted according to the
1773 .Sy mountpoint
1774 property inherited from their parent.
1775 .It Fl u
1776 Do not remount file systems during rename. If a file system's
1777 .Sy mountpoint
1778 property is set to
1779 .Cm legacy
1780 or
1781 .Cm none ,
1782 file system is not unmounted even if this option is not given.
1783 .It Fl f
1784 Force unmount any filesystems that need to be unmounted in the process.
1785 This flag has no effect if used together with the
1786 .Fl u
1787 flag.
1788 .El
1789 .It Xo
1790 .Nm
1791 .Cm rename
1792 .Fl r
1793 .Ar snapshot snapshot
1794 .Xc
1795 .Pp
1796 Recursively rename the snapshots of all descendent datasets. Snapshots are the
1797 only dataset that can be renamed recursively.
1798 .It Xo
1799 .Nm
1800 .Cm list
1801 .Op Fl r Ns | Ns Fl d Ar depth
1802 .Op Fl H
1803 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1804 .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
1805 .Oo Fl s Ar property Oc Ns ...
1806 .Oo Fl S Ar property Oc Ns ...
1807 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
1808 .Xc
1809 .Pp
1810 Lists the property information for the given datasets in tabular form. If
1811 specified, you can list property information by the absolute pathname or the
1812 relative pathname. By default, all file systems and volumes are displayed.
1813 Snapshots are displayed if the
1814 .Sy listsnaps
1815 property is
1816 .Cm on
1817 (the default is
1818 .Cm off ) .
1819 The following fields are displayed,
1820 .Sy name , used , available , referenced , mountpoint .
1821 .Bl -tag -width indent
1822 .It Fl r
1823 Recursively display any children of the dataset on the command line.
1824 .It Fl d Ar depth
1825 Recursively display any children of the dataset, limiting the recursion to
1826 .Ar depth .
1827 A depth of
1828 .Sy 1
1829 will display only the dataset and its direct children.
1830 .It Fl H
1831 Used for scripting mode. Do not print headers and separate fields by a single
1832 tab instead of arbitrary white space.
1833 .It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
1834 A comma-separated list of properties to display. The property must be:
1835 .Bl -bullet -offset 2n
1836 .It
1837 One of the properties described in the
1838 .Qq Sx Native Properties
1839 section
1840 .It
1841 A user property
1842 .It
1843 The value
1844 .Cm name
1845 to display the dataset name
1846 .It
1847 The value
1848 .Cm space
1849 to display space usage properties on file systems and volumes. This is a
1850 shortcut for specifying
1851 .Fl o
1852 .Sy name,avail,used,usedsnap,usedds,usedrefreserv,usedchild
1853 .Fl t
1854 .Sy filesystem,volume
1855 syntax.
1856 .El
1857 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
1858 A comma-separated list of types to display, where
1859 .Ar type
1860 is one of
1861 .Sy filesystem , snapshot , volume , No or Sy all .
1862 For example, specifying
1863 .Fl t Cm snapshot
1864 displays only snapshots.
1865 .It Fl s Ar property
1866 A property for sorting the output by column in ascending order based on the
1867 value of the property. The property must be one of the properties described in
1868 the
1869 .Qq Sx Properties
1870 section, or the special value
1871 .Cm name
1872 to sort by the dataset name. Multiple properties can be specified at one time
1873 using multiple
1874 .Fl s
1875 property options. Multiple
1876 .Fl s
1877 options are evaluated from left to right in decreasing order of importance.
1878 .Pp
1879 The following is a list of sorting criteria:
1880 .Bl -bullet -offset 2n
1881 .It
1882 Numeric types sort in numeric order.
1883 .It
1884 String types sort in alphabetical order.
1885 .It
1886 Types inappropriate for a row sort that row to the literal bottom, regardless
1887 of the specified ordering.
1888 .It
1889 If no sorting options are specified the existing behavior of
1890 .Qq Nm Cm list
1891 is preserved.
1892 .El
1893 .It Fl S Ar property
1894 Same as the
1895 .Fl s
1896 option, but sorts by property in descending order.
1897 .El
1898 .It Xo
1899 .Nm
1900 .Cm set
1901 .Ar property Ns = Ns Ar value
1902 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
1903 .Xc
1904 .Pp
1905 Sets the property to the given value for each dataset. Only some properties can
1906 be edited. See the "Properties" section for more information on what properties
1907 can be set and acceptable values. Numeric values can be specified as exact
1908 values, or in a human-readable form with a suffix of
1909 .Sy B , K , M , G , T , P , E , Z
1910 (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or
1911 zettabytes, respectively). User properties can be set on snapshots. For more
1912 information, see the
1913 .Qq Sx User Properties
1914 section.
1915 .It Xo
1916 .Nm
1917 .Cm get
1918 .Op Fl r Ns | Ns Fl d Ar depth
1919 .Op Fl Hp
1920 .Op Fl o Ar all | field Ns Oo , Ns Ar field Oc Ns ...
1921 .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
1922 .Op Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
1923 .Ar all | property Ns Oo , Ns Ar property Oc Ns ...
1924 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
1925 .Xc
1926 .Pp
1927 Displays properties for the given datasets. If no datasets are specified, then
1928 the command displays properties for all datasets on the system. For each
1929 property, the following columns are displayed:
1930 .Pp
1931 .Bl -hang -width "property" -offset indent -compact
1932 .It name
1933 Dataset name
1934 .It property
1935 Property name
1936 .It value
1937 Property value
1938 .It source
1939 Property source. Can either be local, default, temporary, inherited, or none
1940 (\&-).
1941 .El
1942 .Pp
1943 All columns except the
1944 .Sy RECEIVED
1945 column are displayed by default. The columns to display can be specified
1946 by using the
1947 .Fl o
1948 option. This command takes a comma-separated list of properties as described in
1949 the
1950 .Qq Sx Native Properties
1951 and
1952 .Qq Sx User Properties
1953 sections.
1954 .Pp
1955 The special value
1956 .Cm all
1957 can be used to display all properties that apply to the given dataset's type
1958 (filesystem, volume, or snapshot).
1959 .Bl -tag -width indent
1960 .It Fl r
1961 Recursively display properties for any children.
1962 .It Fl d Ar depth
1963 Recursively display any children of the dataset, limiting the recursion to
1964 .Ar depth .
1965 A depth of
1966 .Sy 1
1967 will display only the dataset and its direct children.
1968 .It Fl H
1969 Display output in a form more easily parsed by scripts. Any headers are
1970 omitted, and fields are explicitly separated by a single tab instead of an
1971 arbitrary amount of space.
1972 .It Fl p
1973 Display numbers in parseable (exact) values.
1974 .It Fl o Cm all | Ar field Ns Oo , Ns Ar field Oc Ns ...
1975 A comma-separated list of columns to display. Supported values are
1976 .Sy name,property,value,received,source .
1977 Default values are
1978 .Sy name,property,value,source .
1979 The keyword
1980 .Cm all
1981 specifies all columns.
1982 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
1983 A comma-separated list of types to display, where
1984 .Ar type
1985 is one of
1986 .Sy filesystem , snapshot , volume , No or Sy all .
1987 For example, specifying
1988 .Fl t Cm snapshot
1989 displays only snapshots.
1990 .It Fl s Ar source Ns Oo , Ns Ar source Oc Ns ...
1991 A comma-separated list of sources to display. Those properties coming from a
1992 source other than those in this list are ignored. Each source must be one of
1993 the following:
1994 .Sy local,default,inherited,temporary,received,none .
1995 The default value is all sources.
1996 .El
1997 .It Xo
1998 .Nm
1999 .Cm inherit
2000 .Op Fl rS
2001 .Ar property
2002 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2003 .Xc
2004 .Pp
2005 Clears the specified property, causing it to be inherited from an ancestor. If
2006 no ancestor has the property set, then the default value is used. See the
2007 .Qq Sx Properties
2008 section for a listing of default values, and details on which properties can be
2009 inherited.
2010 .Bl -tag -width indent
2011 .It Fl r
2012 Recursively inherit the given property for all children.
2013 .It Fl S
2014 For properties with a received value, revert to this value. This flag has no
2015 effect on properties that do not have a received value.
2016 .El
2017 .It Xo
2018 .Nm
2019 .Cm upgrade
2020 .Op Fl v
2021 .Xc
2022 .Pp
2023 Displays a list of file systems that are not the most recent version.
2024 .Bl -tag -width indent
2025 .It Fl v
2026 Displays
2027 .Tn ZFS
2028 filesystem versions supported by the current software. The current
2029 .Tn ZFS
2030 filesystem version and all previous supported versions are displayed, along
2031 with an explanation of the features provided with each version.
2032 .El
2033 .It Xo
2034 .Nm
2035 .Cm upgrade
2036 .Op Fl r
2037 .Op Fl V Ar version
2038 .Fl a | Ar filesystem
2039 .Xc
2040 .Pp
2041 Upgrades file systems to a new on-disk version. Once this is done, the file
2042 systems will no longer be accessible on systems running older versions of the
2043 software.
2044 .Qq Nm Cm send
2045 streams generated from new snapshots of these file systems cannot be accessed
2046 on systems running older versions of the software.
2047 .Pp
2048 In general, the file system version is independent of the pool version. See
2049 .Xr zpool 8
2050 for information on the
2051 .Nm zpool Cm upgrade
2052 command.
2053 .Pp
2054 In some cases, the file system version and the pool version are interrelated
2055 and the pool version must be upgraded before the file system version can be
2056 upgraded.
2057 .Bl -tag -width indent
2058 .It Fl r
2059 Upgrade the specified file system and all descendent file systems.
2060 .It Fl V Ar version
2061 Upgrade to the specified
2062 .Ar version .
2063 If the
2064 .Fl V
2065 flag is not specified, this command upgrades to the most recent version. This
2066 option can only be used to increase the version number, and only up to the most
2067 recent version supported by this software.
2068 .It Fl a
2069 Upgrade all file systems on all imported pools.
2070 .It Ar filesystem
2071 Upgrade the specified file system.
2072 .El
2073 .It Xo
2074 .Nm
2075 .Cm userspace
2076 .Op Fl Hinp
2077 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2078 .Oo Fl s Ar field Oc Ns ...
2079 .Oo Fl S Ar field Oc Ns ...
2080 .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2081 .Ar filesystem Ns | Ns Ar snapshot
2082 .Xc
2083 .Pp
2084 Displays space consumed by, and quotas on, each user in the specified
2085 filesystem or snapshot. This corresponds to the
2086 .Sy userused@ Ns Ar user
2087 and
2088 .Sy userquota@ Ns Ar user
2089 properties.
2090 .Bl -tag -width indent
2091 .It Fl n
2092 Print numeric ID instead of user/group name.
2093 .It Fl H
2094 Do not print headers, use tab-delimited output.
2095 .It Fl p
2096 Use exact (parsable) numeric output.
2097 .It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2098 Display only the specified fields from the following set:
2099 .Sy type,name,used,quota .
2100 The default is to display all fields.
2101 .It Fl s Ar field
2102 Sort output by this field. The
2103 .Fl s
2104 and
2105 .Fl S
2106 flags may be specified multiple times to sort first by one field, then by
2107 another. The default is
2108 .Fl s Cm type Fl s Cm name .
2109 .It Fl S Ar field
2110 Sort by this field in reverse order. See
2111 .Fl s .
2112 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2113 Print only the specified types from the following set:
2114 .Sy all,posixuser,smbuser,posixgroup,smbgroup .
2115 .Pp
2116 The default is
2117 .Fl t Cm posixuser,smbuser .
2118 .Pp
2119 The default can be changed to include group types.
2120 .It Fl i
2121 Translate SID to POSIX ID. This flag currently has no effect on
2122 .Fx .
2123 .El
2124 .It Xo
2125 .Nm
2126 .Cm groupspace
2127 .Op Fl Hinp
2128 .Op Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2129 .Oo Fl s Ar field Oc Ns ...
2130 .Oo Fl S Ar field Oc Ns ...
2131 .Op Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2132 .Ar filesystem Ns | Ns Ar snapshot
2133 .Xc
2134 .Pp
2135 Displays space consumed by, and quotas on, each group in the specified
2136 filesystem or snapshot. This subcommand is identical to
2137 .Qq Nm Cm userspace ,
2138 except that the default types to display are
2139 .Fl t Sy posixgroup,smbgroup .
2140 .It Xo
2141 .Nm
2142 .Cm mount
2143 .Xc
2144 .Pp
2145 Displays all
2146 .Tn ZFS
2147 file systems currently mounted.
2148 .Bl -tag -width indent
2149 .It Fl f
2150 .El
2151 .It Xo
2152 .Nm
2153 .Cm mount
2154 .Op Fl vO
2155 .Op Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
2156 .Fl a | Ar filesystem
2157 .Xc
2158 .Pp
2159 Mounts
2160 .Tn ZFS
2161 file systems.
2162 .Bl -tag -width indent
2163 .It Fl v
2164 Report mount progress.
2165 .It Fl O
2166 Perform an overlay mount. Overlay mounts are not supported on
2167 .Fx .
2168 .It Fl o Ar property Ns Oo , Ns Ar property Oc Ns ...
2169 An optional, comma-separated list of mount options to use temporarily for the
2170 duration of the mount. See the
2171 .Qq Sx Temporary Mount Point Properties
2172 section for details.
2173 .It Fl a
2174 Mount all available
2175 .Tn ZFS
2176 file systems.
2177 This command may be executed on
2178 .Fx
2179 system startup by
2180 .Pa /etc/rc.d/zfs .
2181 For more information, see variable
2182 .Va zfs_enable
2183 in
2184 .Xr rc.conf 5 .
2185 .It Ar filesystem
2186 Mount the specified filesystem.
2187 .El
2188 .It Xo
2189 .Nm
2190 .Cm unmount
2191 .Op Fl f
2192 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2193 .Xc
2194 .Pp
2195 Unmounts currently mounted
2196 .Tn ZFS
2197 file systems.
2198 .Bl -tag -width indent
2199 .It Fl f
2200 Forcefully unmount the file system, even if it is currently in use.
2201 .It Fl a
2202 Unmount all available
2203 .Tn ZFS
2204 file systems.
2205 .It Ar filesystem | mountpoint
2206 Unmount the specified filesystem. The command can also be given a path to a
2207 .Tn ZFS
2208 file system mount point on the system.
2209 .El
2210 .It Xo
2211 .Nm
2212 .Cm share
2213 .Fl a | Ar filesystem
2214 .Xc
2215 .Pp
2216 Shares
2217 .Tn ZFS
2218 file systems that have the
2219 .Sy sharenfs
2220 property set.
2221 .Bl -tag -width indent
2222 .It Fl a
2223 Share all
2224 .Tn ZFS
2225 file systems that have the
2226 .Sy sharenfs
2227 property set.
2228 This command may be executed on
2229 .Fx
2230 system startup by
2231 .Pa /etc/rc.d/zfs .
2232 For more information, see variable
2233 .Va zfs_enable
2234 in
2235 .Xr rc.conf 5 .
2236 .It Ar filesystem
2237 Share the specified filesystem according to the
2238 .Tn sharenfs
2239 property. File systems are shared when the
2240 .Tn sharenfs
2241 property is set.
2242 .El
2243 .It Xo
2244 .Nm
2245 .Cm unshare
2246 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2247 .Xc
2248 .Pp
2249 Unshares
2250 .Tn ZFS
2251 file systems that have the
2252 .Tn sharenfs
2253 property set.
2254 .Bl -tag -width indent
2255 .It Fl a
2256 Unshares
2257 .Tn ZFS
2258 file systems that have the
2259 .Sy sharenfs
2260 property set.
2261 This command may be executed on
2262 .Fx
2263 system shutdown by
2264 .Pa /etc/rc.d/zfs .
2265 For more information, see variable
2266 .Va zfs_enable
2267 in
2268 .Xr rc.conf 5 .
2269 .It Ar filesystem | mountpoint
2270 Unshare the specified filesystem. The command can also be given a path to a
2271 .Tn ZFS
2272 file system shared on the system.
2273 .El
2274 .It Xo
2275 .Nm
2276 .Cm send
2277 .Op Fl DnPpRv
2278 .Op Fl i Ar snapshot | Fl I Ar snapshot
2279 .Ar snapshot
2280 .Xc
2281 .Pp
2282 Creates a stream representation of the last
2283 .Ar snapshot
2284 argument (not part of
2285 .Fl i
2286 or
2287 .Fl I )
2288 which is written to standard output. The output can be redirected to
2289 a file or to a different system (for example, using
2290 .Xr ssh 1 ) .
2291 By default, a full stream is generated.
2292 .Bl -tag -width indent
2293 .It Fl i Ar snapshot
2294 Generate an incremental stream from the
2295 .Fl i Ar snapshot
2296 to the last
2297 .Ar snapshot .
2298 The incremental source (the
2299 .Fl i Ar snapshot )
2300 can be specified as the last component of the snapshot name (for example, the
2301 part after the
2302 .Sy @ ) ,
2303 and it is assumed to be from the same file system as the last
2304 .Ar snapshot .
2305 .Pp
2306 If the destination is a clone, the source may be the origin snapshot, which
2307 must be fully specified (for example,
2308 .Cm pool/fs@origin ,
2309 not just
2310 .Cm @origin ) .
2311 .It Fl I Ar snapshot
2312 Generate a stream package that sends all intermediary snapshots from the
2313 .Fl I Ar snapshot
2314 to the last
2315 .Ar snapshot .
2316 For example,
2317 .Ic -I @a fs@d
2318 is similar to
2319 .Ic -i @a fs@b; -i @b fs@c; -i @c fs@d .
2320 The incremental source snapshot may be specified as with the
2321 .Fl i
2322 option.
2323 .It Fl R
2324 Generate a replication stream package, which will replicate the specified
2325 filesystem, and all descendent file systems, up to the named snapshot. When
2326 received, all properties, snapshots, descendent file systems, and clones are
2327 preserved.
2328 .Pp
2329 If the
2330 .Fl i
2331 or
2332 .Fl I
2333 flags are used in conjunction with the
2334 .Fl R
2335 flag, an incremental replication stream is generated. The current values of
2336 properties, and current snapshot and file system names are set when the stream
2337 is received. If the
2338 .Fl F
2339 flag is specified when this stream is received, snapshots and file systems that
2340 do not exist on the sending side are destroyed.
2341 .It Fl D
2342 Generate a deduplicated stream. Blocks which would have been sent multiple
2343 times in the send stream will only be sent once.  The receiving system must
2344 also support this feature to receive a deduplicated stream.  This flag can
2345 be used regardless of the dataset's
2346 .Sy dedup
2347 property, but performance will be much better if the filesystem uses a
2348 dedup-capable checksum (eg.
2349 .Sy sha256 ) .
2350 .It Fl p
2351 Include the dataset's properties in the stream. This flag is implicit when
2352 .Fl R
2353 is specified. The receiving system must also support this feature.
2354 .It Fl n
2355 Do a dry-run ("No-op") send.  Do not generate any actual send data.  This is
2356 useful in conjunction with the
2357 .Fl v
2358 or
2359 .Fl P
2360 flags to determine what data will be sent.
2361 .It Fl P
2362 Print machine-parsable verbose information about the stream package generated.
2363 .It Fl v
2364 Print verbose information about the stream package generated.
2365 This information includes a per-second report of how much data has been sent.
2366 .El
2367 .Pp
2368 The format of the stream is committed. You will be able to receive your streams
2369 on future versions of
2370 .Tn ZFS .
2371 .It Xo
2372 .Nm
2373 .Cm receive
2374 .Op Fl vnFu
2375 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2376 .Xc
2377 .It Xo
2378 .Nm
2379 .Cm receive
2380 .Op Fl vnFu
2381 .Op Fl d | e
2382 .Ar filesystem
2383 .Xc
2384 .Pp
2385 Creates a snapshot whose contents are as specified in the stream provided on
2386 standard input. If a full stream is received, then a new file system is created
2387 as well. Streams are created using the
2388 .Qq Nm Cm send
2389 subcommand, which by default creates a full stream.
2390 .Qq Nm Cm recv
2391 can be used as an alias for
2392 .Qq Nm Cm receive .
2393 .Pp
2394 If an incremental stream is received, then the destination file system must
2395 already exist, and its most recent snapshot must match the incremental stream's
2396 source. For
2397 .Sy zvol Ns s,
2398 the destination device link is destroyed and recreated, which means the
2399 .Sy zvol
2400 cannot be accessed during the
2401 .Sy receive
2402 operation.
2403 .Pp
2404 When a snapshot replication package stream that is generated by using the
2405 .Qq Nm Cm send Fl R
2406 command is received, any snapshots that do not exist on the sending location
2407 are destroyed by using the
2408 .Qq Nm Cm destroy Fl d
2409 command.
2410 .Pp
2411 The name of the snapshot (and file system, if a full stream is received) that
2412 this subcommand creates depends on the argument type and the
2413 .Fl d
2414 or
2415 .Fl e
2416 option.
2417 .Pp
2418 If the argument is a snapshot name, the specified
2419 .Ar snapshot
2420 is created. If the argument is a file system or volume name, a snapshot with
2421 the same name as the sent snapshot is created within the specified
2422 .Ar filesystem
2423 or
2424 .Ar volume .
2425 If the
2426 .Fl d
2427 or
2428 .Fl e
2429 option is specified, the snapshot name is determined by appending the sent
2430 snapshot's name to the specified
2431 .Ar filesystem .
2432 If the
2433 .Fl d
2434 option is specified, all but the pool name of the sent snapshot path is
2435 appended (for example,
2436 .Sy b/c@1
2437 appended from sent snapshot
2438 .Sy a/b/c@1 ) ,
2439 and if the
2440 .Fl e
2441 option is specified, only the tail of the sent snapshot path is appended (for
2442 example,
2443 .Sy c@1
2444 appended from sent snapshot
2445 .Sy a/b/c@1 ) .
2446 In the case of
2447 .Fl d ,
2448 any file systems needed to replicate the path of the sent snapshot are created
2449 within the specified file system.
2450 .Bl -tag -width indent
2451 .It Fl d
2452 Use the full sent snapshot path without the first element (without pool name)
2453 to determine the name of the new snapshot as described in the paragraph above.
2454 .It Fl e
2455 Use only the last element of the sent snapshot path to determine the name of
2456 the new snapshot as described in the paragraph above.
2457 .It Fl u
2458 File system that is associated with the received stream is not mounted.
2459 .It Fl v
2460 Print verbose information about the stream and the time required to perform the
2461 receive operation.
2462 .It Fl n
2463 Do not actually receive the stream. This can be useful in conjunction with the
2464 .Fl v
2465 option to verify the name the receive operation would use.
2466 .It Fl F
2467 Force a rollback of the file system to the most recent snapshot before
2468 performing the receive operation. If receiving an incremental replication
2469 stream (for example, one generated by
2470 .Qq Nm Cm send Fl R Fi iI ) ,
2471 destroy snapshots and file systems that do not exist on the sending side.
2472 .El
2473 .It Xo
2474 .Nm
2475 .Cm allow
2476 .Ar filesystem Ns | Ns Ar volume
2477 .Xc
2478 .Pp
2479 Displays permissions that have been delegated on the specified filesystem or
2480 volume. See the other forms of
2481 .Qq Nm Cm allow
2482 for more information.
2483 .It Xo
2484 .Nm
2485 .Cm allow
2486 .Op Fl ldug
2487 .Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
2488 .Ar perm Ns | Ns Ar @setname Ns
2489 .Oo Ns , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
2490 .Ar filesystem Ns | Ns Ar volume
2491 .Xc
2492 .It Xo
2493 .Nm
2494 .Cm allow
2495 .Op Fl ld
2496 .Fl e Ns | Ns Cm everyone
2497 .Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
2498 .Ns ...
2499 .Ar filesystem Ns | Ns Ar volume
2500 .Xc
2501 .Pp
2502 Delegates
2503 .Tn ZFS
2504 administration permission for the file systems to non-privileged users.
2505 .Bl -tag -width indent
2506 .It Xo
2507 .Op Fl ug
2508 .Ar user Ns | Ns Ar group Ns Oo , Ar user Ns | Ns Ar group Oc Ns ...
2509 .Xc
2510 Specifies to whom the permissions are delegated. Multiple entities can be
2511 specified as a comma-separated list. If neither of the
2512 .Fl ug
2513 options are specified, then the argument is interpreted preferentially as the
2514 keyword
2515 .Cm everyone ,
2516 then as a user name, and lastly as a group name. To specify
2517 a user or group named
2518 .Qq everyone ,
2519 use the
2520 .Fl u
2521 or
2522 .Fl g
2523 options. To specify a group with the same name as a user, use the
2524 .Fl g
2525 option.
2526 .It Op Fl e Ns | Ns Cm everyone
2527 Specifies that the permissions be delegated to
2528 .Qq everyone .
2529 .It Xo
2530 .Ar perm Ns | Ns Ar @setname Ns Oo , Ns Ar perm Ns | Ns Ar @setname Oc Ns ...
2531 .Xc
2532 The permissions to delegate. Multiple permissions
2533 may be specified as a comma-separated list. Permission names are the same as
2534 .Tn ZFS
2535 subcommand and property names. See the property list below. Property set names,
2536 which begin with an at sign
2537 .Pq Sy @ ,
2538 may be specified. See the
2539 .Fl s
2540 form below for details.
2541 .It Xo
2542 .Op Fl ld
2543 .Ar filesystem Ns | Ns Ar volume
2544 .Xc
2545 Specifies where the permissions are delegated. If neither of the
2546 .Fl ld
2547 options are specified, or both are, then the permissions are allowed for the
2548 file system or volume, and all of its descendents. If only the
2549 .Fl l
2550 option is used, then is allowed "locally" only for the specified file system.
2551 If only the
2552 .Fl d
2553 option is used, then is allowed only for the descendent file systems.
2554 .El
2555 .Pp
2556 Permissions are generally the ability to use a
2557 .Tn ZFS
2558 subcommand or change a
2559 .Tn ZFS
2560 property. The following permissions are available:
2561 .Bl -column -offset 4n "secondarycache" "subcommand"
2562 .It NAME Ta TYPE Ta NOTES
2563 .It allow Ta subcommand Ta Must Xo
2564 also have the permission that is being allowed
2565 .Xc
2566 .It clone Ta subcommand Ta Must Xo
2567 also have the 'create' ability and 'mount' ability in the origin file system
2568 .Xc
2569 .It create Ta subcommand Ta Must also have the 'mount' ability
2570 .It destroy Ta subcommand Ta Must also have the 'mount' ability
2571 .It diff Ta subcommand Ta Allows lookup of paths within a dataset given an
2572 object number, and the ability to create snapshots necessary to 'zfs diff'
2573 .It hold Ta subcommand Ta Allows adding a user hold to a snapshot
2574 .It mount Ta subcommand Ta Allows mount/umount of Tn ZFS No datasets
2575 .It promote Ta subcommand Ta Must Xo
2576 also have the 'mount' and 'promote' ability in the origin file system
2577 .Xc
2578 .It receive Ta subcommand Ta Must also have the 'mount' and 'create' ability
2579 .It release Ta subcommand Ta Allows Xo
2580 releasing a user hold which might destroy the snapshot
2581 .Xc
2582 .It rename Ta subcommand Ta Must Xo
2583 also have the 'mount' and 'create' ability in the new parent
2584 .Xc
2585 .It rollback Ta subcommand Ta Must also have the 'mount' ability
2586 .It send Ta subcommand
2587 .It share Ta subcommand Ta Allows Xo
2588 sharing file systems over the
2589 .Tn NFS
2590 protocol
2591 .Xc
2592 .It snapshot Ta subcommand Ta Must also have the 'mount' ability
2593 .It groupquota Ta other Ta Allows accessing any groupquota@... property
2594 .It groupused Ta other Ta Allows reading any groupused@... property
2595 .It userprop Ta other Ta Allows changing any user property
2596 .It userquota Ta other Ta Allows accessing any userquota@... property
2597 .It userused Ta other Ta Allows reading any userused@... property
2598 .It aclinherit Ta property
2599 .It aclmode Ta property
2600 .It atime Ta property
2601 .It canmount Ta property
2602 .It casesensitivity Ta property
2603 .It checksum Ta property
2604 .It compression Ta property
2605 .It copies Ta property
2606 .It dedup Ta property
2607 .It devices Ta property
2608 .It exec Ta property
2609 .It logbias Ta property
2610 .It jailed Ta property
2611 .It mlslabel Ta property
2612 .It mountpoint Ta property
2613 .It nbmand Ta property
2614 .It normalization Ta property
2615 .It primarycache Ta property
2616 .It quota Ta property
2617 .It readonly Ta property
2618 .It recordsize Ta property
2619 .It refquota Ta property
2620 .It refreservation Ta property
2621 .It reservation Ta property
2622 .It secondarycache Ta property
2623 .It setuid Ta property
2624 .It sharenfs Ta property
2625 .It sharesmb Ta property
2626 .It snapdir Ta property
2627 .It sync Ta property
2628 .It utf8only Ta property
2629 .It version Ta property
2630 .It volblocksize Ta property
2631 .It volsize Ta property
2632 .It vscan Ta property
2633 .It xattr Ta property
2634 .El
2635 .It Xo
2636 .Nm
2637 .Cm allow
2638 .Fl c
2639 .Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
2640 .Ns ...
2641 .Ar filesystem Ns | Ns Ar volume
2642 .Xc
2643 .Pp
2644 Sets "create time" permissions. These permissions are granted (locally) to the
2645 creator of any newly-created descendent file system.
2646 .It Xo
2647 .Nm
2648 .Cm allow
2649 .Fl s
2650 .Ar @setname
2651 .Ar perm Ns | Ns Ar @setname Ns Op Ns , Ns Ar perm Ns | Ns Ar @setname Ns
2652 .Ns ...
2653 .Ar filesystem Ns | Ns Ar volume
2654 .Xc
2655 .Pp
2656 Defines or adds permissions to a permission set. The set can be used by other
2657 .Qq Nm Cm allow
2658 commands for the specified file system and its descendents. Sets are evaluated
2659 dynamically, so changes to a set are immediately reflected. Permission sets
2660 follow the same naming restrictions as ZFS file systems, but the name must
2661 begin with an "at sign"
2662 .Pq Sy @ ,
2663 and can be no more than 64 characters long.
2664 .It Xo
2665 .Nm
2666 .Cm unallow
2667 .Op Fl rldug
2668 .Ar user Ns | Ns Ar group Ns Oo Ns , Ns Ar user Ns | Ns Ar group Oc Ns ...
2669 .Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
2670 .Ns ... Oc
2671 .Ar filesystem Ns | Ns Ar volume
2672 .Xc
2673 .It Xo
2674 .Nm
2675 .Cm unallow
2676 .Op Fl rld
2677 .Fl e Ns | Ns Cm everyone
2678 .Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
2679 .Ns ... Oc
2680 .Ar filesystem Ns | Ns Ar volume
2681 .Xc
2682 .It Xo
2683 .Nm
2684 .Cm unallow
2685 .Op Fl r
2686 .Fl c
2687 .Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
2688 .Ns ... Oc
2689 .Ar filesystem Ns | Ns Ar volume
2690 .Xc
2691 .Pp
2692 Removes permissions that were granted with the
2693 .Qq Nm Cm allow
2694 command. No permissions are explicitly denied, so other permissions granted are
2695 still in effect. For example, if the permission is granted by an ancestor. If
2696 no permissions are specified, then all permissions for the specified
2697 .Ar user , group , No or everyone
2698 are removed. Specifying
2699 .Cm everyone
2700 .Po or using the Fl e
2701 option
2702 .Pc only removes the permissions that were granted to everyone ,
2703 not all permissions for every user and group. See the
2704 .Qq Nm Cm allow
2705 command for a description of the
2706 .Fl ldugec
2707 options.
2708 .Bl -tag -width indent
2709 .It Fl r
2710 Recursively remove the permissions from this file system and all descendents.
2711 .El
2712 .It Xo
2713 .Nm
2714 .Cm unallow
2715 .Op Fl r
2716 .Fl s
2717 .Ar @setname
2718 .Oo Ar perm Ns | Ns Ar @setname Ns Op , Ns Ar perm Ns | Ns Ar @setname Ns
2719 .Ns ... Oc
2720 .Ar filesystem Ns | Ns Ar volume
2721 .Xc
2722 .Pp
2723 Removes permissions from a permission set. If no permissions are specified,
2724 then all permissions are removed, thus removing the set entirely.
2725 .It Xo
2726 .Nm
2727 .Cm hold
2728 .Op Fl r
2729 .Ar tag snapshot Ns ...
2730 .Xc
2731 .Pp
2732 Adds a single reference, named with the
2733 .Ar tag
2734 argument, to the specified snapshot or snapshots. Each snapshot has its own tag
2735 namespace, and tags must be unique within that space.
2736 .Pp
2737 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
2738 .Qq Nm Cm destroy
2739 command returns
2740 .Em EBUSY .
2741 .Bl -tag -width indent
2742 .It Fl r
2743 Specifies that a hold with the given tag is applied recursively to the
2744 snapshots of all descendent file systems.
2745 .El
2746 .It Xo
2747 .Nm
2748 .Cm holds
2749 .Op Fl r
2750 .Ar snapshot Ns ...
2751 .Xc
2752 .Pp
2753 Lists all existing user references for the given snapshot or snapshots.
2754 .Bl -tag -width indent
2755 .It Fl r
2756 Lists the holds that are set on the named descendent snapshots, in addition to
2757 listing the holds on the named snapshot.
2758 .El
2759 .It Xo
2760 .Nm
2761 .Cm release
2762 .Op Fl r
2763 .Ar tag snapshot Ns ...
2764 .Xc
2765 .Pp
2766 Removes a single reference, named with the
2767 .Ar tag
2768 argument, from the specified snapshot or snapshots. The tag must already exist
2769 for each snapshot.
2770 .Bl -tag -width indent
2771 .It Fl r
2772 Recursively releases a hold with the given tag on the snapshots of all
2773 descendent file systems.
2774 .El
2775 .It Xo
2776 .Nm
2777 .Cm diff
2778 .Op Fl FHt
2779 .Ar snapshot
2780 .Op Ar snapshot Ns | Ns Ar filesystem
2781 .Xc
2782 .Pp
2783 Display the difference between a snapshot of a given filesystem and another
2784 snapshot of that filesystem from a later time or the current contents of the
2785 filesystem.  The first column is a character indicating the type of change,
2786 the other columns indicate pathname, new pathname
2787 .Pq in case of rename ,
2788 change in link count, and optionally file type and/or change time.
2789 .Pp
2790 The types of change are:
2791 .Bl -column -offset 2n indent
2792 .It \&- Ta path was removed
2793 .It \&+ Ta path was added
2794 .It \&M Ta path was modified
2795 .It \&R Ta path was renamed
2796 .El
2797 .Bl -tag -width indent
2798 .It Fl F
2799 Display an indication of the type of file, in a manner similar to the
2800 .Fl F
2801 option of
2802 .Xr ls 1 .
2803 .Bl -column -offset 2n indent
2804 .It \&B Ta block device
2805 .It \&C Ta character device
2806 .It \&F Ta regular file
2807 .It \&/ Ta directory
2808 .It \&@ Ta symbolic link
2809 .It \&= Ta socket
2810 .It \&> Ta door (not supported on Fx )
2811 .It \&| Ta named pipe (not supported on Fx )
2812 .It \&P Ta event port (not supported on Fx )
2813 .El
2814 .It Fl H
2815 Give more parseable tab-separated output, without header lines and without
2816 arrows.
2817 .It Fl t
2818 Display the path's inode change time as the first column of output.
2819 .El
2820 .It Xo
2821 .Nm
2822 .Cm jail
2823 .Ar jailid filesystem
2824 .Xc
2825 .Pp
2826 Attaches the specified
2827 .Ar filesystem
2828 to the jail identified by JID
2829 .Ar jailid .
2830 From now on this file system tree can be managed from within a jail if the
2831 .Sy jailed
2832 property has been set. To use this functionality, the jail needs the
2833 .Va allow.mount
2834 and
2835 .Va allow.mount.zfs
2836 parameters set to 1 and the
2837 .Va enforce_statfs
2838 parameter set to a value lower than 2.
2839 .Pp
2840 See
2841 .Xr jail 8
2842 for more information on managing jails and configuring the parameters above.
2843 .It Xo
2844 .Nm
2845 .Cm unjail
2846 .Ar jailid filesystem
2847 .Xc
2848 .Pp
2849 Detaches the specified
2850 .Ar filesystem
2851 from the jail identified by JID
2852 .Ar jailid .
2853 .El
2854 .Sh EXIT STATUS
2855 The following exit values are returned:
2856 .Bl -tag -offset 2n -width 2n
2857 .It 0
2858 Successful completion.
2859 .It 1
2860 An error occurred.
2861 .It 2
2862 Invalid command line options were specified.
2863 .El
2864 .Sh EXAMPLES
2865 .Bl -tag -width 0n
2866 .It Sy Example 1 No Creating a Tn ZFS No File System Hierarchy
2867 .Pp
2868 The following commands create a file system named
2869 .Em pool/home
2870 and a file system named
2871 .Em pool/home/bob .
2872 The mount point
2873 .Pa /home
2874 is set for the parent file system, and is automatically inherited by the child
2875 file system.
2876 .Bd -literal -offset 2n
2877 .Li # Ic zfs create pool/home
2878 .Li # Ic zfs set mountpoint=/home pool/home
2879 .Li # Ic zfs create pool/home/bob
2880 .Ed
2881 .It Sy Example 2 No Creating a Tn ZFS No Snapshot
2882 .Pp
2883 The following command creates a snapshot named
2884 .Sy yesterday .
2885 This snapshot is mounted on demand in the
2886 .Pa \&.zfs/snapshot
2887 directory at the root of the
2888 .Em pool/home/bob
2889 file system.
2890 .Bd -literal -offset 2n
2891 .Li # Ic zfs snapshot pool/home/bob@yesterday
2892 .Ed
2893 .It Sy Example 3 No Creating and Destroying Multiple Snapshots
2894 .Pp
2895 The following command creates snapshots named
2896 .Em yesterday
2897 of
2898 .Em pool/home
2899 and all of its descendent file systems. Each snapshot is mounted on demand in
2900 the
2901 .Pa \&.zfs/snapshot
2902 directory at the root of its file system. The second command destroys the newly
2903 created snapshots.
2904 .Bd -literal -offset 2n
2905 .Li # Ic zfs snapshot -r pool/home@yesterday
2906 .Li # Ic zfs destroy -r pool/home@yesterday
2907 .Ed
2908 .It Sy Example 4 No Disabling and Enabling File System Compression
2909 .Pp
2910 The following command disables the
2911 .Sy compression
2912 property for all file systems under
2913 .Em pool/home .
2914 The next command explicitly enables
2915 .Sy compression
2916 for
2917 .Em pool/home/anne .
2918 .Bd -literal -offset 2n
2919 .Li # Ic zfs set compression=off pool/home
2920 .Li # Ic zfs set compression=on pool/home/anne
2921 .Ed
2922 .It Sy Example 5 No Listing Tn ZFS No Datasets
2923 .Pp
2924 The following command lists all active file systems and volumes in the system.
2925 Snapshots are displayed if the
2926 .Sy listsnaps
2927 property is
2928 .Cm on .
2929 The default is
2930 .Cm off .
2931 See
2932 .Xr zpool 8
2933 for more information on pool properties.
2934 .Bd -literal -offset 2n
2935 .Li # Ic zfs list
2936    NAME                      USED  AVAIL  REFER  MOUNTPOINT
2937    pool                      450K   457G    18K  /pool
2938    pool/home                 315K   457G    21K  /home
2939    pool/home/anne             18K   457G    18K  /home/anne
2940    pool/home/bob             276K   457G   276K  /home/bob
2941 .Ed
2942 .It Sy Example 6 No Setting a Quota on a Tn ZFS No File System
2943 .Pp
2944 The following command sets a quota of 50 Gbytes for
2945 .Em pool/home/bob .
2946 .Bd -literal -offset 2n
2947 .Li # Ic zfs set quota=50G pool/home/bob
2948 .Ed
2949 .It Sy Example 7 No Listing Tn ZFS No Properties
2950 .Pp
2951 The following command lists all properties for
2952 .Em pool/home/bob .
2953 .Bd -literal -offset 2n
2954 .Li # Ic zfs get all pool/home/bob
2955 NAME           PROPERTY              VALUE                  SOURCE
2956 pool/home/bob  type                  filesystem             -
2957 pool/home/bob  creation              Tue Jul 21 15:53 2009  -
2958 pool/home/bob  used                  21K                    -
2959 pool/home/bob  available             20.0G                  -
2960 pool/home/bob  referenced            21K                    -
2961 pool/home/bob  compressratio         1.00x                  -
2962 pool/home/bob  mounted               yes                    -
2963 pool/home/bob  quota                 20G                    local
2964 pool/home/bob  reservation           none                   default
2965 pool/home/bob  recordsize            128K                   default
2966 pool/home/bob  mountpoint            /home/bob              default
2967 pool/home/bob  sharenfs              off                    default
2968 pool/home/bob  checksum              on                     default
2969 pool/home/bob  compression           on                     local
2970 pool/home/bob  atime                 on                     default
2971 pool/home/bob  devices               on                     default
2972 pool/home/bob  exec                  on                     default
2973 pool/home/bob  setuid                on                     default
2974 pool/home/bob  readonly              off                    default
2975 pool/home/bob  jailed                off                    default
2976 pool/home/bob  snapdir               hidden                 default
2977 pool/home/bob  aclmode               discard                default
2978 pool/home/bob  aclinherit            restricted             default
2979 pool/home/bob  canmount              on                     default
2980 pool/home/bob  xattr                 on                     default
2981 pool/home/bob  copies                1                      default
2982 pool/home/bob  version               5                      -
2983 pool/home/bob  utf8only              off                    -
2984 pool/home/bob  normalization         none                   -
2985 pool/home/bob  casesensitivity       sensitive              -
2986 pool/home/bob  vscan                 off                    default
2987 pool/home/bob  nbmand                off                    default
2988 pool/home/bob  sharesmb              off                    default
2989 pool/home/bob  refquota              none                   default
2990 pool/home/bob  refreservation        none                   default
2991 pool/home/bob  primarycache          all                    default
2992 pool/home/bob  secondarycache        all                    default
2993 pool/home/bob  usedbysnapshots       0                      -
2994 pool/home/bob  usedbydataset         21K                    -
2995 pool/home/bob  usedbychildren        0                      -
2996 pool/home/bob  usedbyrefreservation  0                      -
2997 pool/home/bob  logbias               latency                default
2998 pool/home/bob  dedup                 off                    default
2999 pool/home/bob  mlslabel                                     -
3000 pool/home/bob  sync                  standard               default
3001 pool/home/bob  refcompressratio      1.00x                  -
3002 .Ed
3003 .Pp
3004 The following command gets a single property value.
3005 .Bd -literal -offset 2n
3006 .Li # Ic zfs get -H -o value compression pool/home/bob
3007 on
3008 .Ed
3009 .Pp
3010 The following command lists all properties with local settings for
3011 .Em pool/home/bob .
3012 .Bd -literal -offset 2n
3013 .Li # Ic zfs get -s local -o name,property,value all pool/home/bob
3014 NAME           PROPERTY              VALUE
3015 pool/home/bob  quota                 20G
3016 pool/home/bob  compression           on
3017 .Ed
3018 .It Sy Example 8 No Rolling Back a Tn ZFS No File System
3019 .Pp
3020 The following command reverts the contents of
3021 .Em pool/home/anne
3022 to the snapshot named
3023 .Em yesterday ,
3024 deleting all intermediate snapshots.
3025 .Bd -literal -offset 2n
3026 .Li # Ic zfs rollback -r pool/home/anne@yesterday
3027 .Ed
3028 .It Sy Example 9 No Creating a Tn ZFS No Clone
3029 .Pp
3030 The following command creates a writable file system whose initial contents are
3031 the same as
3032 .Em pool/home/bob@yesterday .
3033 .Bd -literal -offset 2n
3034 .Li # Ic zfs clone pool/home/bob@yesterday pool/clone
3035 .Ed
3036 .It Sy Example 10 No Promoting a Tn ZFS No Clone
3037 .Pp
3038 The following commands illustrate how to test out changes to a file system, and
3039 then replace the original file system with the changed one, using clones, clone
3040 promotion, and renaming:
3041 .Bd -literal -offset 2n
3042 .Li # Ic zfs create pool/project/production
3043 .Ed
3044 .Pp
3045 Populate
3046 .Pa /pool/project/production
3047 with data and continue with the following commands:
3048 .Bd -literal -offset 2n
3049 .Li # Ic zfs snapshot pool/project/production@today
3050 .Li # Ic zfs clone pool/project/production@today pool/project/beta
3051 .Ed
3052 .Pp
3053 Now make changes to
3054 .Pa /pool/project/beta
3055 and continue with the following commands:
3056 .Bd -literal -offset 2n
3057 .Li # Ic zfs promote pool/project/beta
3058 .Li # Ic zfs rename pool/project/production pool/project/legacy
3059 .Li # Ic zfs rename pool/project/beta pool/project/production
3060 .Ed
3061 .Pp
3062 Once the legacy version is no longer needed, it can be destroyed.
3063 .Bd -literal -offset 2n
3064 .Li # Ic zfs destroy pool/project/legacy
3065 .Ed
3066 .It Sy Example 11 No Inheriting Tn ZFS No Properties
3067 .Pp
3068 The following command causes
3069 .Em pool/home/bob
3070 and
3071 .Em pool/home/anne
3072 to inherit the
3073 .Sy checksum
3074 property from their parent.
3075 .Bd -literal -offset 2n
3076 .Li # Ic zfs inherit checksum pool/home/bob pool/home/anne
3077 .Ed
3078 .It Sy Example 12 No Remotely Replicating Tn ZFS No Data
3079 .Pp
3080 The following commands send a full stream and then an incremental stream to a
3081 remote machine, restoring them into
3082 .Sy poolB/received/fs@a
3083 and
3084 .Sy poolB/received/fs@b ,
3085 respectively.
3086 .Sy poolB
3087 must contain the file system
3088 .Sy poolB/received ,
3089 and must not initially contain
3090 .Sy poolB/received/fs .
3091 .Bd -literal -offset 2n
3092 .Li # Ic zfs send pool/fs@a | ssh host zfs receive poolB/received/fs@a
3093 .Li # Ic zfs send -i a pool/fs@b | ssh host zfs receive poolB/received/fs
3094 .Ed
3095 .It Xo
3096 .Sy Example 13
3097 Using the
3098 .Qq zfs receive -d
3099 Option
3100 .Xc
3101 .Pp
3102 The following command sends a full stream of
3103 .Sy poolA/fsA/fsB@snap
3104 to a remote machine, receiving it into
3105 .Sy poolB/received/fsA/fsB@snap .
3106 The
3107 .Sy fsA/fsB@snap
3108 portion of the received snapshot's name is determined from the name of the sent
3109 snapshot.
3110 .Sy poolB
3111 must contain the file system
3112 .Sy poolB/received .
3113 If
3114 .Sy poolB/received/fsA
3115 does not exist, it is created as an empty file system.
3116 .Bd -literal -offset 2n
3117 .Li # Ic zfs send poolA/fsA/fsB@snap | ssh host zfs receive -d poolB/received
3118 .Ed
3119 .It Sy Example 14 No Setting User Properties
3120 .Pp
3121 The following example sets the user-defined
3122 .Sy com.example:department
3123 property for a dataset.
3124 .Bd -literal -offset 2n
3125 .Li # Ic zfs set com.example:department=12345 tank/accounting
3126 .Ed
3127 .It Sy Example 15 No Performing a Rolling Snapshot
3128 .Pp
3129 The following example shows how to maintain a history of snapshots with a
3130 consistent naming scheme. To keep a week's worth of snapshots, the user
3131 destroys the oldest snapshot, renames the remaining snapshots, and then creates
3132 a new snapshot, as follows:
3133 .Bd -literal -offset 2n
3134 .Li # Ic zfs destroy -r pool/users@7daysago
3135 .Li # Ic zfs rename -r pool/users@6daysago @7daysago
3136 .Li # Ic zfs rename -r pool/users@5daysago @6daysago
3137 .Li # Ic zfs rename -r pool/users@4daysago @5daysago
3138 .Li # Ic zfs rename -r pool/users@3daysago @4daysago
3139 .Li # Ic zfs rename -r pool/users@2daysago @3daysago
3140 .Li # Ic zfs rename -r pool/users@yesterday @2daysago
3141 .Li # Ic zfs rename -r pool/users@today @yesterday
3142 .Li # Ic zfs snapshot -r pool/users@today
3143 .Ed
3144 .It Xo
3145 .Sy Example 16
3146 Setting
3147 .Qq sharenfs
3148 Property Options on a ZFS File System
3149 .Xc
3150 .Pp
3151 The following command shows how to set
3152 .Sy sharenfs
3153 property options to enable root access for a specific network on the
3154 .Em tank/home
3155 file system. The contents of the
3156 .Sy sharenfs
3157 property are valid
3158 .Xr exports 5
3159 options.
3160 .Bd -literal -offset 2n
3161 .Li # Ic zfs set sharenfs="maproot=root,network 192.168.0.0/24" tank/home
3162 .Ed
3163 .Pp
3164 Another way to write this command with the same result is:
3165 .Bd -literal -offset 2n
3166 .Li # Ic set zfs sharenfs="-maproot=root -network 192.168.0.0/24" tank/home
3167 .Ed
3168 .It Xo
3169 .Sy Example 17
3170 Delegating
3171 .Tn ZFS
3172 Administration Permissions on a
3173 .Tn ZFS
3174 Dataset
3175 .Xc
3176 .Pp
3177 The following example shows how to set permissions so that user
3178 .Em cindys
3179 can create, destroy, mount, and take snapshots on
3180 .Em tank/cindys .
3181 The permissions on
3182 .Em tank/cindys
3183 are also displayed.
3184 .Bd -literal -offset 2n
3185 .Li # Ic zfs allow cindys create,destroy,mount,snapshot tank/cindys
3186 .Li # Ic zfs allow tank/cindys
3187 -------------------------------------------------------------
3188 Local+Descendent permissions on (tank/cindys)
3189           user cindys create,destroy,mount,snapshot
3190 -------------------------------------------------------------
3191 .Ed
3192 .It Sy Example 18 No Delegating Create Time Permissions on a Tn ZFS No Dataset
3193 .Pp
3194 The following example shows how to grant anyone in the group
3195 .Em staff
3196 to create file systems in
3197 .Em tank/users .
3198 This syntax also allows staff members to destroy their own file systems, but
3199 not destroy anyone else's file system. The permissions on
3200 .Em tank/users
3201 are also displayed.
3202 .Bd -literal -offset 2n
3203 .Li # Ic zfs allow staff create,mount tank/users
3204 .Li # Ic zfs allow -c destroy tank/users
3205 .Li # Ic zfs allow tank/users
3206 -------------------------------------------------------------
3207 Create time permissions on (tank/users)
3208           create,destroy
3209 Local+Descendent permissions on (tank/users)
3210           group staff create,mount
3211 -------------------------------------------------------------
3212 .Ed
3213 .It Xo
3214 .Sy Example 19
3215 Defining and Granting a Permission Set on a
3216 .Tn ZFS
3217 Dataset
3218 .Xc
3219 .Pp
3220 The following example shows how to define and grant a permission set on the
3221 .Em tank/users
3222 file system. The permissions on
3223 .Em tank/users
3224 are also displayed.
3225 .Bd -literal -offset 2n
3226 .Li # Ic zfs allow -s @pset create,destroy,snapshot,mount tank/users
3227 .Li # Ic zfs allow staff @pset tank/users
3228 .Li # Ic zfs allow tank/users
3229 -------------------------------------------------------------
3230 Permission sets on (tank/users)
3231         @pset create,destroy,mount,snapshot
3232 Create time permissions on (tank/users)
3233         create,destroy
3234 Local+Descendent permissions on (tank/users)
3235         group staff @pset,create,mount
3236 -------------------------------------------------------------
3237 .Ed
3238 .It Sy Example 20 No Delegating Property Permissions on a Tn ZFS No Dataset
3239 .Pp
3240 The following example shows to grant the ability to set quotas and reservations
3241 on the
3242 .Sy users/home
3243 file system. The permissions on
3244 .Sy users/home
3245 are also displayed.
3246 .Bd -literal -offset 2n
3247 .Li # Ic zfs allow cindys quota,reservation users/home
3248 .Li # Ic zfs allow cindys
3249 -------------------------------------------------------------
3250 Local+Descendent permissions on (users/home)
3251         user cindys quota,reservation
3252 -------------------------------------------------------------
3253 .Li # Ic su - cindys
3254 .Li cindys% Ic zfs set quota=10G users/home/marks
3255 .Li cindys% Ic zfs get quota users/home/marks
3256 NAME              PROPERTY  VALUE             SOURCE
3257 users/home/marks  quota     10G               local
3258 .Ed
3259 .It Sy Example 21 No Removing ZFS Delegated Permissions on a Tn ZFS No Dataset
3260 .Pp
3261 The following example shows how to remove the snapshot permission from the
3262 .Em staff
3263 group on the
3264 .Em tank/users
3265 file system. The permissions on
3266 .Em tank/users
3267 are also displayed.
3268 .Bd -literal -offset 2n
3269 .Li # Ic zfs unallow staff snapshot tank/users
3270 .Li # Ic zfs allow tank/users
3271 -------------------------------------------------------------
3272 Permission sets on (tank/users)
3273         @pset create,destroy,mount,snapshot
3274 Create time permissions on (tank/users)
3275         create,destroy
3276 Local+Descendent permissions on (tank/users)
3277         group staff @pset,create,mount
3278 -------------------------------------------------------------
3279 .Ed
3280 .It Sy Example 22 Showing the differences between a snapshot and a ZFS Dataset
3281 .Pp
3282 The following example shows how to see what has changed between a prior
3283 snapshot of a ZFS Dataset and its current state.  The
3284 .Fl F
3285 option is used to indicate type information for the files affected.
3286 .Bd -literal -offset 2n
3287 .Li # Ic zfs diff tank/test@before tank/test
3288 M       /       /tank/test/
3289 M       F       /tank/test/linked      (+1)
3290 R       F       /tank/test/oldname -> /tank/test/newname
3291 -       F       /tank/test/deleted
3292 +       F       /tank/test/created
3293 M       F       /tank/test/modified
3294 .Ed
3295 .El
3296 .Sh SEE ALSO
3297 .Xr chmod 2 ,
3298 .Xr fsync 2 ,
3299 .Xr exports 5 ,
3300 .Xr fstab 5 ,
3301 .Xr rc.conf 5 ,
3302 .Xr jail 8 ,
3303 .Xr mount 8 ,
3304 .Xr umount 8 ,
3305 .Xr zpool 8
3306 .Sh AUTHORS
3307 This manual page is a
3308 .Xr mdoc 7
3309 reimplementation of the
3310 .Tn OpenSolaris
3311 manual page
3312 .Em zfs(1M) ,
3313 modified and customized for
3314 .Fx
3315 and licensed under the
3316 Common Development and Distribution License
3317 .Pq Tn CDDL .
3318 .Pp
3319 The
3320 .Xr mdoc 7
3321 implementation of this manual page was initially written by
3322 .An Martin Matuska Aq mm@FreeBSD.org .