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