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