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