Merge commit 'fdfb62c8fbf6e03ca943243b626360bede206f18'
[unleashed.git] / share / man / man8 / zfs.8
blob0a747cb634a06bf4e33aa2b630e28276eb667672
1 .\"
2 .\" CDDL HEADER START
3 .\"
4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
7 .\"
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
12 .\"
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\"
22 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24 .\" Copyright (c) 2011, 2016 by Delphix. All rights reserved.
25 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28 .\" Copyright (c) 2014 Integros [integros.com]
29 .\" Copyright 2018 Nexenta Systems, Inc.
30 .\" Copyright 2018 Joyent, Inc.
31 .\" Copyright (c) 2018 Datto Inc.
32 .\"
33 .Dd December 6, 2017
34 .Dt ZFS 8
35 .Os
36 .Sh NAME
37 .Nm zfs
38 .Nd configures ZFS file systems
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl \?
42 .Nm
43 .Cm create
44 .Op Fl p
45 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
46 .Ar filesystem
47 .Nm
48 .Cm create
49 .Op Fl ps
50 .Op Fl b Ar blocksize
51 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
52 .Fl V Ar size Ar volume
53 .Nm
54 .Cm destroy
55 .Op Fl Rfnprv
56 .Ar filesystem Ns | Ns Ar volume
57 .Nm
58 .Cm destroy
59 .Op Fl Rdnprv
60 .Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
61 .Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
62 .Nm
63 .Cm destroy
64 .Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
65 .Nm
66 .Cm snapshot
67 .Op Fl r
68 .Oo Fl o Ar property Ns = Ns value Oc Ns ...
69 .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
70 .Nm
71 .Cm rollback
72 .Op Fl Rfr
73 .Ar snapshot
74 .Nm
75 .Cm clone
76 .Op Fl p
77 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
78 .Ar snapshot Ar filesystem Ns | Ns Ar volume
79 .Nm
80 .Cm promote
81 .Ar clone-filesystem
82 .Nm
83 .Cm rename
84 .Op Fl f
85 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
86 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
87 .Nm
88 .Cm rename
89 .Op Fl fp
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 Ar snapshot
96 .Nm
97 .Cm list
98 .Op Fl r Ns | Ns Fl d Ar depth
99 .Op Fl Hp
100 .Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
101 .Oo Fl s Ar property Oc Ns ...
102 .Oo Fl S Ar property Oc Ns ...
103 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
104 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
106 .Cm remap
107 .Ar filesystem Ns | Ns Ar volume
109 .Cm set
110 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
111 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
113 .Cm get
114 .Op Fl r Ns | Ns Fl d Ar depth
115 .Op Fl Hp
116 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
117 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
118 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
119 .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
120 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
122 .Cm inherit
123 .Op Fl rS
124 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
126 .Cm upgrade
128 .Cm upgrade
129 .Fl v
131 .Cm upgrade
132 .Op Fl r
133 .Op Fl V Ar version
134 .Fl a | Ar filesystem
136 .Cm userspace
137 .Op Fl Hinp
138 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
139 .Oo Fl s Ar field Oc Ns ...
140 .Oo Fl S Ar field Oc Ns ...
141 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
142 .Ar filesystem Ns | Ns Ar snapshot
144 .Cm groupspace
145 .Op Fl Hinp
146 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
147 .Oo Fl s Ar field Oc Ns ...
148 .Oo Fl S Ar field Oc Ns ...
149 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
150 .Ar filesystem Ns | Ns Ar snapshot
152 .Cm mount
154 .Cm mount
155 .Op Fl Ov
156 .Op Fl o Ar options
157 .Fl a | Ar filesystem
159 .Cm unmount
160 .Op Fl f
161 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
163 .Cm share
164 .Fl a | Ar filesystem
166 .Cm unshare
167 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
169 .Cm bookmark
170 .Ar snapshot bookmark
172 .Cm send
173 .Op Fl DLPRcenpv
174 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
175 .Ar snapshot
177 .Cm send
178 .Op Fl Lce
179 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
180 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
182 .Cm send
183 .Op Fl Penv
184 .Fl t Ar receive_resume_token
186 .Cm receive
187 .Op Fl Fnsuv
188 .Op Fl o Sy origin Ns = Ns Ar snapshot
189 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
191 .Cm receive
192 .Op Fl Fnsuv
193 .Op Fl d Ns | Ns Fl e
194 .Op Fl o Sy origin Ns = Ns Ar snapshot
195 .Ar filesystem
197 .Cm receive
198 .Fl A
199 .Ar filesystem Ns | Ns Ar volume
201 .Cm allow
202 .Ar filesystem Ns | Ns Ar volume
204 .Cm allow
205 .Op Fl dglu
206 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
207 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
208 .Ar setname Oc Ns ...
209 .Ar filesystem Ns | Ns Ar volume
211 .Cm allow
212 .Op Fl dl
213 .Fl e Ns | Ns Sy everyone
214 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
215 .Ar setname Oc Ns ...
216 .Ar filesystem Ns | Ns Ar volume
218 .Cm allow
219 .Fl c
220 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
221 .Ar setname Oc Ns ...
222 .Ar filesystem Ns | Ns Ar volume
224 .Cm allow
225 .Fl s No @ Ns Ar setname
226 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
227 .Ar setname Oc Ns ...
228 .Ar filesystem Ns | Ns Ar volume
230 .Cm unallow
231 .Op Fl dglru
232 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
233 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
234 .Ar setname Oc Ns ... Oc
235 .Ar filesystem Ns | Ns Ar volume
237 .Cm unallow
238 .Op Fl dlr
239 .Fl e Ns | Ns Sy everyone
240 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
241 .Ar setname Oc Ns ... Oc
242 .Ar filesystem Ns | Ns Ar volume
244 .Cm unallow
245 .Op Fl r
246 .Fl c
247 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
248 .Ar setname Oc Ns ... Oc
249 .Ar filesystem Ns | Ns Ar volume
251 .Cm unallow
252 .Op Fl r
253 .Fl s @ Ns Ar setname
254 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
255 .Ar setname Oc Ns ... Oc
256 .Ar filesystem Ns | Ns Ar volume
258 .Cm hold
259 .Op Fl r
260 .Ar tag Ar snapshot Ns ...
262 .Cm holds
263 .Op Fl r
264 .Ar snapshot Ns ...
266 .Cm release
267 .Op Fl r
268 .Ar tag Ar snapshot Ns ...
270 .Cm diff
271 .Op Fl FHt
272 .Ar snapshot Ar snapshot Ns | Ns Ar filesystem
274 .Cm program
275 .Op Fl jn
276 .Op Fl t Ar timeout
277 .Op Fl m Ar memory_limit
278 .Ar pool script
279 .Op Ar arg1 No ...
280 .Sh DESCRIPTION
283 command configures ZFS datasets within a ZFS storage pool, as described in
284 .Xr zpool 8 .
285 A dataset is identified by a unique path within the ZFS namespace.
286 For example:
287 .Bd -literal
288 pool/{filesystem,volume,snapshot}
291 where the maximum length of a dataset name is
292 .Dv MAXNAMELEN
293 .Pq 256 bytes
294 and the maximum amount of nesting allowed in a path is 50 levels deep.
296 A dataset can be one of the following:
297 .Bl -tag -width "file system"
298 .It Sy file system
299 A ZFS dataset of type
300 .Sy filesystem
301 can be mounted within the standard system namespace and behaves like other file
302 systems.
303 While ZFS file systems are designed to be POSIX compliant, known issues exist
304 that prevent compliance in some cases.
305 Applications that depend on standards conformance might fail due to non-standard
306 behavior when checking file system free space.
307 .It Sy volume
308 A logical volume exported as a raw or block device.
309 This type of dataset should only be used under special circumstances.
310 File systems are typically used in most environments.
311 .It Sy snapshot
312 A read-only version of a file system or volume at a given point in time.
313 It is specified as
314 .Ar filesystem Ns @ Ns Ar name
316 .Ar volume Ns @ Ns Ar name .
318 .Ss ZFS File System Hierarchy
319 A ZFS storage pool is a logical collection of devices that provide space for
320 datasets.
321 A storage pool is also the root of the ZFS file system hierarchy.
323 The root of the pool can be accessed as a file system, such as mounting and
324 unmounting, taking snapshots, and setting properties.
325 The physical storage characteristics, however, are managed by the
326 .Xr zpool 8
327 command.
330 .Xr zpool 8
331 for more information on creating and administering pools.
332 .Ss Snapshots
333 A snapshot is a read-only copy of a file system or volume.
334 Snapshots can be created extremely quickly, and initially consume no additional
335 space within the pool.
336 As data within the active dataset changes, the snapshot consumes more data than
337 would otherwise be shared with the active dataset.
339 Snapshots can have arbitrary names.
340 Snapshots of volumes can be cloned or rolled back, but cannot be accessed
341 independently.
343 File system snapshots can be accessed under the
344 .Pa .zfs/snapshot
345 directory in the root of the file system.
346 Snapshots are automatically mounted on demand and may be unmounted at regular
347 intervals.
348 The visibility of the
349 .Pa .zfs
350 directory can be controlled by the
351 .Sy snapdir
352 property.
353 .Ss Clones
354 A clone is a writable volume or file system whose initial contents are the same
355 as another dataset.
356 As with snapshots, creating a clone is nearly instantaneous, and initially
357 consumes no additional space.
359 Clones can only be created from a snapshot.
360 When a snapshot is cloned, it creates an implicit dependency between the parent
361 and child.
362 Even though the clone is created somewhere else in the dataset hierarchy, the
363 original snapshot cannot be destroyed as long as a clone exists.
365 .Sy origin
366 property exposes this dependency, and the
367 .Cm destroy
368 command lists any such dependencies, if they exist.
370 The clone parent-child dependency relationship can be reversed by using the
371 .Cm promote
372 subcommand.
373 This causes the
374 .Qq origin
375 file system to become a clone of the specified file system, which makes it
376 possible to destroy the file system that the clone was created from.
377 .Ss "Mount Points"
378 Creating a ZFS file system is a simple operation, so the number of file systems
379 per system is likely to be numerous.
380 To cope with this, ZFS automatically manages mounting and unmounting file
381 systems without the need to edit the
382 .Pa /etc/vfstab
383 file.
384 All automatically managed file systems are mounted by ZFS at boot time.
386 By default, file systems are mounted under
387 .Pa /path ,
388 where
389 .Ar path
390 is the name of the file system in the ZFS namespace.
391 Directories are created and destroyed as needed.
393 A file system can also have a mount point set in the
394 .Sy mountpoint
395 property.
396 This directory is created as needed, and ZFS automatically mounts the file
397 system when the
398 .Nm zfs Cm mount Fl a
399 command is invoked
400 .Po without editing
401 .Pa /etc/vfstab
402 .Pc .
404 .Sy mountpoint
405 property can be inherited, so if
406 .Em pool/home
407 has a mount point of
408 .Pa /export/stuff ,
409 then
410 .Em pool/home/user
411 automatically inherits a mount point of
412 .Pa /export/stuff/user .
414 A file system
415 .Sy mountpoint
416 property of
417 .Sy none
418 prevents the file system from being mounted.
420 If needed, ZFS file systems can also be managed with traditional tools
422 .Nm mount ,
423 .Nm umount ,
424 .Pa /etc/vfstab
425 .Pc .
426 If a file system's mount point is set to
427 .Sy legacy ,
428 ZFS makes no attempt to manage the file system, and the administrator is
429 responsible for mounting and unmounting the file system.
430 .Ss "Zones"
431 A ZFS file system can be added to a non-global zone by using the
432 .Nm zonecfg Cm add Sy fs
433 subcommand.
434 A ZFS file system that is added to a non-global zone must have its
435 .Sy mountpoint
436 property set to
437 .Sy legacy .
439 The physical properties of an added file system are controlled by the global
440 administrator.
441 However, the zone administrator can create, modify, or destroy files within the
442 added file system, depending on how the file system is mounted.
444 A dataset can also be delegated to a non-global zone by using the
445 .Nm zonecfg Cm add Sy dataset
446 subcommand.
447 You cannot delegate a dataset to one zone and the children of the same dataset
448 to another zone.
449 The zone administrator can change properties of the dataset or any of its
450 children.
451 However, the
452 .Sy quota ,
453 .Sy filesystem_limit
455 .Sy snapshot_limit
456 properties of the delegated dataset can be modified only by the global
457 administrator.
459 A ZFS volume can be added as a device to a non-global zone by using the
460 .Nm zonecfg Cm add Sy device
461 subcommand.
462 However, its physical properties can be modified only by the global
463 administrator.
465 For more information about
466 .Nm zonecfg
467 syntax, see
468 .Xr zonecfg 8 .
470 After a dataset is delegated to a non-global zone, the
471 .Sy zoned
472 property is automatically set.
473 A zoned file system cannot be mounted in the global zone, since the zone
474 administrator might have to set the mount point to an unacceptable value.
476 The global administrator can forcibly clear the
477 .Sy zoned
478 property, though this should be done with extreme care.
479 The global administrator should verify that all the mount points are acceptable
480 before clearing the property.
481 .Ss Native Properties
482 Properties are divided into two types, native properties and user-defined
483 .Po or
484 .Qq user
486 properties.
487 Native properties either export internal statistics or control ZFS behavior.
488 In addition, native properties are either editable or read-only.
489 User properties have no effect on ZFS behavior, but you can use them to annotate
490 datasets in a way that is meaningful in your environment.
491 For more information about user properties, see the
492 .Sx User Properties
493 section, below.
495 Every dataset has a set of properties that export statistics about the dataset
496 as well as control various behaviors.
497 Properties are inherited from the parent unless overridden by the child.
498 Some properties apply only to certain types of datasets
499 .Pq file systems, volumes, or snapshots .
501 The values of numeric properties can be specified using human-readable suffixes
502 .Po for example,
503 .Sy k ,
504 .Sy KB ,
505 .Sy M ,
506 .Sy Gb ,
507 and so forth, up to
508 .Sy Z
509 for zettabyte
510 .Pc .
511 The following are all valid
512 .Pq and equal
513 specifications:
514 .Li 1536M, 1.5g, 1.50GB .
516 The values of non-numeric properties are case sensitive and must be lowercase,
517 except for
518 .Sy mountpoint ,
519 .Sy sharenfs ,
521 .Sy sharesmb .
523 The following native properties consist of read-only statistics about the
524 dataset.
525 These properties can be neither set, nor inherited.
526 Native properties apply to all dataset types unless otherwise noted.
527 .Bl -tag -width "usedbyrefreservation"
528 .It Sy available
529 The amount of space available to the dataset and all its children, assuming that
530 there is no other activity in the pool.
531 Because space is shared within a pool, availability can be limited by any number
532 of factors, including physical pool size, quotas, reservations, or other
533 datasets within the pool.
535 This property can also be referred to by its shortened column name,
536 .Sy avail .
537 .It Sy compressratio
538 For non-snapshots, the compression ratio achieved for the
539 .Sy used
540 space of this dataset, expressed as a multiplier.
542 .Sy used
543 property includes descendant datasets, and, for clones, does not include the
544 space shared with the origin snapshot.
545 For snapshots, the
546 .Sy compressratio
547 is the same as the
548 .Sy refcompressratio
549 property.
550 Compression can be turned on by running:
551 .Nm zfs Cm set Sy compression Ns = Ns Sy on Ar dataset .
552 The default value is
553 .Sy off .
554 .It Sy createtxg
555 The transaction group (txg) in which the dataset was created.
556 Bookmarks have the same
557 .Sy createtxg
558 as the snapshot they are initially tied to.
559 This property is suitable for ordering a list of snapshots,
560 e.g. for incremental send and receive.
561 .It Sy creation
562 The time this dataset was created.
563 .It Sy clones
564 For snapshots, this property is a comma-separated list of filesystems or volumes
565 which are clones of this snapshot.
566 The clones'
567 .Sy origin
568 property is this snapshot.
569 If the
570 .Sy clones
571 property is not empty, then this snapshot can not be destroyed
572 .Po even with the
573 .Fl r
575 .Fl f
576 options
577 .Pc .
578 .It Sy defer_destroy
579 This property is
580 .Sy on
581 if the snapshot has been marked for deferred destroy by using the
582 .Nm zfs Cm destroy Fl d
583 command.
584 Otherwise, the property is
585 .Sy off .
586 .It Sy filesystem_count
587 The total number of filesystems and volumes that exist under this location in
588 the dataset tree.
589 This value is only available when a
590 .Sy filesystem_limit
591 has been set somewhere in the tree under which the dataset resides.
592 .It Sy guid
593 The 64 bit GUID of this dataset or bookmark which does not change over its
594 entire lifetime.
595 When a snapshot is sent to another pool, the received snapshot has the same
596 GUID.
597 Thus, the
598 .Sy guid
599 is suitable to identify a snapshot across pools.
600 .It Sy logicalreferenced
601 The amount of space that is
602 .Qq logically
603 accessible by this dataset.
604 See the
605 .Sy referenced
606 property.
607 The logical space ignores the effect of the
608 .Sy compression
610 .Sy copies
611 properties, giving a quantity closer to the amount of data that applications
612 see.
613 However, it does include space consumed by metadata.
615 This property can also be referred to by its shortened column name,
616 .Sy lrefer .
617 .It Sy logicalused
618 The amount of space that is
619 .Qq logically
620 consumed by this dataset and all its descendents.
621 See the
622 .Sy used
623 property.
624 The logical space ignores the effect of the
625 .Sy compression
627 .Sy copies
628 properties, giving a quantity closer to the amount of data that applications
629 see.
630 However, it does include space consumed by metadata.
632 This property can also be referred to by its shortened column name,
633 .Sy lused .
634 .It Sy mounted
635 For file systems, indicates whether the file system is currently mounted.
636 This property can be either
637 .Sy yes
639 .Sy no .
640 .It Sy origin
641 For cloned file systems or volumes, the snapshot from which the clone was
642 created.
643 See also the
644 .Sy clones
645 property.
646 .It Sy receive_resume_token
647 For filesystems or volumes which have saved partially-completed state from
648 .Sy zfs receive -s ,
649 this opaque token can be provided to
650 .Sy zfs send -t
651 to resume and complete the
652 .Sy zfs receive .
653 .It Sy referenced
654 The amount of data that is accessible by this dataset, which may or may not be
655 shared with other datasets in the pool.
656 When a snapshot or clone is created, it initially references the same amount of
657 space as the file system or snapshot it was created from, since its contents are
658 identical.
660 This property can also be referred to by its shortened column name,
661 .Sy refer .
662 .It Sy refcompressratio
663 The compression ratio achieved for the
664 .Sy referenced
665 space of this dataset, expressed as a multiplier.
666 See also the
667 .Sy compressratio
668 property.
669 .It Sy snapshot_count
670 The total number of snapshots that exist under this location in the dataset
671 tree.
672 This value is only available when a
673 .Sy snapshot_limit
674 has been set somewhere in the tree under which the dataset resides.
675 .It Sy type
676 The type of dataset:
677 .Sy filesystem ,
678 .Sy volume ,
680 .Sy snapshot .
681 .It Sy used
682 The amount of space consumed by this dataset and all its descendents.
683 This is the value that is checked against this dataset's quota and reservation.
684 The space used does not include this dataset's reservation, but does take into
685 account the reservations of any descendent datasets.
686 The amount of space that a dataset consumes from its parent, as well as the
687 amount of space that is freed if this dataset is recursively destroyed, is the
688 greater of its space used and its reservation.
690 The used space of a snapshot
691 .Po see the
692 .Sx Snapshots
693 section
695 is space that is referenced exclusively by this snapshot.
696 If this snapshot is destroyed, the amount of
697 .Sy used
698 space will be freed.
699 Space that is shared by multiple snapshots isn't accounted for in this metric.
700 When a snapshot is destroyed, space that was previously shared with this
701 snapshot can become unique to snapshots adjacent to it, thus changing the used
702 space of those snapshots.
703 The used space of the latest snapshot can also be affected by changes in the
704 file system.
705 Note that the
706 .Sy used
707 space of a snapshot is a subset of the
708 .Sy written
709 space of the snapshot.
711 The amount of space used, available, or referenced does not take into account
712 pending changes.
713 Pending changes are generally accounted for within a few seconds.
714 Committing a change to a disk using
715 .Xr fsync 3C
717 .Dv O_SYNC
718 does not necessarily guarantee that the space usage information is updated
719 immediately.
720 .It Sy usedby*
722 .Sy usedby*
723 properties decompose the
724 .Sy used
725 properties into the various reasons that space is used.
726 Specifically,
727 .Sy used No =
728 .Sy usedbychildren No +
729 .Sy usedbydataset No +
730 .Sy usedbyrefreservation No +
731 .Sy usedbysnapshots .
732 These properties are only available for datasets created on
733 .Nm zpool
734 .Qo version 13 Qc
735 pools.
736 .It Sy usedbychildren
737 The amount of space used by children of this dataset, which would be freed if
738 all the dataset's children were destroyed.
739 .It Sy usedbydataset
740 The amount of space used by this dataset itself, which would be freed if the
741 dataset were destroyed
742 .Po after first removing any
743 .Sy refreservation
744 and destroying any necessary snapshots or descendents
745 .Pc .
746 .It Sy usedbyrefreservation
747 The amount of space used by a
748 .Sy refreservation
749 set on this dataset, which would be freed if the
750 .Sy refreservation
751 was removed.
752 .It Sy usedbysnapshots
753 The amount of space consumed by snapshots of this dataset.
754 In particular, it is the amount of space that would be freed if all of this
755 dataset's snapshots were destroyed.
756 Note that this is not simply the sum of the snapshots'
757 .Sy used
758 properties because space can be shared by multiple snapshots.
759 .It Sy userused Ns @ Ns Em user
760 The amount of space consumed by the specified user in this dataset.
761 Space is charged to the owner of each file, as displayed by
762 .Nm ls Fl l .
763 The amount of space charged is displayed by
764 .Nm du
766 .Nm ls Fl s .
767 See the
768 .Nm zfs Cm userspace
769 subcommand for more information.
771 Unprivileged users can access only their own space usage.
772 The root user, or a user who has been granted the
773 .Sy userused
774 privilege with
775 .Nm zfs Cm allow ,
776 can access everyone's usage.
779 .Sy userused Ns @ Ns Em ...
780 properties are not displayed by
781 .Nm zfs Cm get Sy all .
782 The user's name must be appended after the @ symbol, using one of the following
783 forms:
784 .Bl -bullet -width ""
786 .Em POSIX name
787 .Po for example,
788 .Sy joe
791 .Em POSIX numeric ID
792 .Po for example,
793 .Sy 789
796 .Em SID name
797 .Po for example,
798 .Sy joe.smith@mydomain
801 .Em SID numeric ID
802 .Po for example,
803 .Sy S-1-123-456-789
806 .It Sy userrefs
807 This property is set to the number of user holds on this snapshot.
808 User holds are set by using the
809 .Nm zfs Cm hold
810 command.
811 .It Sy groupused Ns @ Ns Em group
812 The amount of space consumed by the specified group in this dataset.
813 Space is charged to the group of each file, as displayed by
814 .Nm ls Fl l .
815 See the
816 .Sy userused Ns @ Ns Em user
817 property for more information.
819 Unprivileged users can only access their own groups' space usage.
820 The root user, or a user who has been granted the
821 .Sy groupused
822 privilege with
823 .Nm zfs Cm allow ,
824 can access all groups' usage.
825 .It Sy volblocksize
826 For volumes, specifies the block size of the volume.
828 .Sy blocksize
829 cannot be changed once the volume has been written, so it should be set at
830 volume creation time.
831 The default
832 .Sy blocksize
833 for volumes is 8 Kbytes.
834 Any power of 2 from 512 bytes to 128 Kbytes is valid.
836 This property can also be referred to by its shortened column name,
837 .Sy volblock .
838 .It Sy written
839 The amount of space
840 .Sy referenced
841 by this dataset, that was written since the previous snapshot
842 .Pq i.e. that is not referenced by the previous snapshot .
843 .It Sy written Ns @ Ns Em snapshot
844 The amount of
845 .Sy referenced
846 space written to this dataset since the specified snapshot.
847 This is the space that is referenced by this dataset but was not referenced by
848 the specified snapshot.
851 .Em snapshot
852 may be specified as a short snapshot name
853 .Po just the part after the
854 .Sy @
855 .Pc ,
856 in which case it will be interpreted as a snapshot in the same filesystem as
857 this dataset.
859 .Em snapshot
860 may be a full snapshot name
861 .Po Em filesystem Ns @ Ns Em snapshot Pc ,
862 which for clones may be a snapshot in the origin's filesystem
863 .Pq or the origin of the origin's filesystem, etc.
866 The following native properties can be used to change the behavior of a ZFS
867 dataset.
868 .Bl -tag -width ""
869 .It Xo
870 .Sy aclinherit Ns = Ns Sy discard Ns | Ns Sy noallow Ns | Ns
871 .Sy restricted Ns | Ns Sy passthrough Ns | Ns Sy passthrough-x
873 Controls how ACEs are inherited when files and directories are created.
874 .Bl -tag -width "passthrough-x"
875 .It Sy discard
876 does not inherit any ACEs.
877 .It Sy noallow
878 only inherits inheritable ACEs that specify
879 .Qq deny
880 permissions.
881 .It Sy restricted
882 default, removes the
883 .Sy write_acl
885 .Sy write_owner
886 permissions when the ACE is inherited.
887 .It Sy passthrough
888 inherits all inheritable ACEs without any modifications.
889 .It Sy passthrough-x
890 same meaning as
891 .Sy passthrough ,
892 except that the
893 .Sy owner@ ,
894 .Sy group@ ,
896 .Sy everyone@
897 ACEs inherit the execute permission only if the file creation mode also requests
898 the execute bit.
901 When the property value is set to
902 .Sy passthrough ,
903 files are created with a mode determined by the inheritable ACEs.
904 If no inheritable ACEs exist that affect the mode, then the mode is set in
905 accordance to the requested mode from the application.
906 .It Xo
907 .Sy aclmode Ns = Ns Sy discard Ns | Ns Sy groupmask Ns | Ns
908 .Sy passthrough Ns | Ns Sy restricted
910 Controls how an ACL is modified during
911 .Xr chmod 2
912 and how inherited ACEs are modified by the file creation mode.
913 .Bl -tag -width "passthrough"
914 .It Sy discard
915 default, deletes all ACEs except for those representing the mode of the file or
916 directory requested by
917 .Xr chmod 2 .
918 .It Sy groupmask
919 reduces permissions granted by all
920 .Sy ALLOW
921 entries found in the ACL such that they are no greater than the group
922 permissions specified by the mode.
923 .It Sy passthrough
924 indicates that no changes are made to the ACL other than creating or updating
925 the necessary ACEs to represent the new mode of the file or directory.
926 .It Sy restricted
927 causes the
928 .Xr chmod 2
929 operation to return an error when used on any file or directory which has a
930 non-trivial ACL, with entries in addition to those that represent the mode.
933 .Xr chmod 2
934 is required to change the set user ID, set group ID, or sticky bit on a file or
935 directory, as they do not have equivalent ACEs.
936 In order to use
937 .Xr chmod 2
938 on a file or directory with a non-trivial ACL when
939 .Sy aclmode
940 is set to
941 .Sy restricted ,
942 you must first remove all ACEs except for those that represent the current mode.
943 .It Sy atime Ns = Ns Sy on Ns | Ns Sy off
944 Controls whether the access time for files is updated when they are read.
945 Turning this property off avoids producing write traffic when reading files and
946 can result in significant performance gains, though it might confuse mailers
947 and other similar utilities.
948 The default value is
949 .Sy on .
950 .It Sy canmount Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy noauto
951 If this property is set to
952 .Sy off ,
953 the file system cannot be mounted, and is ignored by
954 .Nm zfs Cm mount Fl a .
955 Setting this property to
956 .Sy off
957 is similar to setting the
958 .Sy mountpoint
959 property to
960 .Sy none ,
961 except that the dataset still has a normal
962 .Sy mountpoint
963 property, which can be inherited.
964 Setting this property to
965 .Sy off
966 allows datasets to be used solely as a mechanism to inherit properties.
967 One example of setting
968 .Sy canmount Ns = Ns Sy off
969 is to have two datasets with the same
970 .Sy mountpoint ,
971 so that the children of both datasets appear in the same directory, but might
972 have different inherited characteristics.
974 When set to
975 .Sy noauto ,
976 a dataset can only be mounted and unmounted explicitly.
977 The dataset is not mounted automatically when the dataset is created or
978 imported, nor is it mounted by the
979 .Nm zfs Cm mount Fl a
980 command or unmounted by the
981 .Nm zfs Cm unmount Fl a
982 command.
984 This property is not inherited.
985 .It Xo
986 .Sy checksum Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy fletcher2 Ns | Ns
987 .Sy fletcher4 Ns | Ns Sy sha256 Ns | Ns Sy noparity Ns | Ns
988 .Sy sha512 Ns | Ns Sy skein Ns | Ns Sy edonr
990 Controls the checksum used to verify data integrity.
991 The default value is
992 .Sy on ,
993 which automatically selects an appropriate algorithm
994 .Po currently,
995 .Sy fletcher4 ,
996 but this may change in future releases
997 .Pc .
998 The value
999 .Sy off
1000 disables integrity checking on user data.
1001 The value
1002 .Sy noparity
1003 not only disables integrity but also disables maintaining parity for user data.
1004 This setting is used internally by a dump device residing on a RAID-Z pool and
1005 should not be used by any other dataset.
1006 Disabling checksums is
1007 .Sy NOT
1008 a recommended practice.
1011 .Sy sha512 ,
1012 .Sy skein ,
1014 .Sy edonr
1015 checksum algorithms require enabling the appropriate features on the pool.
1016 Please see
1017 .Xr zpool-features 5
1018 for more information on these algorithms.
1020 Changing this property affects only newly-written data.
1022 Salted checksum algorithms
1023 .Pq Cm edonr , skein
1024 are currently not supported for any filesystem on the boot pools.
1025 .It Xo
1026 .Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns
1027 .Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle
1029 Controls the compression algorithm used for this dataset.
1031 Setting compression to
1032 .Sy on
1033 indicates that the current default compression algorithm should be used.
1034 The default balances compression and decompression speed, with compression ratio
1035 and is expected to work well on a wide variety of workloads.
1036 Unlike all other settings for this property,
1037 .Sy on
1038 does not select a fixed compression type.
1039 As new compression algorithms are added to ZFS and enabled on a pool, the
1040 default compression algorithm may change.
1041 The current default compression algorithm is either
1042 .Sy lzjb
1043 or, if the
1044 .Sy lz4_compress
1045 feature is enabled,
1046 .Sy lz4 .
1049 .Sy lz4
1050 compression algorithm is a high-performance replacement for the
1051 .Sy lzjb
1052 algorithm.
1053 It features significantly faster compression and decompression, as well as a
1054 moderately higher compression ratio than
1055 .Sy lzjb ,
1056 but can only be used on pools with the
1057 .Sy lz4_compress
1058 feature set to
1059 .Sy enabled .
1061 .Xr zpool-features 5
1062 for details on ZFS feature flags and the
1063 .Sy lz4_compress
1064 feature.
1067 .Sy lzjb
1068 compression algorithm is optimized for performance while providing decent data
1069 compression.
1072 .Sy gzip
1073 compression algorithm uses the same compression as the
1074 .Xr gzip 1
1075 command.
1076 You can specify the
1077 .Sy gzip
1078 level by using the value
1079 .Sy gzip- Ns Em N ,
1080 where
1081 .Em N
1082 is an integer from 1
1083 .Pq fastest
1084 to 9
1085 .Pq best compression ratio .
1086 Currently,
1087 .Sy gzip
1088 is equivalent to
1089 .Sy gzip-6
1090 .Po which is also the default for
1091 .Xr gzip 1
1092 .Pc .
1095 .Sy zle
1096 compression algorithm compresses runs of zeros.
1098 This property can also be referred to by its shortened column name
1099 .Sy compress .
1100 Changing this property affects only newly-written data.
1101 .It Sy copies Ns = Ns Sy 1 Ns | Ns Sy 2 Ns | Ns Sy 3
1102 Controls the number of copies of data stored for this dataset.
1103 These copies are in addition to any redundancy provided by the pool, for
1104 example, mirroring or RAID-Z.
1105 The copies are stored on different disks, if possible.
1106 The space used by multiple copies is charged to the associated file and dataset,
1107 changing the
1108 .Sy used
1109 property and counting against quotas and reservations.
1111 Changing this property only affects newly-written data.
1112 Therefore, set this property at file system creation time by using the
1113 .Fl o Sy copies Ns = Ns Ar N
1114 option.
1115 .It Sy devices Ns = Ns Sy on Ns | Ns Sy off
1116 Controls whether device nodes can be opened on this file system.
1117 The default value is
1118 .Sy on .
1119 .It Sy exec Ns = Ns Sy on Ns | Ns Sy off
1120 Controls whether processes can be executed from within this file system.
1121 The default value is
1122 .Sy on .
1123 .It Sy filesystem_limit Ns = Ns Em count Ns | Ns Sy none
1124 Limits the number of filesystems and volumes that can exist under this point in
1125 the dataset tree.
1126 The limit is not enforced if the user is allowed to change the limit.
1127 Setting a
1128 .Sy filesystem_limit
1130 .Sy on
1131 a descendent of a filesystem that already has a
1132 .Sy filesystem_limit
1133 does not override the ancestor's
1134 .Sy filesystem_limit ,
1135 but rather imposes an additional limit.
1136 This feature must be enabled to be used
1137 .Po see
1138 .Xr zpool-features 5
1139 .Pc .
1140 .It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
1141 Controls the mount point used for this file system.
1142 See the
1143 .Sx Mount Points
1144 section for more information on how this property is used.
1146 When the
1147 .Sy mountpoint
1148 property is changed for a file system, the file system and any children that
1149 inherit the mount point are unmounted.
1150 If the new value is
1151 .Sy legacy ,
1152 then they remain unmounted.
1153 Otherwise, they are automatically remounted in the new location if the property
1154 was previously
1155 .Sy legacy
1157 .Sy none ,
1158 or if they were mounted before the property was changed.
1159 In addition, any shared file systems are unshared and shared in the new
1160 location.
1161 .It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
1162 Controls whether the file system should be mounted with
1163 .Sy nbmand
1164 .Pq Non Blocking mandatory locks .
1165 This is used for SMB clients.
1166 Changes to this property only take effect when the file system is umounted and
1167 remounted.
1169 .Xr mount 8
1170 for more information on
1171 .Sy nbmand
1172 mounts.
1173 .It Sy primarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1174 Controls what is cached in the primary cache
1175 .Pq ARC .
1176 If this property is set to
1177 .Sy all ,
1178 then both user data and metadata is cached.
1179 If this property is set to
1180 .Sy none ,
1181 then neither user data nor metadata is cached.
1182 If this property is set to
1183 .Sy metadata ,
1184 then only metadata is cached.
1185 The default value is
1186 .Sy all .
1187 .It Sy quota Ns = Ns Em size Ns | Ns Sy none
1188 Limits the amount of space a dataset and its descendents can consume.
1189 This property enforces a hard limit on the amount of space used.
1190 This includes all space consumed by descendents, including file systems and
1191 snapshots.
1192 Setting a quota on a descendent of a dataset that already has a quota does not
1193 override the ancestor's quota, but rather imposes an additional limit.
1195 Quotas cannot be set on volumes, as the
1196 .Sy volsize
1197 property acts as an implicit quota.
1198 .It Sy snapshot_limit Ns = Ns Em count Ns | Ns Sy none
1199 Limits the number of snapshots that can be created on a dataset and its
1200 descendents.
1201 Setting a
1202 .Sy snapshot_limit
1203 on a descendent of a dataset that already has a
1204 .Sy snapshot_limit
1205 does not override the ancestor's
1206 .Sy snapshot_limit ,
1207 but rather imposes an additional limit.
1208 The limit is not enforced if the user is allowed to change the limit.
1209 For example, this means that recursive snapshots taken from the global zone are
1210 counted against each delegated dataset within a zone.
1211 This feature must be enabled to be used
1212 .Po see
1213 .Xr zpool-features 5
1214 .Pc .
1215 .It Sy userquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1216 Limits the amount of space consumed by the specified user.
1217 User space consumption is identified by the
1218 .Sy userspace@ Ns Em user
1219 property.
1221 Enforcement of user quotas may be delayed by several seconds.
1222 This delay means that a user might exceed their quota before the system notices
1223 that they are over quota and begins to refuse additional writes with the
1224 .Er EDQUOT
1225 error message.
1226 See the
1227 .Nm zfs Cm userspace
1228 subcommand for more information.
1230 Unprivileged users can only access their own groups' space usage.
1231 The root user, or a user who has been granted the
1232 .Sy userquota
1233 privilege with
1234 .Nm zfs Cm allow ,
1235 can get and set everyone's quota.
1237 This property is not available on volumes, on file systems before version 4, or
1238 on pools before version 15.
1240 .Sy userquota@ Ns Em ...
1241 properties are not displayed by
1242 .Nm zfs Cm get Sy all .
1243 The user's name must be appended after the
1244 .Sy @
1245 symbol, using one of the following forms:
1246 .Bl -bullet
1248 .Em POSIX name
1249 .Po for example,
1250 .Sy joe
1253 .Em POSIX numeric ID
1254 .Po for example,
1255 .Sy 789
1258 .Em SID name
1259 .Po for example,
1260 .Sy joe.smith@mydomain
1263 .Em SID numeric ID
1264 .Po for example,
1265 .Sy S-1-123-456-789
1268 .It Sy groupquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1269 Limits the amount of space consumed by the specified group.
1270 Group space consumption is identified by the
1271 .Sy groupused@ Ns Em group
1272 property.
1274 Unprivileged users can access only their own groups' space usage.
1275 The root user, or a user who has been granted the
1276 .Sy groupquota
1277 privilege with
1278 .Nm zfs Cm allow ,
1279 can get and set all groups' quotas.
1280 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
1281 Controls whether this dataset can be modified.
1282 The default value is
1283 .Sy off .
1285 This property can also be referred to by its shortened column name,
1286 .Sy rdonly .
1287 .It Sy recordsize Ns = Ns Em size
1288 Specifies a suggested block size for files in the file system.
1289 This property is designed solely for use with database workloads that access
1290 files in fixed-size records.
1291 ZFS automatically tunes block sizes according to internal algorithms optimized
1292 for typical access patterns.
1294 For databases that create very large files but access them in small random
1295 chunks, these algorithms may be suboptimal.
1296 Specifying a
1297 .Sy recordsize
1298 greater than or equal to the record size of the database can result in
1299 significant performance gains.
1300 Use of this property for general purpose file systems is strongly discouraged,
1301 and may adversely affect performance.
1303 The size specified must be a power of two greater than or equal to 512 and less
1304 than or equal to 128 Kbytes.
1305 If the
1306 .Sy large_blocks
1307 feature is enabled on the pool, the size may be up to 1 Mbyte.
1309 .Xr zpool-features 5
1310 for details on ZFS feature flags.
1312 Changing the file system's
1313 .Sy recordsize
1314 affects only files created afterward; existing files are unaffected.
1316 This property can also be referred to by its shortened column name,
1317 .Sy recsize .
1318 .It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1319 Controls what types of metadata are stored redundantly.
1320 ZFS stores an extra copy of metadata, so that if a single block is corrupted,
1321 the amount of user data lost is limited.
1322 This extra copy is in addition to any redundancy provided at the pool level
1323 .Pq e.g. by mirroring or RAID-Z ,
1324 and is in addition to an extra copy specified by the
1325 .Sy copies
1326 property
1327 .Pq up to a total of 3 copies .
1328 For example if the pool is mirrored,
1329 .Sy copies Ns = Ns 2 ,
1331 .Sy redundant_metadata Ns = Ns Sy most ,
1332 then ZFS stores 6 copies of most metadata, and 4 copies of data and some
1333 metadata.
1335 When set to
1336 .Sy all ,
1337 ZFS stores an extra copy of all metadata.
1338 If a single on-disk block is corrupt, at worst a single block of user data
1339 .Po which is
1340 .Sy recordsize
1341 bytes long
1343 can be lost.
1345 When set to
1346 .Sy most ,
1347 ZFS stores an extra copy of most types of metadata.
1348 This can improve performance of random writes, because less metadata must be
1349 written.
1350 In practice, at worst about 100 blocks
1351 .Po of
1352 .Sy recordsize
1353 bytes each
1355 of user data can be lost if a single on-disk block is corrupt.
1356 The exact behavior of which metadata blocks are stored redundantly may change in
1357 future releases.
1359 The default value is
1360 .Sy all .
1361 .It Sy refquota Ns = Ns Em size Ns | Ns Sy none
1362 Limits the amount of space a dataset can consume.
1363 This property enforces a hard limit on the amount of space used.
1364 This hard limit does not include space used by descendents, including file
1365 systems and snapshots.
1366 .It Sy refreservation Ns = Ns Em size Ns | Ns Sy none Ns | Ns Sy auto
1367 The minimum amount of space guaranteed to a dataset, not including its
1368 descendents.
1369 When the amount of space used is below this value, the dataset is treated as if
1370 it were taking up the amount of space specified by
1371 .Sy refreservation .
1373 .Sy refreservation
1374 reservation is accounted for in the parent datasets' space used, and counts
1375 against the parent datasets' quotas and reservations.
1378 .Sy refreservation
1379 is set, a snapshot is only allowed if there is enough free pool space outside of
1380 this reservation to accommodate the current number of
1381 .Qq referenced
1382 bytes in the dataset.
1385 .Sy refreservation
1386 is set to
1387 .Sy auto ,
1388 a volume is thick provisioned
1389 .Po or
1390 .Qq not sparse
1391 .Pc .
1392 .Sy refreservation Ns = Ns Sy auto
1393 is only supported on volumes.
1395 .Sy volsize
1396 in the
1397 .Sx Native Properties
1398 section for more information about sparse volumes.
1400 This property can also be referred to by its shortened column name,
1401 .Sy refreserv .
1402 .It Sy reservation Ns = Ns Em size Ns | Ns Sy none
1403 The minimum amount of space guaranteed to a dataset and its descendants.
1404 When the amount of space used is below this value, the dataset is treated as if
1405 it were taking up the amount of space specified by its reservation.
1406 Reservations are accounted for in the parent datasets' space used, and count
1407 against the parent datasets' quotas and reservations.
1409 This property can also be referred to by its shortened column name,
1410 .Sy reserv .
1411 .It Sy secondarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1412 Controls what is cached in the secondary cache
1413 .Pq L2ARC .
1414 If this property is set to
1415 .Sy all ,
1416 then both user data and metadata is cached.
1417 If this property is set to
1418 .Sy none ,
1419 then neither user data nor metadata is cached.
1420 If this property is set to
1421 .Sy metadata ,
1422 then only metadata is cached.
1423 The default value is
1424 .Sy all .
1425 .It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
1426 Controls whether the setuid bit is respected for the file system.
1427 The default value is
1428 .Sy on .
1429 .It Sy sharesmb Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1430 Controls whether the file system is shared via SMB, and what options are to be
1431 used.
1432 A file system with the
1433 .Sy sharesmb
1434 property set to
1435 .Sy off
1436 is managed through traditional tools such as
1437 .Xr sharemgr 8 .
1438 Otherwise, the file system is automatically shared and unshared with the
1439 .Nm zfs Cm share
1441 .Nm zfs Cm unshare
1442 commands.
1443 If the property is set to
1444 .Sy on ,
1446 .Xr sharemgr 8
1447 command is invoked with no options.
1448 Otherwise, the
1449 .Xr sharemgr 8
1450 command is invoked with options equivalent to the contents of this property.
1452 Because SMB shares requires a resource name, a unique resource name is
1453 constructed from the dataset name.
1454 The constructed name is a copy of the dataset name except that the characters in
1455 the dataset name, which would be invalid in the resource name, are replaced with
1456 underscore
1457 .Pq Sy _
1458 characters.
1459 A pseudo property
1460 .Qq name
1461 is also supported that allows you to replace the data set name with a specified
1462 name.
1463 The specified name is then used to replace the prefix dataset in the case of
1464 inheritance.
1465 For example, if the dataset
1466 .Em data/home/john
1467 is set to
1468 .Sy name Ns = Ns Sy john ,
1469 then
1470 .Em data/home/john
1471 has a resource name of
1472 .Sy john .
1473 If a child dataset
1474 .Em data/home/john/backups
1475 is shared, it has a resource name of
1476 .Sy john_backups .
1478 When SMB shares are created, the SMB share name appears as an entry in the
1479 .Pa .zfs/shares
1480 directory.
1481 You can use the
1482 .Nm ls
1484 .Nm chmod
1485 command to display the share-level ACLs on the entries in this directory.
1487 When the
1488 .Sy sharesmb
1489 property is changed for a dataset, the dataset and any children inheriting the
1490 property are re-shared with the new options, only if the property was previously
1491 set to
1492 .Sy off ,
1493 or if they were shared before the property was changed.
1494 If the new property is set to
1495 .Sy off ,
1496 the file systems are unshared.
1497 .It Sy sharenfs Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1498 Controls whether the file system is shared via NFS, and what options are to be
1499 used.
1500 A file system with a
1501 .Sy sharenfs
1502 property of
1503 .Sy off
1504 is managed through traditional tools such as
1505 .Xr share 8 ,
1506 .Xr unshare 8 ,
1508 .Xr dfstab 4 .
1509 Otherwise, the file system is automatically shared and unshared with the
1510 .Nm zfs Cm share
1512 .Nm zfs Cm unshare
1513 commands.
1514 If the property is set to
1515 .Sy on ,
1516 .Xr share 8
1517 command is invoked with no options.
1518 Otherwise, the
1519 .Xr share 8
1520 command is invoked with options equivalent to the contents of this property.
1522 When the
1523 .Sy sharenfs
1524 property is changed for a dataset, the dataset and any children inheriting the
1525 property are re-shared with the new options, only if the property was previously
1526 .Sy off ,
1527 or if they were shared before the property was changed.
1528 If the new property is
1529 .Sy off ,
1530 the file systems are unshared.
1531 .It Sy logbias Ns = Ns Sy latency Ns | Ns Sy throughput
1532 Provide a hint to ZFS about handling of synchronous requests in this dataset.
1534 .Sy logbias
1535 is set to
1536 .Sy latency
1537 .Pq the default ,
1538 ZFS will use pool log devices
1539 .Pq if configured
1540 to handle the requests at low latency.
1542 .Sy logbias
1543 is set to
1544 .Sy throughput ,
1545 ZFS will not use configured pool log devices.
1546 ZFS will instead optimize synchronous operations for global pool throughput and
1547 efficient use of resources.
1548 .It Sy snapdir Ns = Ns Sy hidden Ns | Ns Sy visible
1549 Controls whether the
1550 .Pa .zfs
1551 directory is hidden or visible in the root of the file system as discussed in
1553 .Sx Snapshots
1554 section.
1555 The default value is
1556 .Sy hidden .
1557 .It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled
1558 Controls the behavior of synchronous requests
1559 .Pq e.g. fsync, O_DSYNC .
1560 .Sy standard
1561 is the
1562 .Tn POSIX
1563 specified behavior of ensuring all synchronous requests are written to stable
1564 storage and all devices are flushed to ensure data is not cached by device
1565 controllers
1566 .Pq this is the default .
1567 .Sy always
1568 causes every file system transaction to be written and flushed before its
1569 system call returns.
1570 This has a large performance penalty.
1571 .Sy disabled
1572 disables synchronous requests.
1573 File system transactions are only committed to stable storage periodically.
1574 This option will give the highest performance.
1575 However, it is very dangerous as ZFS would be ignoring the synchronous
1576 transaction demands of applications such as databases or NFS.
1577 Administrators should only use this option when the risks are understood.
1578 .It Sy version Ns = Ns Em N Ns | Ns Sy current
1579 The on-disk version of this file system, which is independent of the pool
1580 version.
1581 This property can only be set to later supported versions.
1582 See the
1583 .Nm zfs Cm upgrade
1584 command.
1585 .It Sy volsize Ns = Ns Em size
1586 For volumes, specifies the logical size of the volume.
1587 By default, creating a volume establishes a reservation of equal size.
1588 For storage pools with a version number of 9 or higher, a
1589 .Sy refreservation
1590 is set instead.
1591 Any changes to
1592 .Sy volsize
1593 are reflected in an equivalent change to the reservation
1594 .Po or
1595 .Sy refreservation
1596 .Pc .
1598 .Sy volsize
1599 can only be set to a multiple of
1600 .Sy volblocksize ,
1601 and cannot be zero.
1603 The reservation is kept equal to the volume's logical size to prevent unexpected
1604 behavior for consumers.
1605 Without the reservation, the volume could run out of space, resulting in
1606 undefined behavior or data corruption, depending on how the volume is used.
1607 These effects can also occur when the volume size is changed while it is in use
1608 .Pq particularly when shrinking the size .
1609 Extreme care should be used when adjusting the volume size.
1611 Though not recommended, a
1612 .Qq sparse volume
1613 .Po also known as
1614 .Qq thin provisioned
1616 can be created by specifying the
1617 .Fl s
1618 option to the
1619 .Nm zfs Cm create Fl V
1620 command, or by changing the value of the
1621 .Sy refreservation
1622 property
1623 .Po or
1624 .Sy reservation
1625 property on pool version 8 or earlier
1627 after the volume has been created.
1629 .Qq sparse volume
1630 is a volume where the value of
1631 .Sy refreservation
1632 is less than the size of the volume plus the space required to store its
1633 metadata.
1634 Consequently, writes to a sparse volume can fail with
1635 .Er ENOSPC
1636 when the pool is low on space.
1637 For a sparse volume, changes to
1638 .Sy volsize
1639 are not reflected in the
1640 .Sy refreservation.
1641 A volume that is not sparse is said to be
1642 .Qq thick provisioned .
1643 A sparse volume can become thick provisioned by setting
1644 .Sy refreservation
1646 .Sy auto .
1647 .It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
1648 Controls whether regular files should be scanned for viruses when a file is
1649 opened and closed.
1650 In addition to enabling this property, the virus scan service must also be
1651 enabled for virus scanning to occur.
1652 The default value is
1653 .Sy off .
1654 .It Sy xattr Ns = Ns Sy on Ns | Ns Sy off
1655 Controls whether extended attributes are enabled for this file system.
1656 The default value is
1657 .Sy on .
1658 .It Sy zoned Ns = Ns Sy on Ns | Ns Sy off
1659 Controls whether the dataset is managed from a non-global zone.
1660 See the
1661 .Sx Zones
1662 section for more information.
1663 The default value is
1664 .Sy off .
1667 The following three properties cannot be changed after the file system is
1668 created, and therefore, should be set when the file system is created.
1669 If the properties are not set with the
1670 .Nm zfs Cm create
1672 .Nm zpool Cm create
1673 commands, these properties are inherited from the parent dataset.
1674 If the parent dataset lacks these properties due to having been created prior to
1675 these features being supported, the new file system will have the default values
1676 for these properties.
1677 .Bl -tag -width ""
1678 .It Xo
1679 .Sy casesensitivity Ns = Ns Sy sensitive Ns | Ns
1680 .Sy insensitive Ns | Ns Sy mixed
1682 Indicates whether the file name matching algorithm used by the file system
1683 should be case-sensitive, case-insensitive, or allow a combination of both
1684 styles of matching.
1685 The default value for the
1686 .Sy casesensitivity
1687 property is
1688 .Sy sensitive .
1689 Traditionally,
1692 .Tn POSIX
1693 file systems have case-sensitive file names.
1696 .Sy mixed
1697 value for the
1698 .Sy casesensitivity
1699 property indicates that the file system can support requests for both
1700 case-sensitive and case-insensitive matching behavior.
1701 Currently, case-insensitive matching behavior on a file system that supports
1702 mixed behavior is limited to the SMB server product.
1703 For more information about the
1704 .Sy mixed
1705 value behavior, see the "ZFS Administration Guide".
1706 .It Xo
1707 .Sy normalization Ns = Ns Sy none Ns | Ns Sy formC Ns | Ns
1708 .Sy formD Ns | Ns Sy formKC Ns | Ns Sy formKD
1710 Indicates whether the file system should perform a
1711 .Sy unicode
1712 normalization of file names whenever two file names are compared, and which
1713 normalization algorithm should be used.
1714 File names are always stored unmodified, names are normalized as part of any
1715 comparison process.
1716 If this property is set to a legal value other than
1717 .Sy none ,
1718 and the
1719 .Sy utf8only
1720 property was left unspecified, the
1721 .Sy utf8only
1722 property is automatically set to
1723 .Sy on .
1724 The default value of the
1725 .Sy normalization
1726 property is
1727 .Sy none .
1728 This property cannot be changed after the file system is created.
1729 .It Sy utf8only Ns = Ns Sy on Ns | Ns Sy off
1730 Indicates whether the file system should reject file names that include
1731 characters that are not present in the
1732 .Sy UTF-8
1733 character code set.
1734 If this property is explicitly set to
1735 .Sy off ,
1736 the normalization property must either not be explicitly set or be set to
1737 .Sy none .
1738 The default value for the
1739 .Sy utf8only
1740 property is
1741 .Sy off .
1742 This property cannot be changed after the file system is created.
1746 .Sy casesensitivity ,
1747 .Sy normalization ,
1749 .Sy utf8only
1750 properties are also new permissions that can be assigned to non-privileged users
1751 by using the ZFS delegated administration feature.
1752 .Ss "Temporary Mount Point Properties"
1753 When a file system is mounted, either through
1754 .Xr mount 8
1755 for legacy mounts or the
1756 .Nm zfs Cm mount
1757 command for normal file systems, its mount options are set according to its
1758 properties.
1759 The correlation between properties and mount options is as follows:
1760 .Bd -literal
1761     PROPERTY                MOUNT OPTION
1762     devices                 devices/nodevices
1763     exec                    exec/noexec
1764     readonly                ro/rw
1765     setuid                  setuid/nosetuid
1766     xattr                   xattr/noxattr
1769 In addition, these options can be set on a per-mount basis using the
1770 .Fl o
1771 option, without affecting the property that is stored on disk.
1772 The values specified on the command line override the values stored in the
1773 dataset.
1775 .Sy nosuid
1776 option is an alias for
1777 .Sy nodevices Ns , Ns Sy nosetuid .
1778 These properties are reported as
1779 .Qq temporary
1780 by the
1781 .Nm zfs Cm get
1782 command.
1783 If the properties are changed while the dataset is mounted, the new setting
1784 overrides any temporary settings.
1785 .Ss "User Properties"
1786 In addition to the standard native properties, ZFS supports arbitrary user
1787 properties.
1788 User properties have no effect on ZFS behavior, but applications or
1789 administrators can use them to annotate datasets
1790 .Pq file systems, volumes, and snapshots .
1792 User property names must contain a colon
1793 .Pq Qq Sy \&:
1794 character to distinguish them from native properties.
1795 They may contain lowercase letters, numbers, and the following punctuation
1796 characters: colon
1797 .Pq Qq Sy \&: ,
1798 dash
1799 .Pq Qq Sy - ,
1800 period
1801 .Pq Qq Sy \&. ,
1802 and underscore
1803 .Pq Qq Sy _ .
1804 The expected convention is that the property name is divided into two portions
1805 such as
1806 .Em module Ns : Ns Em property ,
1807 but this namespace is not enforced by ZFS.
1808 User property names can be at most 256 characters, and cannot begin with a dash
1809 .Pq Qq Sy - .
1811 When making programmatic use of user properties, it is strongly suggested to use
1812 a reversed
1813 .Sy DNS
1814 domain name for the
1815 .Em module
1816 component of property names to reduce the chance that two
1817 independently-developed packages use the same property name for different
1818 purposes.
1820 The values of user properties are arbitrary strings, are always inherited, and
1821 are never validated.
1822 All of the commands that operate on properties
1823 .Po Nm zfs Cm list ,
1824 .Nm zfs Cm get ,
1825 .Nm zfs Cm set ,
1826 and so forth
1828 can be used to manipulate both native properties and user properties.
1829 Use the
1830 .Nm zfs Cm inherit
1831 command to clear a user property.
1832 If the property is not defined in any parent dataset, it is removed entirely.
1833 Property values are limited to 8192 bytes.
1834 .Ss ZFS Volumes as Swap or Dump Devices
1835 During an initial installation a swap device and dump device are created on ZFS
1836 volumes in the ZFS root pool.
1837 By default, the swap area size is based on 1/2 the size of physical memory up to
1838 2 Gbytes.
1839 The size of the dump device depends on the kernel's requirements at installation
1840 time.
1841 Separate ZFS volumes must be used for the swap area and dump devices.
1842 Do not swap to a file on a ZFS file system.
1843 A ZFS swap file configuration is not supported.
1845 If you need to change your swap area or dump device after the system is
1846 installed or upgraded, use the
1847 .Xr swap 8
1849 .Xr dumpadm 8
1850 commands.
1851 .Sh SUBCOMMANDS
1852 All subcommands that modify state are logged persistently to the pool in their
1853 original form.
1854 .Bl -tag -width ""
1855 .It Nm Fl \?
1856 Displays a help message.
1857 .It Xo
1859 .Cm create
1860 .Op Fl p
1861 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1862 .Ar filesystem
1864 Creates a new ZFS file system.
1865 The file system is automatically mounted according to the
1866 .Sy mountpoint
1867 property inherited from the parent.
1868 .Bl -tag -width "-o"
1869 .It Fl o Ar property Ns = Ns Ar value
1870 Sets the specified property as if the command
1871 .Nm zfs Cm set Ar property Ns = Ns Ar value
1872 was invoked at the same time the dataset was created.
1873 Any editable ZFS property can also be set at creation time.
1874 Multiple
1875 .Fl o
1876 options can be specified.
1877 An error results if the same property is specified in multiple
1878 .Fl o
1879 options.
1880 .It Fl p
1881 Creates all the non-existing parent datasets.
1882 Datasets created in this manner are automatically mounted according to the
1883 .Sy mountpoint
1884 property inherited from their parent.
1885 Any property specified on the command line using the
1886 .Fl o
1887 option is ignored.
1888 If the target filesystem already exists, the operation completes successfully.
1890 .It Xo
1892 .Cm create
1893 .Op Fl ps
1894 .Op Fl b Ar blocksize
1895 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
1896 .Fl V Ar size Ar volume
1898 Creates a volume of the given size.
1899 The volume is exported as a block device in
1900 .Pa /dev/zvol/{dsk,rdsk}/path ,
1901 where
1902 .Em path
1903 is the name of the volume in the ZFS namespace.
1904 The size represents the logical size as exported by the device.
1905 By default, a reservation of equal size is created.
1907 .Ar size
1908 is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
1909 has an integral number of blocks regardless of
1910 .Sy blocksize .
1911 .Bl -tag -width "-b"
1912 .It Fl b Ar blocksize
1913 Equivalent to
1914 .Fl o Sy volblocksize Ns = Ns Ar blocksize .
1915 If this option is specified in conjunction with
1916 .Fl o Sy volblocksize ,
1917 the resulting behavior is undefined.
1918 .It Fl o Ar property Ns = Ns Ar value
1919 Sets the specified property as if the
1920 .Nm zfs Cm set Ar property Ns = Ns Ar value
1921 command was invoked at the same time the dataset was created.
1922 Any editable ZFS property can also be set at creation time.
1923 Multiple
1924 .Fl o
1925 options can be specified.
1926 An error results if the same property is specified in multiple
1927 .Fl o
1928 options.
1929 .It Fl p
1930 Creates all the non-existing parent datasets.
1931 Datasets created in this manner are automatically mounted according to the
1932 .Sy mountpoint
1933 property inherited from their parent.
1934 Any property specified on the command line using the
1935 .Fl o
1936 option is ignored.
1937 If the target filesystem already exists, the operation completes successfully.
1938 .It Fl s
1939 Creates a sparse volume with no reservation.
1941 .Sy volsize
1942 in the
1943 .Sx Native Properties
1944 section for more information about sparse volumes.
1946 .It Xo
1948 .Cm destroy
1949 .Op Fl Rfnprv
1950 .Ar filesystem Ns | Ns Ar volume
1952 Destroys the given dataset.
1953 By default, the command unshares any file systems that are currently shared,
1954 unmounts any file systems that are currently mounted, and refuses to destroy a
1955 dataset that has active dependents
1956 .Pq children or clones .
1957 .Bl -tag -width "-R"
1958 .It Fl R
1959 Recursively destroy all dependents, including cloned file systems outside the
1960 target hierarchy.
1961 .It Fl f
1962 Force an unmount of any file systems using the
1963 .Nm unmount Fl f
1964 command.
1965 This option has no effect on non-file systems or unmounted file systems.
1966 .It Fl n
1967 Do a dry-run
1968 .Pq Qq No-op
1969 deletion.
1970 No data will be deleted.
1971 This is useful in conjunction with the
1972 .Fl v
1974 .Fl p
1975 flags to determine what data would be deleted.
1976 .It Fl p
1977 Print machine-parsable verbose information about the deleted data.
1978 .It Fl r
1979 Recursively destroy all children.
1980 .It Fl v
1981 Print verbose information about the deleted data.
1984 Extreme care should be taken when applying either the
1985 .Fl r
1986 or the
1987 .Fl R
1988 options, as they can destroy large portions of a pool and cause unexpected
1989 behavior for mounted file systems in use.
1990 .It Xo
1992 .Cm destroy
1993 .Op Fl Rdnprv
1994 .Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
1995 .Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
1997 The given snapshots are destroyed immediately if and only if the
1998 .Nm zfs Cm destroy
1999 command without the
2000 .Fl d
2001 option would have destroyed it.
2002 Such immediate destruction would occur, for example, if the snapshot had no
2003 clones and the user-initiated reference count were zero.
2005 If a snapshot does not qualify for immediate destruction, it is marked for
2006 deferred deletion.
2007 In this state, it exists as a usable, visible snapshot until both of the
2008 preconditions listed above are met, at which point it is destroyed.
2010 An inclusive range of snapshots may be specified by separating the first and
2011 last snapshots with a percent sign.
2012 The first and/or last snapshots may be left blank, in which case the
2013 filesystem's oldest or newest snapshot will be implied.
2015 Multiple snapshots
2016 .Pq or ranges of snapshots
2017 of the same filesystem or volume may be specified in a comma-separated list of
2018 snapshots.
2019 Only the snapshot's short name
2020 .Po the part after the
2021 .Sy @
2023 should be specified when using a range or comma-separated list to identify
2024 multiple snapshots.
2025 .Bl -tag -width "-R"
2026 .It Fl R
2027 Recursively destroy all clones of these snapshots, including the clones,
2028 snapshots, and children.
2029 If this flag is specified, the
2030 .Fl d
2031 flag will have no effect.
2032 .It Fl d
2033 Defer snapshot deletion.
2034 .It Fl n
2035 Do a dry-run
2036 .Pq Qq No-op
2037 deletion.
2038 No data will be deleted.
2039 This is useful in conjunction with the
2040 .Fl p
2042 .Fl v
2043 flags to determine what data would be deleted.
2044 .It Fl p
2045 Print machine-parsable verbose information about the deleted data.
2046 .It Fl r
2047 Destroy
2048 .Pq or mark for deferred deletion
2049 all snapshots with this name in descendent file systems.
2050 .It Fl v
2051 Print verbose information about the deleted data.
2053 Extreme care should be taken when applying either the
2054 .Fl r
2055 or the
2056 .Fl R
2057 options, as they can destroy large portions of a pool and cause unexpected
2058 behavior for mounted file systems in use.
2060 .It Xo
2062 .Cm destroy
2063 .Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2065 The given bookmark is destroyed.
2066 .It Xo
2068 .Cm snapshot
2069 .Op Fl r
2070 .Oo Fl o Ar property Ns = Ns value Oc Ns ...
2071 .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2073 Creates snapshots with the given names.
2074 All previous modifications by successful system calls to the file system are
2075 part of the snapshots.
2076 Snapshots are taken atomically, so that all snapshots correspond to the same
2077 moment in time.
2078 See the
2079 .Sx Snapshots
2080 section for details.
2081 .Bl -tag -width "-o"
2082 .It Fl o Ar property Ns = Ns Ar value
2083 Sets the specified property; see
2084 .Nm zfs Cm create
2085 for details.
2086 .It Fl r
2087 Recursively create snapshots of all descendent datasets
2089 .It Xo
2091 .Cm rollback
2092 .Op Fl Rfr
2093 .Ar snapshot
2095 Roll back the given dataset to a previous snapshot.
2096 When a dataset is rolled back, all data that has changed since the snapshot is
2097 discarded, and the dataset reverts to the state at the time of the snapshot.
2098 By default, the command refuses to roll back to a snapshot other than the most
2099 recent one.
2100 In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2101 specifying the
2102 .Fl r
2103 option.
2106 .Fl rR
2107 options do not recursively destroy the child snapshots of a recursive snapshot.
2108 Only direct snapshots of the specified filesystem are destroyed by either of
2109 these options.
2110 To completely roll back a recursive snapshot, you must rollback the individual
2111 child snapshots.
2112 .Bl -tag -width "-R"
2113 .It Fl R
2114 Destroy any more recent snapshots and bookmarks, as well as any clones of those
2115 snapshots.
2116 .It Fl f
2117 Used with the
2118 .Fl R
2119 option to force an unmount of any clone file systems that are to be destroyed.
2120 .It Fl r
2121 Destroy any snapshots and bookmarks more recent than the one specified.
2123 .It Xo
2125 .Cm clone
2126 .Op Fl p
2127 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2128 .Ar snapshot Ar filesystem Ns | Ns Ar volume
2130 Creates a clone of the given snapshot.
2131 See the
2132 .Sx Clones
2133 section for details.
2134 The target dataset can be located anywhere in the ZFS hierarchy, and is created
2135 as the same type as the original.
2136 .Bl -tag -width "-o"
2137 .It Fl o Ar property Ns = Ns Ar value
2138 Sets the specified property; see
2139 .Nm zfs Cm create
2140 for details.
2141 .It Fl p
2142 Creates all the non-existing parent datasets.
2143 Datasets created in this manner are automatically mounted according to the
2144 .Sy mountpoint
2145 property inherited from their parent.
2146 If the target filesystem or volume already exists, the operation completes
2147 successfully.
2149 .It Xo
2151 .Cm promote
2152 .Ar clone-filesystem
2154 Promotes a clone file system to no longer be dependent on its
2155 .Qq origin
2156 snapshot.
2157 This makes it possible to destroy the file system that the clone was created
2158 from.
2159 The clone parent-child dependency relationship is reversed, so that the origin
2160 file system becomes a clone of the specified file system.
2162 The snapshot that was cloned, and any snapshots previous to this snapshot, are
2163 now owned by the promoted clone.
2164 The space they use moves from the origin file system to the promoted clone, so
2165 enough space must be available to accommodate these snapshots.
2166 No new space is consumed by this operation, but the space accounting is
2167 adjusted.
2168 The promoted clone must not have any conflicting snapshot names of its own.
2170 .Cm rename
2171 subcommand can be used to rename any conflicting snapshots.
2172 .It Xo
2174 .Cm rename
2175 .Op Fl f
2176 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2177 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2179 .It Xo
2181 .Cm rename
2182 .Op Fl fp
2183 .Ar filesystem Ns | Ns Ar volume
2184 .Ar filesystem Ns | Ns Ar volume
2186 Renames the given dataset.
2187 The new target can be located anywhere in the ZFS hierarchy, with the exception
2188 of snapshots.
2189 Snapshots can only be renamed within the parent file system or volume.
2190 When renaming a snapshot, the parent file system of the snapshot does not need
2191 to be specified as part of the second argument.
2192 Renamed file systems can inherit new mount points, in which case they are
2193 unmounted and remounted at the new mount point.
2194 .Bl -tag -width "-a"
2195 .It Fl f
2196 Force unmount any filesystems that need to be unmounted in the process.
2197 .It Fl p
2198 Creates all the nonexistent parent datasets.
2199 Datasets created in this manner are automatically mounted according to the
2200 .Sy mountpoint
2201 property inherited from their parent.
2203 .It Xo
2205 .Cm rename
2206 .Fl r
2207 .Ar snapshot Ar snapshot
2209 Recursively rename the snapshots of all descendent datasets.
2210 Snapshots are the only dataset that can be renamed recursively.
2211 .It Xo
2213 .Cm list
2214 .Op Fl r Ns | Ns Fl d Ar depth
2215 .Op Fl Hp
2216 .Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2217 .Oo Fl s Ar property Oc Ns ...
2218 .Oo Fl S Ar property Oc Ns ...
2219 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2220 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2222 Lists the property information for the given datasets in tabular form.
2223 If specified, you can list property information by the absolute pathname or the
2224 relative pathname.
2225 By default, all file systems and volumes are displayed.
2226 Snapshots are displayed if the
2227 .Sy listsnaps
2228 property is
2229 .Sy on
2230 .Po the default is
2231 .Sy off
2232 .Pc .
2233 The following fields are displayed,
2234 .Sy name Ns , Ns Sy used Ns , Ns Sy available Ns , Ns Sy referenced Ns , Ns
2235 .Sy mountpoint .
2236 .Bl -tag -width "-H"
2237 .It Fl H
2238 Used for scripting mode.
2239 Do not print headers and separate fields by a single tab instead of arbitrary
2240 white space.
2241 .It Fl S Ar property
2242 Same as the
2243 .Fl s
2244 option, but sorts by property in descending order.
2245 .It Fl d Ar depth
2246 Recursively display any children of the dataset, limiting the recursion to
2247 .Ar depth .
2249 .Ar depth
2251 .Sy 1
2252 will display only the dataset and its direct children.
2253 .It Fl o Ar property
2254 A comma-separated list of properties to display.
2255 The property must be:
2256 .Bl -bullet
2258 One of the properties described in the
2259 .Sx Native Properties
2260 section
2262 A user property
2264 The value
2265 .Sy name
2266 to display the dataset name
2268 The value
2269 .Sy space
2270 to display space usage properties on file systems and volumes.
2271 This is a shortcut for specifying
2272 .Fl o Sy name Ns , Ns Sy avail Ns , Ns Sy used Ns , Ns Sy usedsnap Ns , Ns
2273 .Sy usedds Ns , Ns Sy usedrefreserv Ns , Ns Sy usedchild Fl t
2274 .Sy filesystem Ns , Ns Sy volume
2275 syntax.
2277 .It Fl p
2278 Display numbers in parsable
2279 .Pq exact
2280 values.
2281 .It Fl r
2282 Recursively display any children of the dataset on the command line.
2283 .It Fl s Ar property
2284 A property for sorting the output by column in ascending order based on the
2285 value of the property.
2286 The property must be one of the properties described in the
2287 .Sx Properties
2288 section, or the special value
2289 .Sy name
2290 to sort by the dataset name.
2291 Multiple properties can be specified at one time using multiple
2292 .Fl s
2293 property options.
2294 Multiple
2295 .Fl s
2296 options are evaluated from left to right in decreasing order of importance.
2297 The following is a list of sorting criteria:
2298 .Bl -bullet
2300 Numeric types sort in numeric order.
2302 String types sort in alphabetical order.
2304 Types inappropriate for a row sort that row to the literal bottom, regardless of
2305 the specified ordering.
2308 If no sorting options are specified the existing behavior of
2309 .Nm zfs Cm list
2310 is preserved.
2311 .It Fl t Ar type
2312 A comma-separated list of types to display, where
2313 .Ar type
2314 is one of
2315 .Sy filesystem ,
2316 .Sy snapshot ,
2317 .Sy volume ,
2318 .Sy bookmark ,
2320 .Sy all .
2321 For example, specifying
2322 .Fl t Sy snapshot
2323 displays only snapshots.
2325 .It Xo
2327 .Cm set
2328 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2329 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2331 Sets the property or list of properties to the given value(s) for each dataset.
2332 Only some properties can be edited.
2333 See the
2334 .Sx Properties
2335 section for more information on what properties can be set and acceptable
2336 values.
2337 Numeric values can be specified as exact values, or in a human-readable form
2338 with a suffix of
2339 .Sy B , K , M , G , T , P , E , Z
2340 .Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2341 or zettabytes, respectively
2342 .Pc .
2343 User properties can be set on snapshots.
2344 For more information, see the
2345 .Sx User Properties
2346 section.
2347 .It Xo
2349 .Cm get
2350 .Op Fl r Ns | Ns Fl d Ar depth
2351 .Op Fl Hp
2352 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2353 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2354 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2355 .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
2356 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
2358 Displays properties for the given datasets.
2359 If no datasets are specified, then the command displays properties for all
2360 datasets on the system.
2361 For each property, the following columns are displayed:
2362 .Bd -literal
2363     name      Dataset name
2364     property  Property name
2365     value     Property value
2366     source    Property source.  Can either be local, default,
2367               temporary, inherited, or none (-).
2370 All columns are displayed by default, though this can be controlled by using the
2371 .Fl o
2372 option.
2373 This command takes a comma-separated list of properties as described in the
2374 .Sx Native Properties
2376 .Sx User Properties
2377 sections.
2379 The special value
2380 .Sy all
2381 can be used to display all properties that apply to the given dataset's type
2382 .Pq filesystem, volume, snapshot, or bookmark .
2383 .Bl -tag -width "-H"
2384 .It Fl H
2385 Display output in a form more easily parsed by scripts.
2386 Any headers are omitted, and fields are explicitly separated by a single tab
2387 instead of an arbitrary amount of space.
2388 .It Fl d Ar depth
2389 Recursively display any children of the dataset, limiting the recursion to
2390 .Ar depth .
2391 A depth of
2392 .Sy 1
2393 will display only the dataset and its direct children.
2394 .It Fl o Ar field
2395 A comma-separated list of columns to display.
2396 .Sy name Ns , Ns Sy property Ns , Ns Sy value Ns , Ns Sy source
2397 is the default value.
2398 .It Fl p
2399 Display numbers in parsable
2400 .Pq exact
2401 values.
2402 .It Fl r
2403 Recursively display properties for any children.
2404 .It Fl s Ar source
2405 A comma-separated list of sources to display.
2406 Those properties coming from a source other than those in this list are ignored.
2407 Each source must be one of the following:
2408 .Sy local ,
2409 .Sy default ,
2410 .Sy inherited ,
2411 .Sy temporary ,
2413 .Sy none .
2414 The default value is all sources.
2415 .It Fl t Ar type
2416 A comma-separated list of types to display, where
2417 .Ar type
2418 is one of
2419 .Sy filesystem ,
2420 .Sy snapshot ,
2421 .Sy volume ,
2422 .Sy bookmark ,
2424 .Sy all .
2426 .It Xo
2428 .Cm inherit
2429 .Op Fl rS
2430 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2432 Clears the specified property, causing it to be inherited from an ancestor,
2433 restored to default if no ancestor has the property set, or with the
2434 .Fl S
2435 option reverted to the received value if one exists.
2436 See the
2437 .Sx Properties
2438 section for a listing of default values, and details on which properties can be
2439 inherited.
2440 .Bl -tag -width "-r"
2441 .It Fl r
2442 Recursively inherit the given property for all children.
2443 .It Fl S
2444 Revert the property to the received value if one exists; otherwise operate as
2445 if the
2446 .Fl S
2447 option was not specified.
2449 .It Xo
2451 .Cm remap
2452 .Ar filesystem Ns | Ns Ar volume
2454 Remap the indirect blocks in the given fileystem or volume so that they no
2455 longer reference blocks on previously removed vdevs and we can eventually
2456 shrink the size of the indirect mapping objects for the previously removed
2457 vdevs. Note that remapping all blocks might not be possible and that
2458 references from snapshots will still exist and cannot be remapped.
2459 .It Xo
2461 .Cm upgrade
2463 Displays a list of file systems that are not the most recent version.
2464 .It Xo
2466 .Cm upgrade
2467 .Fl v
2469 Displays a list of currently supported file system versions.
2470 .It Xo
2472 .Cm upgrade
2473 .Op Fl r
2474 .Op Fl V Ar version
2475 .Fl a | Ar filesystem
2477 Upgrades file systems to a new on-disk version.
2478 Once this is done, the file systems will no longer be accessible on systems
2479 running older versions of the software.
2480 .Nm zfs Cm send
2481 streams generated from new snapshots of these file systems cannot be accessed on
2482 systems running older versions of the software.
2484 In general, the file system version is independent of the pool version.
2486 .Xr zpool 8
2487 for information on the
2488 .Nm zpool Cm upgrade
2489 command.
2491 In some cases, the file system version and the pool version are interrelated and
2492 the pool version must be upgraded before the file system version can be
2493 upgraded.
2494 .Bl -tag -width "-V"
2495 .It Fl V Ar version
2496 Upgrade to the specified
2497 .Ar version .
2498 If the
2499 .Fl V
2500 flag is not specified, this command upgrades to the most recent version.
2501 This
2502 option can only be used to increase the version number, and only up to the most
2503 recent version supported by this software.
2504 .It Fl a
2505 Upgrade all file systems on all imported pools.
2506 .It Ar filesystem
2507 Upgrade the specified file system.
2508 .It Fl r
2509 Upgrade the specified file system and all descendent file systems.
2511 .It Xo
2513 .Cm userspace
2514 .Op Fl Hinp
2515 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2516 .Oo Fl s Ar field Oc Ns ...
2517 .Oo Fl S Ar field Oc Ns ...
2518 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2519 .Ar filesystem Ns | Ns Ar snapshot
2521 Displays space consumed by, and quotas on, each user in the specified filesystem
2522 or snapshot.
2523 This corresponds to the
2524 .Sy userused@ Ns Em user
2526 .Sy userquota@ Ns Em user
2527 properties.
2528 .Bl -tag -width "-H"
2529 .It Fl H
2530 Do not print headers, use tab-delimited output.
2531 .It Fl S Ar field
2532 Sort by this field in reverse order.
2534 .Fl s .
2535 .It Fl i
2536 Translate SID to POSIX ID.
2537 The POSIX ID may be ephemeral if no mapping exists.
2538 Normal POSIX interfaces
2539 .Po for example,
2540 .Xr stat 2 ,
2541 .Nm ls Fl l
2543 perform this translation, so the
2544 .Fl i
2545 option allows the output from
2546 .Nm zfs Cm userspace
2547 to be compared directly with those utilities.
2548 However,
2549 .Fl i
2550 may lead to confusion if some files were created by an SMB user before a
2551 SMB-to-POSIX name mapping was established.
2552 In such a case, some files will be owned by the SMB entity and some by the POSIX
2553 entity.
2554 However, the
2555 .Fl i
2556 option will report that the POSIX entity has the total usage and quota for both.
2557 .It Fl n
2558 Print numeric ID instead of user/group name.
2559 .It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2560 Display only the specified fields from the following set:
2561 .Sy type ,
2562 .Sy name ,
2563 .Sy used ,
2564 .Sy quota .
2565 The default is to display all fields.
2566 .It Fl p
2567 Use exact
2568 .Pq parsable
2569 numeric output.
2570 .It Fl s Ar field
2571 Sort output by this field.
2573 .Fl s
2575 .Fl S
2576 flags may be specified multiple times to sort first by one field, then by
2577 another.
2578 The default is
2579 .Fl s Sy type Fl s Sy name .
2580 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2581 Print only the specified types from the following set:
2582 .Sy all ,
2583 .Sy posixuser ,
2584 .Sy smbuser ,
2585 .Sy posixgroup ,
2586 .Sy smbgroup .
2587 The default is
2588 .Fl t Sy posixuser Ns , Ns Sy smbuser .
2589 The default can be changed to include group types.
2591 .It Xo
2593 .Cm groupspace
2594 .Op Fl Hinp
2595 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2596 .Oo Fl s Ar field Oc Ns ...
2597 .Oo Fl S Ar field Oc Ns ...
2598 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2599 .Ar filesystem Ns | Ns Ar snapshot
2601 Displays space consumed by, and quotas on, each group in the specified
2602 filesystem or snapshot.
2603 This subcommand is identical to
2604 .Nm zfs Cm userspace ,
2605 except that the default types to display are
2606 .Fl t Sy posixgroup Ns , Ns Sy smbgroup .
2607 .It Xo
2609 .Cm mount
2611 Displays all ZFS file systems currently mounted.
2612 .It Xo
2614 .Cm mount
2615 .Op Fl Ov
2616 .Op Fl o Ar options
2617 .Fl a | Ar filesystem
2619 Mounts ZFS file systems.
2620 .Bl -tag -width "-O"
2621 .It Fl O
2622 Perform an overlay mount.
2624 .Xr mount 8
2625 for more information.
2626 .It Fl a
2627 Mount all available ZFS file systems.
2628 Invoked automatically as part of the boot process.
2629 .It Ar filesystem
2630 Mount the specified filesystem.
2631 .It Fl o Ar options
2632 An optional, comma-separated list of mount options to use temporarily for the
2633 duration of the mount.
2634 See the
2635 .Sx Temporary Mount Point Properties
2636 section for details.
2637 .It Fl v
2638 Report mount progress.
2640 .It Xo
2642 .Cm unmount
2643 .Op Fl f
2644 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2646 Unmounts currently mounted ZFS file systems.
2647 .Bl -tag -width "-a"
2648 .It Fl a
2649 Unmount all available ZFS file systems.
2650 Invoked automatically as part of the shutdown process.
2651 .It Ar filesystem Ns | Ns Ar mountpoint
2652 Unmount the specified filesystem.
2653 The command can also be given a path to a ZFS file system mount point on the
2654 system.
2655 .It Fl f
2656 Forcefully unmount the file system, even if it is currently in use.
2658 .It Xo
2660 .Cm share
2661 .Fl a | Ar filesystem
2663 Shares available ZFS file systems.
2664 .Bl -tag -width "-a"
2665 .It Fl a
2666 Share all available ZFS file systems.
2667 Invoked automatically as part of the boot process.
2668 .It Ar filesystem
2669 Share the specified filesystem according to the
2670 .Sy sharenfs
2672 .Sy sharesmb
2673 properties.
2674 File systems are shared when the
2675 .Sy sharenfs
2677 .Sy sharesmb
2678 property is set.
2680 .It Xo
2682 .Cm unshare
2683 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
2685 Unshares currently shared ZFS file systems.
2686 .Bl -tag -width "-a"
2687 .It Fl a
2688 Unshare all available ZFS file systems.
2689 Invoked automatically as part of the shutdown process.
2690 .It Ar filesystem Ns | Ns Ar mountpoint
2691 Unshare the specified filesystem.
2692 The command can also be given a path to a ZFS file system shared on the system.
2694 .It Xo
2696 .Cm bookmark
2697 .Ar snapshot bookmark
2699 Creates a bookmark of the given snapshot.
2700 Bookmarks mark the point in time when the snapshot was created, and can be used
2701 as the incremental source for a
2702 .Nm zfs Cm send
2703 command.
2705 This feature must be enabled to be used.
2707 .Xr zpool-features 5
2708 for details on ZFS feature flags and the
2709 .Sy bookmarks
2710 feature.
2711 .It Xo
2713 .Cm send
2714 .Op Fl DLPRcenpv
2715 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
2716 .Ar snapshot
2718 Creates a stream representation of the second
2719 .Ar snapshot ,
2720 which is written to standard output.
2721 The output can be redirected to a file or to a different system
2722 .Po for example, using
2723 .Xr ssh 1
2724 .Pc .
2725 By default, a full stream is generated.
2726 .Bl -tag -width "-D"
2727 .It Fl D, -dedup
2728 Generate a deduplicated stream.
2729 Blocks which would have been sent multiple times in the send stream will only be
2730 sent once.
2731 The receiving system must also support this feature to receive a deduplicated
2732 stream.
2733 This flag can be used regardless of the dataset's
2734 .Sy dedup
2735 property, but performance will be much better if the filesystem uses a
2736 dedup-capable checksum
2737 .Po for example,
2738 .Sy sha256
2739 .Pc .
2740 .It Fl I Ar snapshot
2741 Generate a stream package that sends all intermediary snapshots from the first
2742 snapshot to the second snapshot.
2743 For example,
2744 .Fl I Em @a Em fs@d
2745 is similar to
2746 .Fl i Em @a Em fs@b Ns ; Fl i Em @b Em fs@c Ns ; Fl i Em @c Em fs@d .
2747 The incremental source may be specified as with the
2748 .Fl i
2749 option.
2750 .It Fl L, -large-block
2751 Generate a stream which may contain blocks larger than 128KB.
2752 This flag has no effect if the
2753 .Sy large_blocks
2754 pool feature is disabled, or if the
2755 .Sy recordsize
2756 property of this filesystem has never been set above 128KB.
2757 The receiving system must have the
2758 .Sy large_blocks
2759 pool feature enabled as well.
2761 .Xr zpool-features 5
2762 for details on ZFS feature flags and the
2763 .Sy large_blocks
2764 feature.
2765 .It Fl P, -parsable
2766 Print machine-parsable verbose information about the stream package generated.
2767 .It Fl R, -replicate
2768 Generate a replication stream package, which will replicate the specified
2769 file system, and all descendent file systems, up to the named snapshot.
2770 When received, all properties, snapshots, descendent file systems, and clones
2771 are preserved.
2773 If the
2774 .Fl i
2776 .Fl I
2777 flags are used in conjunction with the
2778 .Fl R
2779 flag, an incremental replication stream is generated.
2780 The current values of properties, and current snapshot and file system names are
2781 set when the stream is received.
2782 If the
2783 .Fl F
2784 flag is specified when this stream is received, snapshots and file systems that
2785 do not exist on the sending side are destroyed.
2786 .It Fl e, -embed
2787 Generate a more compact stream by using
2788 .Sy WRITE_EMBEDDED
2789 records for blocks which are stored more compactly on disk by the
2790 .Sy embedded_data
2791 pool feature.
2792 This flag has no effect if the
2793 .Sy embedded_data
2794 feature is disabled.
2795 The receiving system must have the
2796 .Sy embedded_data
2797 feature enabled.
2798 If the
2799 .Sy lz4_compress
2800 feature is active on the sending system, then the receiving system must have
2801 that feature enabled as well.
2803 .Xr zpool-features 5
2804 for details on ZFS feature flags and the
2805 .Sy embedded_data
2806 feature.
2807 .It Fl c, -compressed
2808 Generate a more compact stream by using compressed WRITE records for blocks
2809 which are compressed on disk and in memory
2810 .Po see the
2811 .Sy compression
2812 property for details
2813 .Pc .
2814 If the
2815 .Sy lz4_compress
2816 feature is active on the sending system, then the receiving system must have
2817 that feature enabled as well.
2818 If the
2819 .Sy large_blocks
2820 feature is enabled on the sending system but the
2821 .Fl L
2822 option is not supplied in conjunction with
2823 .Fl c ,
2824 then the data will be decompressed before sending so it can be split into
2825 smaller block sizes.
2826 .It Fl i Ar snapshot
2827 Generate an incremental stream from the first
2828 .Ar snapshot
2829 .Pq the incremental source
2830 to the second
2831 .Ar snapshot
2832 .Pq the incremental target .
2833 The incremental source can be specified as the last component of the snapshot
2834 name
2835 .Po the
2836 .Sy @
2837 character and following
2839 and it is assumed to be from the same file system as the incremental target.
2841 If the destination is a clone, the source may be the origin snapshot, which must
2842 be fully specified
2843 .Po for example,
2844 .Em pool/fs@origin ,
2845 not just
2846 .Em @origin
2847 .Pc .
2848 .It Fl n, -dryrun
2849 Do a dry-run
2850 .Pq Qq No-op
2851 send.
2852 Do not generate any actual send data.
2853 This is useful in conjunction with the
2854 .Fl v
2856 .Fl P
2857 flags to determine what data will be sent.
2858 In this case, the verbose output will be written to standard output
2859 .Po contrast with a non-dry-run, where the stream is written to standard output
2860 and the verbose output goes to standard error
2861 .Pc .
2862 .It Fl p, -props
2863 Include the dataset's properties in the stream.
2864 This flag is implicit when
2865 .Fl R
2866 is specified.
2867 The receiving system must also support this feature.
2868 .It Fl v, -verbose
2869 Print verbose information about the stream package generated.
2870 This information includes a per-second report of how much data has been sent.
2872 The format of the stream is committed.
2873 You will be able to receive your streams on future versions of ZFS .
2875 .It Xo
2877 .Cm send
2878 .Op Fl Lce
2879 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
2880 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2882 Generate a send stream, which may be of a filesystem, and may be incremental
2883 from a bookmark.
2884 If the destination is a filesystem or volume, the pool must be read-only, or the
2885 filesystem must not be mounted.
2886 When the stream generated from a filesystem or volume is received, the default
2887 snapshot name will be
2888 .Qq --head-- .
2889 .Bl -tag -width "-L"
2890 .It Fl L, -large-block
2891 Generate a stream which may contain blocks larger than 128KB.
2892 This flag has no effect if the
2893 .Sy large_blocks
2894 pool feature is disabled, or if the
2895 .Sy recordsize
2896 property of this filesystem has never been set above 128KB.
2897 The receiving system must have the
2898 .Sy large_blocks
2899 pool feature enabled as well.
2901 .Xr zpool-features 5
2902 for details on ZFS feature flags and the
2903 .Sy large_blocks
2904 feature.
2905 .It Fl c, -compressed
2906 Generate a more compact stream by using compressed WRITE records for blocks
2907 which are compressed on disk and in memory
2908 .Po see the
2909 .Sy compression
2910 property for details
2911 .Pc .
2912 If the
2913 .Sy lz4_compress
2914 feature is active on the sending system, then the receiving system must have
2915 that feature enabled as well.
2916 If the
2917 .Sy large_blocks
2918 feature is enabled on the sending system but the
2919 .Fl L
2920 option is not supplied in conjunction with
2921 .Fl c ,
2922 then the data will be decompressed before sending so it can be split into
2923 smaller block sizes.
2924 .It Fl e, -embed
2925 Generate a more compact stream by using
2926 .Sy WRITE_EMBEDDED
2927 records for blocks which are stored more compactly on disk by the
2928 .Sy embedded_data
2929 pool feature.
2930 This flag has no effect if the
2931 .Sy embedded_data
2932 feature is disabled.
2933 The receiving system must have the
2934 .Sy embedded_data
2935 feature enabled.
2936 If the
2937 .Sy lz4_compress
2938 feature is active on the sending system, then the receiving system must have
2939 that feature enabled as well.
2941 .Xr zpool-features 5
2942 for details on ZFS feature flags and the
2943 .Sy embedded_data
2944 feature.
2945 .It Fl i Ar snapshot Ns | Ns Ar bookmark
2946 Generate an incremental send stream.
2947 The incremental source must be an earlier snapshot in the destination's history.
2948 It will commonly be an earlier snapshot in the destination's file system, in
2949 which case it can be specified as the last component of the name
2950 .Po the
2951 .Sy #
2953 .Sy @
2954 character and following
2955 .Pc .
2957 If the incremental target is a clone, the incremental source can be the origin
2958 snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
2959 origin, etc.
2961 .It Xo
2963 .Cm send
2964 .Op Fl Penv
2965 .Fl t
2966 .Ar receive_resume_token
2968 Creates a send stream which resumes an interrupted receive.
2970 .Ar receive_resume_token
2971 is the value of this property on the filesystem or volume that was being
2972 received into.
2973 See the documentation for
2974 .Sy zfs receive -s
2975 for more details.
2976 .It Xo
2978 .Cm receive
2979 .Op Fl Fnsuv
2980 .Op Fl o Sy origin Ns = Ns Ar snapshot
2981 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2983 .It Xo
2985 .Cm receive
2986 .Op Fl Fnsuv
2987 .Op Fl d Ns | Ns Fl e
2988 .Op Fl o Sy origin Ns = Ns Ar snapshot
2989 .Ar filesystem
2991 Creates a snapshot whose contents are as specified in the stream provided on
2992 standard input.
2993 If a full stream is received, then a new file system is created as well.
2994 Streams are created using the
2995 .Nm zfs Cm send
2996 subcommand, which by default creates a full stream.
2997 .Nm zfs Cm recv
2998 can be used as an alias for
2999 .Nm zfs Cm receive.
3001 If an incremental stream is received, then the destination file system must
3002 already exist, and its most recent snapshot must match the incremental stream's
3003 source.
3005 .Sy zvols ,
3006 the destination device link is destroyed and recreated, which means the
3007 .Sy zvol
3008 cannot be accessed during the
3009 .Cm receive
3010 operation.
3012 When a snapshot replication package stream that is generated by using the
3013 .Nm zfs Cm send Fl R
3014 command is received, any snapshots that do not exist on the sending location are
3015 destroyed by using the
3016 .Nm zfs Cm destroy Fl d
3017 command.
3019 The name of the snapshot
3020 .Pq and file system, if a full stream is received
3021 that this subcommand creates depends on the argument type and the use of the
3022 .Fl d
3024 .Fl e
3025 options.
3027 If the argument is a snapshot name, the specified
3028 .Ar snapshot
3029 is created.
3030 If the argument is a file system or volume name, a snapshot with the same name
3031 as the sent snapshot is created within the specified
3032 .Ar filesystem
3034 .Ar volume .
3035 If neither of the
3036 .Fl d
3038 .Fl e
3039 options are specified, the provided target snapshot name is used exactly as
3040 provided.
3043 .Fl d
3045 .Fl e
3046 options cause the file system name of the target snapshot to be determined by
3047 appending a portion of the sent snapshot's name to the specified target
3048 .Ar filesystem .
3049 If the
3050 .Fl d
3051 option is specified, all but the first element of the sent snapshot's file
3052 system path
3053 .Pq usually the pool name
3054 is used and any required intermediate file systems within the specified one are
3055 created.
3056 If the
3057 .Fl e
3058 option is specified, then only the last element of the sent snapshot's file
3059 system name
3060 .Pq i.e. the name of the source file system itself
3061 is used as the target file system name.
3062 .Bl -tag -width "-F"
3063 .It Fl F
3064 Force a rollback of the file system to the most recent snapshot before
3065 performing the receive operation.
3066 If receiving an incremental replication stream
3067 .Po for example, one generated by
3068 .Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3069 .Pc ,
3070 destroy snapshots and file systems that do not exist on the sending side.
3071 .It Fl d
3072 Discard the first element of the sent snapshot's file system name, using the
3073 remaining elements to determine the name of the target file system for the new
3074 snapshot as described in the paragraph above.
3075 .It Fl e
3076 Discard all but the last element of the sent snapshot's file system name, using
3077 that element to determine the name of the target file system for the new
3078 snapshot as described in the paragraph above.
3079 .It Fl n
3080 Do not actually receive the stream.
3081 This can be useful in conjunction with the
3082 .Fl v
3083 option to verify the name the receive operation would use.
3084 .It Fl o Sy origin Ns = Ns Ar snapshot
3085 Forces the stream to be received as a clone of the given snapshot.
3086 If the stream is a full send stream, this will create the filesystem
3087 described by the stream as a clone of the specified snapshot.
3088 Which snapshot was specified will not affect the success or failure of the
3089 receive, as long as the snapshot does exist.
3090 If the stream is an incremental send stream, all the normal verification will be
3091 performed.
3092 .It Fl u
3093 File system that is associated with the received stream is not mounted.
3094 .It Fl v
3095 Print verbose information about the stream and the time required to perform the
3096 receive operation.
3097 .It Fl s
3098 If the receive is interrupted, save the partially received state, rather
3099 than deleting it.
3100 Interruption may be due to premature termination of the stream
3101 .Po e.g. due to network failure or failure of the remote system
3102 if the stream is being read over a network connection
3103 .Pc ,
3104 a checksum error in the stream, termination of the
3105 .Nm zfs Cm receive
3106 process, or unclean shutdown of the system.
3108 The receive can be resumed with a stream generated by
3109 .Nm zfs Cm send Fl t Ar token ,
3110 where the
3111 .Ar token
3112 is the value of the
3113 .Sy receive_resume_token
3114 property of the filesystem or volume which is received into.
3116 To use this flag, the storage pool must have the
3117 .Sy extensible_dataset
3118 feature enabled.
3120 .Xr zpool-features 5
3121 for details on ZFS feature flags.
3123 .It Xo
3125 .Cm receive
3126 .Fl A
3127 .Ar filesystem Ns | Ns Ar volume
3129 Abort an interrupted
3130 .Nm zfs Cm receive Fl s ,
3131 deleting its saved partially received state.
3132 .It Xo
3134 .Cm allow
3135 .Ar filesystem Ns | Ns Ar volume
3137 Displays permissions that have been delegated on the specified filesystem or
3138 volume.
3139 See the other forms of
3140 .Nm zfs Cm allow
3141 for more information.
3142 .It Xo
3144 .Cm allow
3145 .Op Fl dglu
3146 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3147 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3148 .Ar setname Oc Ns ...
3149 .Ar filesystem Ns | Ns Ar volume
3151 .It Xo
3153 .Cm allow
3154 .Op Fl dl
3155 .Fl e Ns | Ns Sy everyone
3156 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3157 .Ar setname Oc Ns ...
3158 .Ar filesystem Ns | Ns Ar volume
3160 Delegates ZFS administration permission for the file systems to non-privileged
3161 users.
3162 .Bl -tag -width "-d"
3163 .It Fl d
3164 Allow only for the descendent file systems.
3165 .It Fl e Ns | Ns Sy everyone
3166 Specifies that the permissions be delegated to everyone.
3167 .It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
3168 Explicitly specify that permissions are delegated to the group.
3169 .It Fl l
3170 Allow
3171 .Qq locally
3172 only for the specified file system.
3173 .It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
3174 Explicitly specify that permissions are delegated to the user.
3175 .It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3176 Specifies to whom the permissions are delegated.
3177 Multiple entities can be specified as a comma-separated list.
3178 If neither of the
3179 .Fl gu
3180 options are specified, then the argument is interpreted preferentially as the
3181 keyword
3182 .Sy everyone ,
3183 then as a user name, and lastly as a group name.
3184 To specify a user or group named
3185 .Qq everyone ,
3186 use the
3187 .Fl g
3189 .Fl u
3190 options.
3191 To specify a group with the same name as a user, use the
3192 .Fl g
3193 options.
3194 .It Xo
3195 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3196 .Ar setname Oc Ns ...
3198 The permissions to delegate.
3199 Multiple permissions may be specified as a comma-separated list.
3200 Permission names are the same as ZFS subcommand and property names.
3201 See the property list below.
3202 Property set names, which begin with
3203 .Sy @ ,
3204 may be specified.
3205 See the
3206 .Fl s
3207 form below for details.
3210 If neither of the
3211 .Fl dl
3212 options are specified, or both are, then the permissions are allowed for the
3213 file system or volume, and all of its descendents.
3215 Permissions are generally the ability to use a ZFS subcommand or change a ZFS
3216 property.
3217 The following permissions are available:
3218 .Bd -literal
3219 NAME             TYPE           NOTES
3220 allow            subcommand     Must also have the permission that is
3221                                 being allowed
3222 clone            subcommand     Must also have the 'create' ability and
3223                                 'mount' ability in the origin file system
3224 create           subcommand     Must also have the 'mount' ability
3225 destroy          subcommand     Must also have the 'mount' ability
3226 diff             subcommand     Allows lookup of paths within a dataset
3227                                 given an object number, and the ability
3228                                 to create snapshots necessary to
3229                                 'zfs diff'.
3230 mount            subcommand     Allows mount/umount of ZFS datasets
3231 promote          subcommand     Must also have the 'mount' and 'promote'
3232                                 ability in the origin file system
3233 receive          subcommand     Must also have the 'mount' and 'create'
3234                                 ability
3235 rename           subcommand     Must also have the 'mount' and 'create'
3236                                 ability in the new parent
3237 rollback         subcommand     Must also have the 'mount' ability
3238 send             subcommand
3239 share            subcommand     Allows sharing file systems over NFS
3240                                 or SMB protocols
3241 snapshot         subcommand     Must also have the 'mount' ability
3243 groupquota       other          Allows accessing any groupquota@...
3244                                 property
3245 groupused        other          Allows reading any groupused@... property
3246 userprop         other          Allows changing any user property
3247 userquota        other          Allows accessing any userquota@...
3248                                 property
3249 userused         other          Allows reading any userused@... property
3251 aclinherit       property
3252 aclmode          property
3253 atime            property
3254 canmount         property
3255 casesensitivity  property
3256 checksum         property
3257 compression      property
3258 copies           property
3259 devices          property
3260 exec             property
3261 filesystem_limit property
3262 mountpoint       property
3263 nbmand           property
3264 normalization    property
3265 primarycache     property
3266 quota            property
3267 readonly         property
3268 recordsize       property
3269 refquota         property
3270 refreservation   property
3271 reservation      property
3272 secondarycache   property
3273 setuid           property
3274 sharenfs         property
3275 sharesmb         property
3276 snapdir          property
3277 snapshot_limit   property
3278 utf8only         property
3279 version          property
3280 volblocksize     property
3281 volsize          property
3282 vscan            property
3283 xattr            property
3284 zoned            property
3286 .It Xo
3288 .Cm allow
3289 .Fl c
3290 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3291 .Ar setname Oc Ns ...
3292 .Ar filesystem Ns | Ns Ar volume
3294 Sets
3295 .Qq create time
3296 permissions.
3297 These permissions are granted
3298 .Pq locally
3299 to the creator of any newly-created descendent file system.
3300 .It Xo
3302 .Cm allow
3303 .Fl s No @ Ns Ar setname
3304 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3305 .Ar setname Oc Ns ...
3306 .Ar filesystem Ns | Ns Ar volume
3308 Defines or adds permissions to a permission set.
3309 The set can be used by other
3310 .Nm zfs Cm allow
3311 commands for the specified file system and its descendents.
3312 Sets are evaluated dynamically, so changes to a set are immediately reflected.
3313 Permission sets follow the same naming restrictions as ZFS file systems, but the
3314 name must begin with
3315 .Sy @ ,
3316 and can be no more than 64 characters long.
3317 .It Xo
3319 .Cm unallow
3320 .Op Fl dglru
3321 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3322 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3323 .Ar setname Oc Ns ... Oc
3324 .Ar filesystem Ns | Ns Ar volume
3326 .It Xo
3328 .Cm unallow
3329 .Op Fl dlr
3330 .Fl e Ns | Ns Sy everyone
3331 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3332 .Ar setname Oc Ns ... Oc
3333 .Ar filesystem Ns | Ns Ar volume
3335 .It Xo
3337 .Cm unallow
3338 .Op Fl r
3339 .Fl c
3340 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3341 .Ar setname Oc Ns ... Oc
3342 .Ar filesystem Ns | Ns Ar volume
3344 Removes permissions that were granted with the
3345 .Nm zfs Cm allow
3346 command.
3347 No permissions are explicitly denied, so other permissions granted are still in
3348 effect.
3349 For example, if the permission is granted by an ancestor.
3350 If no permissions are specified, then all permissions for the specified
3351 .Ar user ,
3352 .Ar group ,
3354 .Sy everyone
3355 are removed.
3356 Specifying
3357 .Sy everyone
3358 .Po or using the
3359 .Fl e
3360 option
3362 only removes the permissions that were granted to everyone, not all permissions
3363 for every user and group.
3364 See the
3365 .Nm zfs Cm allow
3366 command for a description of the
3367 .Fl ldugec
3368 options.
3369 .Bl -tag -width "-r"
3370 .It Fl r
3371 Recursively remove the permissions from this file system and all descendents.
3373 .It Xo
3375 .Cm unallow
3376 .Op Fl r
3377 .Fl s No @ Ns Ar setname
3378 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3379 .Ar setname Oc Ns ... Oc
3380 .Ar filesystem Ns | Ns Ar volume
3382 Removes permissions from a permission set.
3383 If no permissions are specified, then all permissions are removed, thus removing
3384 the set entirely.
3385 .It Xo
3387 .Cm hold
3388 .Op Fl r
3389 .Ar tag Ar snapshot Ns ...
3391 Adds a single reference, named with the
3392 .Ar tag
3393 argument, to the specified snapshot or snapshots.
3394 Each snapshot has its own tag namespace, and tags must be unique within that
3395 space.
3397 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3398 .Nm zfs Cm destroy
3399 command return
3400 .Er EBUSY .
3401 .Bl -tag -width "-r"
3402 .It Fl r
3403 Specifies that a hold with the given tag is applied recursively to the snapshots
3404 of all descendent file systems.
3406 .It Xo
3408 .Cm holds
3409 .Op Fl r
3410 .Ar snapshot Ns ...
3412 Lists all existing user references for the given snapshot or snapshots.
3413 .Bl -tag -width "-r"
3414 .It Fl r
3415 Lists the holds that are set on the named descendent snapshots, in addition to
3416 listing the holds on the named snapshot.
3418 .It Xo
3420 .Cm release
3421 .Op Fl r
3422 .Ar tag Ar snapshot Ns ...
3424 Removes a single reference, named with the
3425 .Ar tag
3426 argument, from the specified snapshot or snapshots.
3427 The tag must already exist for each snapshot.
3428 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3429 .Nm zfs Cm destroy
3430 command return
3431 .Er EBUSY .
3432 .Bl -tag -width "-r"
3433 .It Fl r
3434 Recursively releases a hold with the given tag on the snapshots of all
3435 descendent file systems.
3437 .It Xo
3439 .Cm diff
3440 .Op Fl FHt
3441 .Ar snapshot Ar snapshot Ns | Ns Ar filesystem
3443 Display the difference between a snapshot of a given filesystem and another
3444 snapshot of that filesystem from a later time or the current contents of the
3445 filesystem.
3446 The first column is a character indicating the type of change, the other columns
3447 indicate pathname, new pathname
3448 .Pq in case of rename ,
3449 change in link count, and optionally file type and/or change time.
3450 The types of change are:
3451 .Bd -literal
3452 -       The path has been removed
3453 +       The path has been created
3454 M       The path has been modified
3455 R       The path has been renamed
3457 .Bl -tag -width "-F"
3458 .It Fl F
3459 Display an indication of the type of file, in a manner similar to the
3461 option of
3462 .Xr ls 1 .
3463 .Bd -literal
3464 B       Block device
3465 C       Character device
3466 /       Directory
3467 >       Door
3468 |       Named pipe
3469 @       Symbolic link
3470 P       Event port
3471 =       Socket
3472 F       Regular file
3474 .It Fl H
3475 Give more parsable tab-separated output, without header lines and without
3476 arrows.
3477 .It Fl t
3478 Display the path's inode change time as the first column of output.
3480 .It Xo
3482 .Cm program
3483 .Op Fl jn
3484 .Op Fl t Ar timeout
3485 .Op Fl m Ar memory_limit
3486 .Ar pool script
3487 .Op Ar arg1 No ...
3489 Executes
3490 .Ar script
3491 as a ZFS channel program on
3492 .Ar pool .
3493 The ZFS channel
3494 program interface allows ZFS administrative operations to be run
3495 programmatically via a Lua script.
3496 The entire script is executed atomically, with no other administrative
3497 operations taking effect concurrently.
3498 A library of ZFS calls is made available to channel program scripts.
3499 Channel programs may only be run with root privileges.
3501 For full documentation of the ZFS channel program interface, see the manual
3502 page for
3503 .Xr zfs-program 8 .
3504 .Bl -tag -width ""
3505 .It Fl j
3506 Display channel program output in JSON format.
3507 When this flag is specified and standard output is empty -
3508 channel program encountered an error.
3509 The details of such an error will be printed to standard error in plain text.
3510 .It Fl n
3511 Executes a read-only channel program, which runs faster.
3512 The program cannot change on-disk state by calling functions from
3513 the zfs.sync submodule.
3514 The program can be used to gather information such as properties and
3515 determining if changes would succeed (zfs.check.*).
3516 Without this flag, all pending changes must be synced to disk before
3517 a channel program can complete.
3518 .It Fl t Ar timeout
3519 Execution time limit, in milliseconds.
3520 If a channel program executes for longer than the provided timeout, it will
3521 be stopped and an error will be returned.
3522 The default timeout is 1000 ms, and can be set to a maximum of 10000 ms.
3523 .It Fl m Ar memory-limit
3524 Memory limit, in bytes.
3525 If a channel program attempts to allocate more memory than the given limit,
3526 it will be stopped and an error returned.
3527 The default memory limit is 10 MB, and can be set to a maximum of 100 MB.
3529 All remaining argument strings are passed directly to the channel program as
3530 arguments.
3532 .Xr zfs-program 8
3533 for more information.
3536 .Sh EXIT STATUS
3539 utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
3540 options were specified.
3541 .Sh EXAMPLES
3542 .Bl -tag -width ""
3543 .It Sy Example 1 No Creating a ZFS File System Hierarchy
3544 The following commands create a file system named
3545 .Em pool/home
3546 and a file system named
3547 .Em pool/home/bob .
3548 The mount point
3549 .Pa /export/home
3550 is set for the parent file system, and is automatically inherited by the child
3551 file system.
3552 .Bd -literal
3553 # zfs create pool/home
3554 # zfs set mountpoint=/export/home pool/home
3555 # zfs create pool/home/bob
3557 .It Sy Example 2 No Creating a ZFS Snapshot
3558 The following command creates a snapshot named
3559 .Sy yesterday .
3560 This snapshot is mounted on demand in the
3561 .Pa .zfs/snapshot
3562 directory at the root of the
3563 .Em pool/home/bob
3564 file system.
3565 .Bd -literal
3566 # zfs snapshot pool/home/bob@yesterday
3568 .It Sy Example 3 No Creating and Destroying Multiple Snapshots
3569 The following command creates snapshots named
3570 .Sy yesterday
3572 .Em pool/home
3573 and all of its descendent file systems.
3574 Each snapshot is mounted on demand in the
3575 .Pa .zfs/snapshot
3576 directory at the root of its file system.
3577 The second command destroys the newly created snapshots.
3578 .Bd -literal
3579 # zfs snapshot -r pool/home@yesterday
3580 # zfs destroy -r pool/home@yesterday
3582 .It Sy Example 4 No Disabling and Enabling File System Compression
3583 The following command disables the
3584 .Sy compression
3585 property for all file systems under
3586 .Em pool/home .
3587 The next command explicitly enables
3588 .Sy compression
3590 .Em pool/home/anne .
3591 .Bd -literal
3592 # zfs set compression=off pool/home
3593 # zfs set compression=on pool/home/anne
3595 .It Sy Example 5 No Listing ZFS Datasets
3596 The following command lists all active file systems and volumes in the system.
3597 Snapshots are displayed if the
3598 .Sy listsnaps
3599 property is
3600 .Sy on .
3601 The default is
3602 .Sy off .
3604 .Xr zpool 8
3605 for more information on pool properties.
3606 .Bd -literal
3607 # zfs list
3608 NAME                      USED  AVAIL  REFER  MOUNTPOINT
3609 pool                      450K   457G    18K  /pool
3610 pool/home                 315K   457G    21K  /export/home
3611 pool/home/anne             18K   457G    18K  /export/home/anne
3612 pool/home/bob             276K   457G   276K  /export/home/bob
3614 .It Sy Example 6 No Setting a Quota on a ZFS File System
3615 The following command sets a quota of 50 Gbytes for
3616 .Em pool/home/bob .
3617 .Bd -literal
3618 # zfs set quota=50G pool/home/bob
3620 .It Sy Example 7 No Listing ZFS Properties
3621 The following command lists all properties for
3622 .Em pool/home/bob .
3623 .Bd -literal
3624 # zfs get all pool/home/bob
3625 NAME           PROPERTY              VALUE                  SOURCE
3626 pool/home/bob  type                  filesystem             -
3627 pool/home/bob  creation              Tue Jul 21 15:53 2009  -
3628 pool/home/bob  used                  21K                    -
3629 pool/home/bob  available             20.0G                  -
3630 pool/home/bob  referenced            21K                    -
3631 pool/home/bob  compressratio         1.00x                  -
3632 pool/home/bob  mounted               yes                    -
3633 pool/home/bob  quota                 20G                    local
3634 pool/home/bob  reservation           none                   default
3635 pool/home/bob  recordsize            128K                   default
3636 pool/home/bob  mountpoint            /pool/home/bob         default
3637 pool/home/bob  sharenfs              off                    default
3638 pool/home/bob  checksum              on                     default
3639 pool/home/bob  compression           on                     local
3640 pool/home/bob  atime                 on                     default
3641 pool/home/bob  devices               on                     default
3642 pool/home/bob  exec                  on                     default
3643 pool/home/bob  setuid                on                     default
3644 pool/home/bob  readonly              off                    default
3645 pool/home/bob  zoned                 off                    default
3646 pool/home/bob  snapdir               hidden                 default
3647 pool/home/bob  aclmode               discard                default
3648 pool/home/bob  aclinherit            restricted             default
3649 pool/home/bob  canmount              on                     default
3650 pool/home/bob  xattr                 on                     default
3651 pool/home/bob  copies                1                      default
3652 pool/home/bob  version               4                      -
3653 pool/home/bob  utf8only              off                    -
3654 pool/home/bob  normalization         none                   -
3655 pool/home/bob  casesensitivity       sensitive              -
3656 pool/home/bob  vscan                 off                    default
3657 pool/home/bob  nbmand                off                    default
3658 pool/home/bob  sharesmb              off                    default
3659 pool/home/bob  refquota              none                   default
3660 pool/home/bob  refreservation        none                   default
3661 pool/home/bob  primarycache          all                    default
3662 pool/home/bob  secondarycache        all                    default
3663 pool/home/bob  usedbysnapshots       0                      -
3664 pool/home/bob  usedbydataset         21K                    -
3665 pool/home/bob  usedbychildren        0                      -
3666 pool/home/bob  usedbyrefreservation  0                      -
3669 The following command gets a single property value.
3670 .Bd -literal
3671 # zfs get -H -o value compression pool/home/bob
3674 The following command lists all properties with local settings for
3675 .Em pool/home/bob .
3676 .Bd -literal
3677 # zfs get -r -s local -o name,property,value all pool/home/bob
3678 NAME           PROPERTY              VALUE
3679 pool/home/bob  quota                 20G
3680 pool/home/bob  compression           on
3682 .It Sy Example 8 No Rolling Back a ZFS File System
3683 The following command reverts the contents of
3684 .Em pool/home/anne
3685 to the snapshot named
3686 .Sy yesterday ,
3687 deleting all intermediate snapshots.
3688 .Bd -literal
3689 # zfs rollback -r pool/home/anne@yesterday
3691 .It Sy Example 9 No Creating a ZFS Clone
3692 The following command creates a writable file system whose initial contents are
3693 the same as
3694 .Em pool/home/bob@yesterday .
3695 .Bd -literal
3696 # zfs clone pool/home/bob@yesterday pool/clone
3698 .It Sy Example 10 No Promoting a ZFS Clone
3699 The following commands illustrate how to test out changes to a file system, and
3700 then replace the original file system with the changed one, using clones, clone
3701 promotion, and renaming:
3702 .Bd -literal
3703 # zfs create pool/project/production
3704   populate /pool/project/production with data
3705 # zfs snapshot pool/project/production@today
3706 # zfs clone pool/project/production@today pool/project/beta
3707   make changes to /pool/project/beta and test them
3708 # zfs promote pool/project/beta
3709 # zfs rename pool/project/production pool/project/legacy
3710 # zfs rename pool/project/beta pool/project/production
3711   once the legacy version is no longer needed, it can be destroyed
3712 # zfs destroy pool/project/legacy
3714 .It Sy Example 11 No Inheriting ZFS Properties
3715 The following command causes
3716 .Em pool/home/bob
3718 .Em pool/home/anne
3719 to inherit the
3720 .Sy checksum
3721 property from their parent.
3722 .Bd -literal
3723 # zfs inherit checksum pool/home/bob pool/home/anne
3725 .It Sy Example 12 No Remotely Replicating ZFS Data
3726 The following commands send a full stream and then an incremental stream to a
3727 remote machine, restoring them into
3728 .Em poolB/received/fs@a
3730 .Em poolB/received/fs@b ,
3731 respectively.
3732 .Em poolB
3733 must contain the file system
3734 .Em poolB/received ,
3735 and must not initially contain
3736 .Em poolB/received/fs .
3737 .Bd -literal
3738 # zfs send pool/fs@a | \e
3739   ssh host zfs receive poolB/received/fs@a
3740 # zfs send -i a pool/fs@b | \e
3741   ssh host zfs receive poolB/received/fs
3743 .It Sy Example 13 No Using the zfs receive -d Option
3744 The following command sends a full stream of
3745 .Em poolA/fsA/fsB@snap
3746 to a remote machine, receiving it into
3747 .Em poolB/received/fsA/fsB@snap .
3749 .Em fsA/fsB@snap
3750 portion of the received snapshot's name is determined from the name of the sent
3751 snapshot.
3752 .Em poolB
3753 must contain the file system
3754 .Em poolB/received .
3756 .Em poolB/received/fsA
3757 does not exist, it is created as an empty file system.
3758 .Bd -literal
3759 # zfs send poolA/fsA/fsB@snap | \e
3760   ssh host zfs receive -d poolB/received
3762 .It Sy Example 14 No Setting User Properties
3763 The following example sets the user-defined
3764 .Sy com.example:department
3765 property for a dataset.
3766 .Bd -literal
3767 # zfs set com.example:department=12345 tank/accounting
3769 .It Sy Example 15 No Performing a Rolling Snapshot
3770 The following example shows how to maintain a history of snapshots with a
3771 consistent naming scheme.
3772 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
3773 renames the remaining snapshots, and then creates a new snapshot, as follows:
3774 .Bd -literal
3775 # zfs destroy -r pool/users@7daysago
3776 # zfs rename -r pool/users@6daysago @7daysago
3777 # zfs rename -r pool/users@5daysago @6daysago
3778 # zfs rename -r pool/users@yesterday @5daysago
3779 # zfs rename -r pool/users@yesterday @4daysago
3780 # zfs rename -r pool/users@yesterday @3daysago
3781 # zfs rename -r pool/users@yesterday @2daysago
3782 # zfs rename -r pool/users@today @yesterday
3783 # zfs snapshot -r pool/users@today
3785 .It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
3786 The following commands show how to set
3787 .Sy sharenfs
3788 property options to enable
3789 .Sy rw
3790 access for a set of
3791 .Sy IP
3792 addresses and to enable root access for system
3793 .Sy neo
3794 on the
3795 .Em tank/home
3796 file system.
3797 .Bd -literal
3798 # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
3801 If you are using
3802 .Sy DNS
3803 for host name resolution, specify the fully qualified hostname.
3804 .It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
3805 The following example shows how to set permissions so that user
3806 .Sy cindys
3807 can create, destroy, mount, and take snapshots on
3808 .Em tank/cindys .
3809 The permissions on
3810 .Em tank/cindys
3811 are also displayed.
3812 .Bd -literal
3813 # zfs allow cindys create,destroy,mount,snapshot tank/cindys
3814 # zfs allow tank/cindys
3815 ---- Permissions on tank/cindys --------------------------------------
3816 Local+Descendent permissions:
3817         user cindys create,destroy,mount,snapshot
3820 Because the
3821 .Em tank/cindys
3822 mount point permission is set to 755 by default, user
3823 .Sy cindys
3824 will be unable to mount file systems under
3825 .Em tank/cindys .
3826 Add an ACE similar to the following syntax to provide mount point access:
3827 .Bd -literal
3828 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
3830 .It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
3831 The following example shows how to grant anyone in the group
3832 .Sy staff
3833 to create file systems in
3834 .Em tank/users .
3835 This syntax also allows staff members to destroy their own file systems, but not
3836 destroy anyone else's file system.
3837 The permissions on
3838 .Em tank/users
3839 are also displayed.
3840 .Bd -literal
3841 # zfs allow staff create,mount tank/users
3842 # zfs allow -c destroy tank/users
3843 # zfs allow tank/users
3844 ---- Permissions on tank/users ---------------------------------------
3845 Permission sets:
3846         destroy
3847 Local+Descendent permissions:
3848         group staff create,mount
3850 .It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
3851 The following example shows how to define and grant a permission set on the
3852 .Em tank/users
3853 file system.
3854 The permissions on
3855 .Em tank/users
3856 are also displayed.
3857 .Bd -literal
3858 # zfs allow -s @pset create,destroy,snapshot,mount tank/users
3859 # zfs allow staff @pset tank/users
3860 # zfs allow tank/users
3861 ---- Permissions on tank/users ---------------------------------------
3862 Permission sets:
3863         @pset create,destroy,mount,snapshot
3864 Local+Descendent permissions:
3865         group staff @pset
3867 .It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
3868 The following example shows to grant the ability to set quotas and reservations
3869 on the
3870 .Em users/home
3871 file system.
3872 The permissions on
3873 .Em users/home
3874 are also displayed.
3875 .Bd -literal
3876 # zfs allow cindys quota,reservation users/home
3877 # zfs allow users/home
3878 ---- Permissions on users/home ---------------------------------------
3879 Local+Descendent permissions:
3880         user cindys quota,reservation
3881 cindys% zfs set quota=10G users/home/marks
3882 cindys% zfs get quota users/home/marks
3883 NAME              PROPERTY  VALUE  SOURCE
3884 users/home/marks  quota     10G    local
3886 .It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
3887 The following example shows how to remove the snapshot permission from the
3888 .Sy staff
3889 group on the
3890 .Em tank/users
3891 file system.
3892 The permissions on
3893 .Em tank/users
3894 are also displayed.
3895 .Bd -literal
3896 # zfs unallow staff snapshot tank/users
3897 # zfs allow tank/users
3898 ---- Permissions on tank/users ---------------------------------------
3899 Permission sets:
3900         @pset create,destroy,mount,snapshot
3901 Local+Descendent permissions:
3902         group staff @pset
3904 .It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
3905 The following example shows how to see what has changed between a prior
3906 snapshot of a ZFS dataset and its current state.
3908 .Fl F
3909 option is used to indicate type information for the files affected.
3910 .Bd -literal
3911 # zfs diff -F tank/test@before tank/test
3912 M       /       /tank/test/
3913 M       F       /tank/test/linked      (+1)
3914 R       F       /tank/test/oldname -> /tank/test/newname
3915 -       F       /tank/test/deleted
3916 +       F       /tank/test/created
3917 M       F       /tank/test/modified
3920 .Sh INTERFACE STABILITY
3921 .Sy Committed .
3922 .Sh SEE ALSO
3923 .Xr gzip 1 ,
3924 .Xr ssh 1 ,
3925 .Xr mount 8 ,
3926 .Xr share 8 ,
3927 .Xr sharemgr 8 ,
3928 .Xr unshare 8 ,
3929 .Xr zonecfg 8 ,
3930 .Xr zpool 8 ,
3931 .Xr chmod 2 ,
3932 .Xr stat 2 ,
3933 .Xr write 2 ,
3934 .Xr fsync 3C ,
3935 .Xr dfstab 4 ,
3936 .Xr acl 5 ,
3937 .Xr attributes 5