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