]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zfs.8
Clarify and improve encryption documentation
[mirror_zfs.git] / man / man8 / zfs.8
CommitLineData
5990da81
YP
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.\"
058ac9ba 22.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
5990da81 23.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
c568ab8d 24.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
9759c60f 25.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
44f09cdc
BB
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]
9810410a 29.\" Copyright 2019 Richard Laager. All rights reserved.
cb110f25 30.\" Copyright 2018 Nexenta Systems, Inc.
d22f3a82 31.\" Copyright 2018 Joyent, Inc.
5990da81 32.\"
22448f08 33.Dd Jan 05, 2019
44f09cdc
BB
34.Dt ZFS 8 SMM
35.Os Linux
36.Sh NAME
37.Nm zfs
38.Nd configures ZFS file systems
39.Sh SYNOPSIS
40.Nm
50478c6d 41.Fl ?V
44f09cdc
BB
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
90cdf283 68.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
44f09cdc
BB
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 ...
105.Nm
106.Cm set
107.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
108.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
109.Nm
110.Cm get
111.Op Fl r Ns | Ns Fl d Ar depth
112.Op Fl Hp
113.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
114.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
115.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
116.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
48b0b649 117.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns ...
44f09cdc
BB
118.Nm
119.Cm inherit
120.Op Fl rS
121.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
122.Nm
123.Cm upgrade
124.Nm
125.Cm upgrade
126.Fl v
127.Nm
128.Cm upgrade
129.Op Fl r
130.Op Fl V Ar version
131.Fl a | Ar filesystem
132.Nm
133.Cm userspace
134.Op Fl Hinp
135.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
136.Oo Fl s Ar field Oc Ns ...
137.Oo Fl S Ar field Oc Ns ...
138.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
139.Ar filesystem Ns | Ns Ar snapshot
140.Nm
141.Cm groupspace
142.Op Fl Hinp
143.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
144.Oo Fl s Ar field Oc Ns ...
145.Oo Fl S Ar field Oc Ns ...
146.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
147.Ar filesystem Ns | Ns Ar snapshot
148.Nm
9c5167d1
NF
149.Cm projectspace
150.Op Fl Hp
151.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
152.Oo Fl s Ar field Oc Ns ...
153.Oo Fl S Ar field Oc Ns ...
154.Ar filesystem Ns | Ns Ar snapshot
155.Nm
156.Cm project
157.Oo Fl d Ns | Ns Fl r Ns Oc
158.Ar file Ns | Ns Ar directory Ns ...
159.Nm
160.Cm project
161.Fl C
162.Oo Fl kr Ns Oc
163.Ar file Ns | Ns Ar directory Ns ...
164.Nm
165.Cm project
166.Fl c
167.Oo Fl 0 Ns Oc
168.Oo Fl d Ns | Ns Fl r Ns Oc
169.Op Fl p Ar id
170.Ar file Ns | Ns Ar directory Ns ...
171.Nm
172.Cm project
173.Op Fl p Ar id
174.Oo Fl rs Ns Oc
175.Ar file Ns | Ns Ar directory Ns ...
176.Nm
44f09cdc
BB
177.Cm mount
178.Nm
179.Cm mount
b5256303 180.Op Fl Olv
44f09cdc
BB
181.Op Fl o Ar options
182.Fl a | Ar filesystem
183.Nm
184.Cm unmount
185.Op Fl f
186.Fl a | Ar filesystem Ns | Ns Ar mountpoint
187.Nm
188.Cm share
189.Fl a | Ar filesystem
190.Nm
191.Cm unshare
192.Fl a | Ar filesystem Ns | Ns Ar mountpoint
193.Nm
194.Cm bookmark
195.Ar snapshot bookmark
196.Nm
197.Cm send
9c5e88b1 198.Op Fl DLPRbcehnpvw
44f09cdc
BB
199.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
200.Ar snapshot
201.Nm
202.Cm send
835db585 203.Op Fl LPcenvw
44f09cdc
BB
204.Op Fl i Ar snapshot Ns | Ns Ar bookmark
205.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
206.Nm
207.Cm send
208.Op Fl Penv
209.Fl t Ar receive_resume_token
210.Nm
211.Cm receive
9c5e88b1 212.Op Fl Fhnsuv
44f09cdc
BB
213.Op Fl o Sy origin Ns = Ns Ar snapshot
214.Op Fl o Ar property Ns = Ns Ar value
215.Op Fl x Ar property
216.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
217.Nm
218.Cm receive
9c5e88b1 219.Op Fl Fhnsuv
44f09cdc
BB
220.Op Fl d Ns | Ns Fl e
221.Op Fl o Sy origin Ns = Ns Ar snapshot
222.Op Fl o Ar property Ns = Ns Ar value
223.Op Fl x Ar property
224.Ar filesystem
225.Nm
226.Cm receive
227.Fl A
228.Ar filesystem Ns | Ns Ar volume
229.Nm
230.Cm allow
231.Ar filesystem Ns | Ns Ar volume
232.Nm
233.Cm allow
234.Op Fl dglu
235.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
236.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
237.Ar setname Oc Ns ...
238.Ar filesystem Ns | Ns Ar volume
239.Nm
240.Cm allow
241.Op Fl dl
242.Fl e Ns | Ns Sy everyone
243.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
244.Ar setname Oc Ns ...
245.Ar filesystem Ns | Ns Ar volume
246.Nm
247.Cm allow
248.Fl c
249.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
250.Ar setname Oc Ns ...
251.Ar filesystem Ns | Ns Ar volume
252.Nm
253.Cm allow
254.Fl s No @ Ns Ar setname
255.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
256.Ar setname Oc Ns ...
257.Ar filesystem Ns | Ns Ar volume
258.Nm
259.Cm unallow
260.Op Fl dglru
261.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
262.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
263.Ar setname Oc Ns ... Oc
264.Ar filesystem Ns | Ns Ar volume
265.Nm
266.Cm unallow
267.Op Fl dlr
268.Fl e Ns | Ns Sy everyone
269.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
270.Ar setname Oc Ns ... Oc
271.Ar filesystem Ns | Ns Ar volume
272.Nm
273.Cm unallow
274.Op Fl r
275.Fl c
276.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
277.Ar setname Oc Ns ... Oc
278.Ar filesystem Ns | Ns Ar volume
279.Nm
280.Cm unallow
281.Op Fl r
282.Fl s @ Ns Ar setname
283.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
284.Ar setname Oc Ns ... Oc
285.Ar filesystem Ns | Ns Ar volume
286.Nm
287.Cm hold
288.Op Fl r
289.Ar tag Ar snapshot Ns ...
290.Nm
291.Cm holds
a9d6270a 292.Op Fl rH
44f09cdc
BB
293.Ar snapshot Ns ...
294.Nm
295.Cm release
296.Op Fl r
297.Ar tag Ar snapshot Ns ...
298.Nm
299.Cm diff
300.Op Fl FHt
301.Ar snapshot Ar snapshot Ns | Ns Ar filesystem
b5256303 302.Nm
d99a0153 303.Cm program
272b5d73 304.Op Fl jn
c568ab8d
MA
305.Op Fl t Ar instruction-limit
306.Op Fl m Ar memory-limit
d99a0153
CW
307.Ar pool script
308.Op Ar arg1 No ...
309.Nm
b5256303
TC
310.Cm load-key
311.Op Fl nr
312.Op Fl L Ar keylocation
313.Fl a | Ar filesystem
314.Nm
315.Cm unload-key
316.Op Fl r
317.Fl a | Ar filesystem
318.Nm
319.Cm change-key
320.Op Fl l
321.Op Fl o Ar keylocation Ns = Ns Ar value
322.Op Fl o Ar keyformat Ns = Ns Ar value
323.Op Fl o Ar pbkdf2iters Ns = Ns Ar value
324.Ar filesystem
325.Nm
326.Cm change-key
327.Fl i
328.Op Fl l
329.Ar filesystem
50478c6d
T
330.Nm
331.Cm version
44f09cdc
BB
332.Sh DESCRIPTION
333The
334.Nm
335command configures ZFS datasets within a ZFS storage pool, as described in
336.Xr zpool 8 .
337A dataset is identified by a unique path within the ZFS namespace.
338For example:
339.Bd -literal
058ac9ba 340pool/{filesystem,volume,snapshot}
44f09cdc
BB
341.Ed
342.Pp
343where the maximum length of a dataset name is
344.Dv MAXNAMELEN
a7ed98d8
SD
345.Pq 256 bytes
346and the maximum amount of nesting allowed in a path is 50 levels deep.
44f09cdc 347.Pp
058ac9ba 348A dataset can be one of the following:
44f09cdc
BB
349.Bl -tag -width "file system"
350.It Sy file system
351A ZFS dataset of type
352.Sy filesystem
353can be mounted within the standard system namespace and behaves like other file
354systems.
355While ZFS file systems are designed to be POSIX compliant, known issues exist
356that prevent compliance in some cases.
357Applications that depend on standards conformance might fail due to non-standard
358behavior when checking file system free space.
359.It Sy volume
360A logical volume exported as a raw or block device.
9810410a 361This type of dataset should only be used when a block device is required.
44f09cdc
BB
362File systems are typically used in most environments.
363.It Sy snapshot
364A read-only version of a file system or volume at a given point in time.
365It is specified as
366.Ar filesystem Ns @ Ns Ar name
367or
368.Ar volume Ns @ Ns Ar name .
369.It Sy bookmark
370Much like a
371.Sy snapshot ,
372but without the hold on on-disk data. It can be used as the source of a send
373(but not for a receive). It is specified as
374.Ar filesystem Ns # Ns Ar name
375or
376.Ar volume Ns # Ns Ar name .
377.El
378.Ss ZFS File System Hierarchy
379A ZFS storage pool is a logical collection of devices that provide space for
380datasets.
381A storage pool is also the root of the ZFS file system hierarchy.
382.Pp
383The root of the pool can be accessed as a file system, such as mounting and
384unmounting, taking snapshots, and setting properties.
385The physical storage characteristics, however, are managed by the
386.Xr zpool 8
387command.
388.Pp
389See
390.Xr zpool 8
391for more information on creating and administering pools.
392.Ss Snapshots
393A snapshot is a read-only copy of a file system or volume.
394Snapshots can be created extremely quickly, and initially consume no additional
395space within the pool.
396As data within the active dataset changes, the snapshot consumes more data than
397would otherwise be shared with the active dataset.
398.Pp
399Snapshots can have arbitrary names.
400Snapshots of volumes can be cloned or rolled back, visibility is determined
401by the
402.Sy snapdev
403property of the parent volume.
404.Pp
405File system snapshots can be accessed under the
406.Pa .zfs/snapshot
407directory in the root of the file system.
408Snapshots are automatically mounted on demand and may be unmounted at regular
409intervals.
410The visibility of the
411.Pa .zfs
412directory can be controlled by the
413.Sy snapdir
414property.
415.Ss Bookmarks
416A bookmark is like a snapshot, a read-only copy of a file system or volume.
417Bookmarks can be created extremely quickly, compared to snapshots, and they
418consume no additional space within the pool. Bookmarks can also have arbitrary
419names, much like snapshots.
420.Pp
421Unlike snapshots, bookmarks can not be accessed through the filesystem in any
422way. From a storage standpoint a bookmark just provides a way to reference
423when a snapshot was created as a distinct object. Bookmarks are initially
424tied to a snapshot, not the filesystem or volume, and they will survive if the
425snapshot itself is destroyed. Since they are very light weight there's little
426incentive to destroy them.
427.Ss Clones
428A clone is a writable volume or file system whose initial contents are the same
429as another dataset.
430As with snapshots, creating a clone is nearly instantaneous, and initially
431consumes no additional space.
432.Pp
433Clones can only be created from a snapshot.
434When a snapshot is cloned, it creates an implicit dependency between the parent
435and child.
436Even though the clone is created somewhere else in the dataset hierarchy, the
437original snapshot cannot be destroyed as long as a clone exists.
438The
439.Sy origin
440property exposes this dependency, and the
441.Cm destroy
442command lists any such dependencies, if they exist.
443.Pp
444The clone parent-child dependency relationship can be reversed by using the
445.Cm promote
446subcommand.
447This causes the
448.Qq origin
449file system to become a clone of the specified file system, which makes it
450possible to destroy the file system that the clone was created from.
451.Ss "Mount Points"
452Creating a ZFS file system is a simple operation, so the number of file systems
453per system is likely to be numerous.
454To cope with this, ZFS automatically manages mounting and unmounting file
455systems without the need to edit the
456.Pa /etc/fstab
457file.
458All automatically managed file systems are mounted by ZFS at boot time.
459.Pp
460By default, file systems are mounted under
461.Pa /path ,
462where
463.Ar path
464is the name of the file system in the ZFS namespace.
465Directories are created and destroyed as needed.
466.Pp
467A file system can also have a mount point set in the
468.Sy mountpoint
469property.
470This directory is created as needed, and ZFS automatically mounts the file
471system when the
472.Nm zfs Cm mount Fl a
473command is invoked
474.Po without editing
475.Pa /etc/fstab
476.Pc .
477The
478.Sy mountpoint
479property can be inherited, so if
480.Em pool/home
481has a mount point of
482.Pa /export/stuff ,
483then
484.Em pool/home/user
485automatically inherits a mount point of
486.Pa /export/stuff/user .
487.Pp
488A file system
489.Sy mountpoint
490property of
491.Sy none
492prevents the file system from being mounted.
493.Pp
494If needed, ZFS file systems can also be managed with traditional tools
495.Po
496.Nm mount ,
497.Nm umount ,
498.Pa /etc/fstab
499.Pc .
500If a file system's mount point is set to
501.Sy legacy ,
502ZFS makes no attempt to manage the file system, and the administrator is
5c2552c5
AR
503responsible for mounting and unmounting the file system. Because pools must
504be imported before a legacy mount can succeed, administrators should ensure
505that legacy mounts are only attempted after the zpool import process
506finishes at boot time. For example, on machines using systemd, the mount
507option
508.Pp
509.Nm x-systemd.requires=zfs-import.target
510.Pp
511will ensure that the zfs-import completes before systemd attempts mounting
512the filesystem. See systemd.mount(5) for details.
44f09cdc
BB
513.Ss Deduplication
514Deduplication is the process for removing redundant data at the block level,
515reducing the total amount of data stored. If a file system has the
516.Sy dedup
517property enabled, duplicate data blocks are removed synchronously. The result
518is that only unique data is stored and common components are shared among files.
519.Pp
520Deduplicating data is a very resource-intensive operation. It is generally
521recommended that you have at least 1.25 GiB of RAM per 1 TiB of storage when
522you enable deduplication. Calculating the exact requirement depends heavily
523on the type of data stored in the pool.
524.Pp
525Enabling deduplication on an improperly-designed system can result in
526performance issues (slow IO and administrative operations). It can potentially
527lead to problems importing a pool due to memory exhaustion. Deduplication
528can consume significant processing power (CPU) and memory as well as generate
529additional disk IO.
530.Pp
531Before creating a pool with deduplication enabled, ensure that you have planned
532your hardware requirements appropriately and implemented appropriate recovery
533practices, such as regular backups. As an alternative to deduplication
534consider using
57858fb5 535.Sy compression=on ,
44f09cdc
BB
536as a less resource-intensive alternative.
537.Ss Native Properties
538Properties are divided into two types, native properties and user-defined
539.Po or
540.Qq user
541.Pc
542properties.
543Native properties either export internal statistics or control ZFS behavior.
544In addition, native properties are either editable or read-only.
545User properties have no effect on ZFS behavior, but you can use them to annotate
546datasets in a way that is meaningful in your environment.
547For more information about user properties, see the
548.Sx User Properties
549section, below.
550.Pp
551Every dataset has a set of properties that export statistics about the dataset
552as well as control various behaviors.
553Properties are inherited from the parent unless overridden by the child.
554Some properties apply only to certain types of datasets
555.Pq file systems, volumes, or snapshots .
556.Pp
557The values of numeric properties can be specified using human-readable suffixes
558.Po for example,
559.Sy k ,
560.Sy KB ,
561.Sy M ,
562.Sy Gb ,
563and so forth, up to
564.Sy Z
565for zettabyte
566.Pc .
567The following are all valid
568.Pq and equal
569specifications:
570.Li 1536M, 1.5g, 1.50GB .
571.Pp
572The values of non-numeric properties are case sensitive and must be lowercase,
573except for
574.Sy mountpoint ,
575.Sy sharenfs ,
576and
577.Sy sharesmb .
578.Pp
579The following native properties consist of read-only statistics about the
580dataset.
581These properties can be neither set, nor inherited.
582Native properties apply to all dataset types unless otherwise noted.
583.Bl -tag -width "usedbyrefreservation"
584.It Sy available
585The amount of space available to the dataset and all its children, assuming that
586there is no other activity in the pool.
587Because space is shared within a pool, availability can be limited by any number
588of factors, including physical pool size, quotas, reservations, or other
589datasets within the pool.
590.Pp
591This property can also be referred to by its shortened column name,
592.Sy avail .
593.It Sy compressratio
594For non-snapshots, the compression ratio achieved for the
595.Sy used
596space of this dataset, expressed as a multiplier.
597The
598.Sy used
599property includes descendant datasets, and, for clones, does not include the
600space shared with the origin snapshot.
601For snapshots, the
602.Sy compressratio
603is the same as the
604.Sy refcompressratio
605property.
606Compression can be turned on by running:
607.Nm zfs Cm set Sy compression Ns = Ns Sy on Ar dataset .
608The default value is
609.Sy off .
610.It Sy createtxg
611The transaction group (txg) in which the dataset was created. Bookmarks have
612the same
613.Sy createtxg
614as the snapshot they are initially tied to. This property is suitable for
615ordering a list of snapshots, e.g. for incremental send and receive.
616.It Sy creation
058ac9ba 617The time this dataset was created.
44f09cdc
BB
618.It Sy clones
619For snapshots, this property is a comma-separated list of filesystems or volumes
620which are clones of this snapshot.
621The clones'
622.Sy origin
623property is this snapshot.
624If the
625.Sy clones
626property is not empty, then this snapshot can not be destroyed
627.Po even with the
628.Fl r
629or
630.Fl f
631options
632.Pc .
633The roles of origin and clone can be swapped by promoting the clone with the
634.Nm zfs Cm promote
635command.
636.It Sy defer_destroy
637This property is
638.Sy on
639if the snapshot has been marked for deferred destroy by using the
640.Nm zfs Cm destroy Fl d
641command.
642Otherwise, the property is
643.Sy off .
b5256303
TC
644.It Sy encryptionroot
645For encrypted datasets, indicates where the dataset is currently inheriting its
646encryption key from. Loading or unloading a key for the
647.Sy encryptionroot
648will implicitly load / unload the key for any inheriting datasets (see
649.Nm zfs Cm load-key
650and
651.Nm zfs Cm unload-key
652for details).
653Clones will always share an
654encryption key with their origin. See the
655.Sx Encryption
656section for details.
44f09cdc
BB
657.It Sy filesystem_count
658The total number of filesystems and volumes that exist under this location in
659the dataset tree.
660This value is only available when a
661.Sy filesystem_limit
662has been set somewhere in the tree under which the dataset resides.
b5256303
TC
663.It Sy keystatus
664Indicates if an encryption key is currently loaded into ZFS. The possible
665values are
666.Sy none ,
667.Sy available ,
668and
669.Sy unavailable .
670See
671.Nm zfs Cm load-key
672and
673.Nm zfs Cm unload-key .
44f09cdc
BB
674.It Sy guid
675The 64 bit GUID of this dataset or bookmark which does not change over its
676entire lifetime. When a snapshot is sent to another pool, the received
677snapshot has the same GUID. Thus, the
678.Sy guid
679is suitable to identify a snapshot across pools.
680.It Sy logicalreferenced
681The amount of space that is
682.Qq logically
683accessible by this dataset.
684See the
685.Sy referenced
686property.
687The logical space ignores the effect of the
688.Sy compression
689and
690.Sy copies
691properties, giving a quantity closer to the amount of data that applications
692see.
693However, it does include space consumed by metadata.
694.Pp
24a64651 695This property can also be referred to by its shortened column name,
44f09cdc
BB
696.Sy lrefer .
697.It Sy logicalused
698The amount of space that is
699.Qq logically
700consumed by this dataset and all its descendents.
701See the
702.Sy used
703property.
704The logical space ignores the effect of the
705.Sy compression
706and
707.Sy copies
708properties, giving a quantity closer to the amount of data that applications
709see.
24a64651 710However, it does include space consumed by metadata.
44f09cdc 711.Pp
24a64651 712This property can also be referred to by its shortened column name,
44f09cdc
BB
713.Sy lused .
714.It Sy mounted
715For file systems, indicates whether the file system is currently mounted.
716This property can be either
717.Sy yes
718or
719.Sy no .
a448a255
SD
720.It Sy objsetid
721A unique identifier for this dataset within the pool. Unlike the dataset's
722.Sy guid
723, the
724.Sy objsetid
725of a dataset is not transferred to other pools when the snapshot is copied
726with a send/receive operation.
727The
728.Sy objsetid
729can be reused (for a new datatset) after the dataset is deleted.
44f09cdc
BB
730.It Sy origin
731For cloned file systems or volumes, the snapshot from which the clone was
732created.
733See also the
734.Sy clones
f5fc4aca 735property.
44f09cdc
BB
736.It Sy receive_resume_token
737For filesystems or volumes which have saved partially-completed state from
738.Sy zfs receive -s ,
739this opaque token can be provided to
740.Sy zfs send -t
741to resume and complete the
742.Sy zfs receive .
743.It Sy referenced
744The amount of data that is accessible by this dataset, which may or may not be
745shared with other datasets in the pool.
746When a snapshot or clone is created, it initially references the same amount of
747space as the file system or snapshot it was created from, since its contents are
748identical.
749.Pp
750This property can also be referred to by its shortened column name,
751.Sy refer .
752.It Sy refcompressratio
753The compression ratio achieved for the
754.Sy referenced
755space of this dataset, expressed as a multiplier.
756See also the
757.Sy compressratio
758property.
759.It Sy snapshot_count
760The total number of snapshots that exist under this location in the dataset
761tree.
762This value is only available when a
763.Sy snapshot_limit
764has been set somewhere in the tree under which the dataset resides.
765.It Sy type
766The type of dataset:
767.Sy filesystem ,
768.Sy volume ,
769or
770.Sy snapshot .
771.It Sy used
772The amount of space consumed by this dataset and all its descendents.
773This is the value that is checked against this dataset's quota and reservation.
774The space used does not include this dataset's reservation, but does take into
775account the reservations of any descendent datasets.
776The amount of space that a dataset consumes from its parent, as well as the
777amount of space that is freed if this dataset is recursively destroyed, is the
778greater of its space used and its reservation.
779.Pp
780The used space of a snapshot
781.Po see the
782.Sx Snapshots
783section
784.Pc
785is space that is referenced exclusively by this snapshot.
786If this snapshot is destroyed, the amount of
787.Sy used
788space will be freed.
789Space that is shared by multiple snapshots isn't accounted for in this metric.
790When a snapshot is destroyed, space that was previously shared with this
791snapshot can become unique to snapshots adjacent to it, thus changing the used
792space of those snapshots.
793The used space of the latest snapshot can also be affected by changes in the
794file system.
795Note that the
796.Sy used
797space of a snapshot is a subset of the
798.Sy written
799space of the snapshot.
800.Pp
801The amount of space used, available, or referenced does not take into account
802pending changes.
803Pending changes are generally accounted for within a few seconds.
804Committing a change to a disk using
805.Xr fsync 2
806or
807.Dv O_SYNC
808does not necessarily guarantee that the space usage information is updated
809immediately.
810.It Sy usedby*
811The
812.Sy usedby*
813properties decompose the
814.Sy used
815properties into the various reasons that space is used.
816Specifically,
817.Sy used No =
818.Sy usedbychildren No +
819.Sy usedbydataset No +
820.Sy usedbyrefreservation No +
821.Sy usedbysnapshots .
822These properties are only available for datasets created on
823.Nm zpool
824.Qo version 13 Qc
825pools.
826.It Sy usedbychildren
827The amount of space used by children of this dataset, which would be freed if
828all the dataset's children were destroyed.
829.It Sy usedbydataset
830The amount of space used by this dataset itself, which would be freed if the
831dataset were destroyed
832.Po after first removing any
833.Sy refreservation
834and destroying any necessary snapshots or descendents
835.Pc .
836.It Sy usedbyrefreservation
837The amount of space used by a
838.Sy refreservation
839set on this dataset, which would be freed if the
840.Sy refreservation
841was removed.
842.It Sy usedbysnapshots
843The amount of space consumed by snapshots of this dataset.
844In particular, it is the amount of space that would be freed if all of this
845dataset's snapshots were destroyed.
846Note that this is not simply the sum of the snapshots'
847.Sy used
848properties because space can be shared by multiple snapshots.
849.It Sy userused Ns @ Ns Em user
850The amount of space consumed by the specified user in this dataset.
851Space is charged to the owner of each file, as displayed by
852.Nm ls Fl l .
853The amount of space charged is displayed by
854.Nm du
855and
856.Nm ls Fl s .
857See the
858.Nm zfs Cm userspace
859subcommand for more information.
860.Pp
861Unprivileged users can access only their own space usage.
862The root user, or a user who has been granted the
863.Sy userused
864privilege with
865.Nm zfs Cm allow ,
866can access everyone's usage.
867.Pp
868The
869.Sy userused Ns @ Ns Em ...
870properties are not displayed by
871.Nm zfs Cm get Sy all .
872The user's name must be appended after the @ symbol, using one of the following
873forms:
874.Bl -bullet -width ""
875.It
876.Em POSIX name
877.Po for example,
878.Sy joe
879.Pc
880.It
881.Em POSIX numeric ID
882.Po for example,
883.Sy 789
884.Pc
885.It
886.Em SID name
887.Po for example,
888.Sy joe.smith@mydomain
889.Pc
890.It
891.Em SID numeric ID
892.Po for example,
893.Sy S-1-123-456-789
894.Pc
895.El
896.Pp
f974e414 897Files created on Linux always have POSIX owners.
44f09cdc
BB
898.It Sy userobjused Ns @ Ns Em user
899The
900.Sy userobjused
901property is similar to
902.Sy userused
903but instead it counts the number of objects consumed by a user. This property
904counts all objects allocated on behalf of the user, it may differ from the
905results of system tools such as
906.Nm df Fl i .
907.Pp
908When the property
909.Sy xattr=on
910is set on a file system additional objects will be created per-file to store
911extended attributes. These additional objects are reflected in the
912.Sy userobjused
913value and are counted against the user's
914.Sy userobjquota .
915When a file system is configured to use
916.Sy xattr=sa
917no additional internal objects are normally required.
918.It Sy userrefs
919This property is set to the number of user holds on this snapshot.
920User holds are set by using the
921.Nm zfs Cm hold
922command.
923.It Sy groupused Ns @ Ns Em group
924The amount of space consumed by the specified group in this dataset.
925Space is charged to the group of each file, as displayed by
926.Nm ls Fl l .
927See the
928.Sy userused Ns @ Ns Em user
929property for more information.
930.Pp
931Unprivileged users can only access their own groups' space usage.
932The root user, or a user who has been granted the
933.Sy groupused
934privilege with
935.Nm zfs Cm allow ,
936can access all groups' usage.
937.It Sy groupobjused Ns @ Ns Em group
938The number of objects consumed by the specified group in this dataset.
939Multiple objects may be charged to the group for each file when extended
940attributes are in use. See the
941.Sy userobjused Ns @ Ns Em user
942property for more information.
943.Pp
944Unprivileged users can only access their own groups' space usage.
945The root user, or a user who has been granted the
946.Sy groupobjused
947privilege with
948.Nm zfs Cm allow ,
949can access all groups' usage.
9c5167d1
NF
950.It Sy projectused Ns @ Ns Em project
951The amount of space consumed by the specified project in this dataset. Project
952is identified via the project identifier (ID) that is object-based numeral
953attribute. An object can inherit the project ID from its parent object (if the
954parent has the flag of inherit project ID that can be set and changed via
955.Nm chattr Fl /+P
956or
957.Nm zfs project Fl s )
958when being created. The privileged user can set and change object's project
959ID via
960.Nm chattr Fl p
961or
962.Nm zfs project Fl s
963anytime. Space is charged to the project of each file, as displayed by
964.Nm lsattr Fl p
965or
966.Nm zfs project .
967See the
968.Sy userused Ns @ Ns Em user
969property for more information.
970.Pp
971The root user, or a user who has been granted the
972.Sy projectused
973privilege with
974.Nm zfs allow ,
975can access all projects' usage.
976.It Sy projectobjused Ns @ Ns Em project
977The
978.Sy projectobjused
979is similar to
980.Sy projectused
981but instead it counts the number of objects consumed by project. When the
982property
983.Sy xattr=on
984is set on a fileset, ZFS will create additional objects per-file to store
985extended attributes. These additional objects are reflected in the
986.Sy projectobjused
987value and are counted against the project's
988.Sy projectobjquota .
989When a filesystem is configured to use
990.Sy xattr=sa
991no additional internal objects are required. See the
992.Sy userobjused Ns @ Ns Em user
993property for more information.
994.Pp
995The root user, or a user who has been granted the
996.Sy projectobjused
997privilege with
998.Nm zfs allow ,
999can access all projects' objects usage.
44f09cdc
BB
1000.It Sy volblocksize
1001For volumes, specifies the block size of the volume.
1002The
1003.Sy blocksize
1004cannot be changed once the volume has been written, so it should be set at
1005volume creation time.
1006The default
1007.Sy blocksize
1008for volumes is 8 Kbytes.
1009Any power of 2 from 512 bytes to 128 Kbytes is valid.
1010.Pp
1011This property can also be referred to by its shortened column name,
1012.Sy volblock .
1013.It Sy written
1014The amount of space
1015.Sy referenced
1016by this dataset, that was written since the previous snapshot
1017.Pq i.e. that is not referenced by the previous snapshot .
1018.It Sy written Ns @ Ns Em snapshot
1019The amount of
1020.Sy referenced
1021space written to this dataset since the specified snapshot.
1022This is the space that is referenced by this dataset but was not referenced by
1023the specified snapshot.
1024.Pp
1025The
1026.Em snapshot
1027may be specified as a short snapshot name
1028.Po just the part after the
1029.Sy @
1030.Pc ,
1031in which case it will be interpreted as a snapshot in the same filesystem as
1032this dataset.
1033The
1034.Em snapshot
1035may be a full snapshot name
1036.Po Em filesystem Ns @ Ns Em snapshot Pc ,
1037which for clones may be a snapshot in the origin's filesystem
1038.Pq or the origin of the origin's filesystem, etc.
1039.El
1040.Pp
1041The following native properties can be used to change the behavior of a ZFS
1042dataset.
1043.Bl -tag -width ""
1044.It Xo
1045.Sy aclinherit Ns = Ns Sy discard Ns | Ns Sy noallow Ns | Ns
1046.Sy restricted Ns | Ns Sy passthrough Ns | Ns Sy passthrough-x
1047.Xc
1048Controls how ACEs are inherited when files and directories are created.
1049.Bl -tag -width "passthrough-x"
1050.It Sy discard
1051does not inherit any ACEs.
1052.It Sy noallow
1053only inherits inheritable ACEs that specify
1054.Qq deny
1055permissions.
1056.It Sy restricted
1057default, removes the
1058.Sy write_acl
1059and
1060.Sy write_owner
1061permissions when the ACE is inherited.
1062.It Sy passthrough
1063inherits all inheritable ACEs without any modifications.
1064.It Sy passthrough-x
1065same meaning as
1066.Sy passthrough ,
1067except that the
1068.Sy owner@ ,
1069.Sy group@ ,
1070and
1071.Sy everyone@
1072ACEs inherit the execute permission only if the file creation mode also requests
1073the execute bit.
1074.El
1075.Pp
1076When the property value is set to
1077.Sy passthrough ,
1078files are created with a mode determined by the inheritable ACEs.
1079If no inheritable ACEs exist that affect the mode, then the mode is set in
1080accordance to the requested mode from the application.
1081.Pp
1082The
1083.Sy aclinherit
06f3fc2a 1084property does not apply to POSIX ACLs.
44f09cdc
BB
1085.It Sy acltype Ns = Ns Sy off Ns | Ns Sy noacl Ns | Ns Sy posixacl
1086Controls whether ACLs are enabled and if so what type of ACL to use.
1087.Bl -tag -width "posixacl"
1088.It Sy off
1089default, when a file system has the
1090.Sy acltype
1091property set to off then ACLs are disabled.
1092.It Sy noacl
1093an alias for
1094.Sy off
1095.It Sy posixacl
06f3fc2a
RL
1096indicates POSIX ACLs should be used. POSIX ACLs are specific to Linux and are
1097not functional on other platforms. POSIX ACLs are stored as an extended
44f09cdc
BB
1098attribute and therefore will not overwrite any existing NFSv4 ACLs which
1099may be set.
1100.El
1101.Pp
1102To obtain the best performance when setting
1103.Sy posixacl
1104users are strongly encouraged to set the
1105.Sy xattr=sa
06f3fc2a
RL
1106property. This will result in the POSIX ACL being stored more efficiently on
1107disk. But as a consequence, all new extended attributes will only be
44f09cdc
BB
1108accessible from OpenZFS implementations which support the
1109.Sy xattr=sa
1110property. See the
1111.Sy xattr
1112property for more details.
1113.It Sy atime Ns = Ns Sy on Ns | Ns Sy off
1114Controls whether the access time for files is updated when they are read.
1115Turning this property off avoids producing write traffic when reading files and
1116can result in significant performance gains, though it might confuse mailers
1117and other similar utilities. The values
1118.Sy on
1119and
1120.Sy off
1121are equivalent to the
1122.Sy atime
1123and
1124.Sy noatime
1125mount options. The default value is
1126.Sy on .
1127See also
1128.Sy relatime
1129below.
1130.It Sy canmount Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy noauto
1131If this property is set to
1132.Sy off ,
1133the file system cannot be mounted, and is ignored by
1134.Nm zfs Cm mount Fl a .
1135Setting this property to
1136.Sy off
1137is similar to setting the
1138.Sy mountpoint
1139property to
1140.Sy none ,
1141except that the dataset still has a normal
1142.Sy mountpoint
1143property, which can be inherited.
1144Setting this property to
1145.Sy off
1146allows datasets to be used solely as a mechanism to inherit properties.
1147One example of setting
1148.Sy canmount Ns = Ns Sy off
1149is to have two datasets with the same
1150.Sy mountpoint ,
1151so that the children of both datasets appear in the same directory, but might
1152have different inherited characteristics.
1153.Pp
1154When set to
1155.Sy noauto ,
1156a dataset can only be mounted and unmounted explicitly.
1157The dataset is not mounted automatically when the dataset is created or
1158imported, nor is it mounted by the
1159.Nm zfs Cm mount Fl a
1160command or unmounted by the
1161.Nm zfs Cm unmount Fl a
1162command.
1163.Pp
1164This property is not inherited.
1165.It Xo
1166.Sy checksum Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy fletcher2 Ns | Ns
1167.Sy fletcher4 Ns | Ns Sy sha256 Ns | Ns Sy noparity Ns | Ns
1168.Sy sha512 Ns | Ns Sy skein Ns | Ns Sy edonr
1169.Xc
1170Controls the checksum used to verify data integrity.
1171The default value is
1172.Sy on ,
1173which automatically selects an appropriate algorithm
1174.Po currently,
1175.Sy fletcher4 ,
1176but this may change in future releases
1177.Pc .
1178The value
1179.Sy off
1180disables integrity checking on user data.
1181The value
1182.Sy noparity
1183not only disables integrity but also disables maintaining parity for user data.
3c67d83a 1184This setting is used internally by a dump device residing on a RAID-Z pool and
44f09cdc
BB
1185should not be used by any other dataset.
1186Disabling checksums is
1187.Sy NOT
1188a recommended practice.
1189.Pp
1190The
1191.Sy sha512 ,
1192.Sy skein ,
1193and
1194.Sy edonr
1195checksum algorithms require enabling the appropriate features on the pool.
6c0f78f8
RL
1196These pool features are not supported by GRUB and must not be used on the
1197pool if GRUB needs to access the pool (e.g. for /boot).
1198.Pp
44f09cdc
BB
1199Please see
1200.Xr zpool-features 5
1201for more information on these algorithms.
1202.Pp
058ac9ba 1203Changing this property affects only newly-written data.
44f09cdc
BB
1204.It Xo
1205.Sy compression Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy gzip Ns | Ns
1206.Sy gzip- Ns Em N Ns | Ns Sy lz4 Ns | Ns Sy lzjb Ns | Ns Sy zle
1207.Xc
99197f03 1208Controls the compression algorithm used for this dataset.
44f09cdc
BB
1209.Pp
1210Setting compression to
1211.Sy on
1212indicates that the current default compression algorithm should be used.
1213The default balances compression and decompression speed, with compression ratio
1214and is expected to work well on a wide variety of workloads.
1215Unlike all other settings for this property,
1216.Sy on
1217does not select a fixed compression type.
1218As new compression algorithms are added to ZFS and enabled on a pool, the
1219default compression algorithm may change.
1220The current default compression algorithm is either
1221.Sy lzjb
1222or, if the
1223.Sy lz4_compress
1224feature is enabled,
1225.Sy lz4 .
1226.Pp
1227The
1228.Sy lz4
1229compression algorithm is a high-performance replacement for the
1230.Sy lzjb
1231algorithm.
1232It features significantly faster compression and decompression, as well as a
1233moderately higher compression ratio than
1234.Sy lzjb ,
1235but can only be used on pools with the
1236.Sy lz4_compress
1237feature set to
1238.Sy enabled .
1239See
1240.Xr zpool-features 5
1241for details on ZFS feature flags and the
1242.Sy lz4_compress
1243feature.
1244.Pp
1245The
1246.Sy lzjb
1247compression algorithm is optimized for performance while providing decent data
1248compression.
1249.Pp
1250The
1251.Sy gzip
1252compression algorithm uses the same compression as the
1253.Xr gzip 1
1254command.
1255You can specify the
1256.Sy gzip
1257level by using the value
1258.Sy gzip- Ns Em N ,
1259where
1260.Em N
1261is an integer from 1
1262.Pq fastest
1263to 9
1264.Pq best compression ratio .
1265Currently,
1266.Sy gzip
1267is equivalent to
1268.Sy gzip-6
1269.Po which is also the default for
1270.Xr gzip 1
1271.Pc .
1272.Pp
1273The
1274.Sy zle
1275compression algorithm compresses runs of zeros.
1276.Pp
99197f03 1277This property can also be referred to by its shortened column name
44f09cdc
BB
1278.Sy compress .
1279Changing this property affects only newly-written data.
ba7b05cb
D
1280.Pp
1281When any setting except
1282.Sy off
1283is selected, compression will explicitly check for blocks consisting of only
1284zeroes (the NUL byte). When a zero-filled block is detected, it is stored as
1285a hole and not compressed using the indicated compression algorithm.
1286.Pp
1287Any block being compressed must be no larger than 7/8 of its original size
1288after compression, otherwise the compression will not be considered worthwhile
1289and the block saved uncompressed. Note that when the logical block is less than
12908 times the disk sector size this effectively reduces the necessary compression
1291ratio; for example 8k blocks on disks with 4k disk sectors must compress to 1/2
1292or less of their original size.
44f09cdc
BB
1293.It Xo
1294.Sy context Ns = Ns Sy none Ns | Ns
1295.Em SELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level
1296.Xc
1297This flag sets the SELinux context for all files in the file system under
1298a mount point for that file system. See
1299.Xr selinux 8
1300for more information.
1301.It Xo
1302.Sy fscontext Ns = Ns Sy none Ns | Ns
1303.Em SELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level
1304.Xc
1305This flag sets the SELinux context for the file system file system being
1306mounted. See
1307.Xr selinux 8
1308for more information.
1309.It Xo
1310.Sy defcontext Ns = Ns Sy none Ns | Ns
1311.Em SELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level
1312.Xc
1313This flag sets the SELinux default context for unlabeled files. See
1314.Xr selinux 8
1315for more information.
1316.It Xo
1317.Sy rootcontext Ns = Ns Sy none Ns | Ns
1318.Em SELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level
1319.Xc
1320This flag sets the SELinux context for the root inode of the file system. See
1321.Xr selinux 8
1322for more information.
1323.It Sy copies Ns = Ns Sy 1 Ns | Ns Sy 2 Ns | Ns Sy 3
1324Controls the number of copies of data stored for this dataset.
1325These copies are in addition to any redundancy provided by the pool, for
1326example, mirroring or RAID-Z.
1327The copies are stored on different disks, if possible.
1328The space used by multiple copies is charged to the associated file and dataset,
1329changing the
1330.Sy used
1331property and counting against quotas and reservations.
1332.Pp
8fd888ba 1333Changing this property only affects newly-written data.
44f09cdc
BB
1334Therefore, set this property at file system creation time by using the
1335.Fl o Sy copies Ns = Ns Ar N
1336option.
1337.Pp
1338Remember that ZFS will not import a pool with a missing top-level vdev. Do
1339.Sy NOT
1340create, for example a two-disk striped pool and set
1341.Sy copies=2
1342on some datasets thinking you have setup redundancy for them. When a disk
1343fails you will not be able to import the pool and will have lost all of your
1344data.
6e81f9b2
RL
1345.Pp
1346Encrypted datasets may not have
1347.Sy copies Ns = Ns Em 3
1348since the implementation stores some encryption metadata where the third copy
1349would normally be.
44f09cdc
BB
1350.It Sy devices Ns = Ns Sy on Ns | Ns Sy off
1351Controls whether device nodes can be opened on this file system.
1352The default value is
1353.Sy on .
1354The values
1355.Sy on
1356and
1357.Sy off
1358are equivalent to the
1359.Sy dev
1360and
1361.Sy nodev
1362mount options.
1363.It Xo
dfb1ad02
D
1364.Sy dedup Ns = Ns Sy off Ns | Ns Sy on Ns | Ns Sy verify Ns | Ns
1365.Sy sha256[,verify] Ns | Ns Sy sha512[,verify] Ns | Ns Sy skein[,verify] Ns | Ns
1366.Sy edonr,verify
1367.Xc
1368Configures deduplication for a dataset. The default value is
1369.Sy off .
1370The default deduplication checksum is
1371.Sy sha256
1372(this may change in the future). When
1373.Sy dedup
1374is enabled, the checksum defined here overrides the
1375.Sy checksum
1376property. Setting the value to
1377.Sy verify
1378has the same effect as the setting
1379.Sy sha256,verify.
1380.Pp
1381If set to
1382.Sy verify ,
1383ZFS will do a byte-to-byte comparsion in case of two blocks having the same
1384signature to make sure the block contents are identical. Specifying
1385.Sy verify
1386is mandatory for the
1387.Sy edonr
1388algorithm.
1389.Pp
1390Unless necessary, deduplication should NOT be enabled on a system. See
1391.Sx Deduplication
1392above.
1393.It Xo
44f09cdc
BB
1394.Sy dnodesize Ns = Ns Sy legacy Ns | Ns Sy auto Ns | Ns Sy 1k Ns | Ns
1395.Sy 2k Ns | Ns Sy 4k Ns | Ns Sy 8k Ns | Ns Sy 16k
1396.Xc
1397Specifies a compatibility mode or literal value for the size of dnodes in the
1398file system. The default value is
1399.Sy legacy .
1400Setting this property to a value other than
1401.Sy legacy
1402requires the large_dnode pool feature to be enabled.
1403.Pp
1404Consider setting
1405.Sy dnodesize
1406to
1407.Sy auto
1408if the dataset uses the
1409.Sy xattr=sa
1410property setting and the workload makes heavy use of extended attributes. This
1411may be applicable to SELinux-enabled systems, Lustre servers, and Samba
1412servers, for example. Literal values are supported for cases where the optimal
1413size is known in advance and for performance testing.
1414.Pp
1415Leave
1416.Sy dnodesize
1417set to
1418.Sy legacy
1419if you need to receive a send stream of this dataset on a pool that doesn't
1420enable the large_dnode feature, or if you need to import this pool on a system
1421that doesn't support the large_dnode feature.
1422.Pp
50c957f7 1423This property can also be referred to by its shortened column name,
44f09cdc 1424.Sy dnsize .
b5256303
TC
1425.It Xo
1426.Sy encryption Ns = Ns Sy off Ns | Ns Sy on Ns | Ns Sy aes-128-ccm Ns | Ns
1427.Sy aes-192-ccm Ns | Ns Sy aes-256-ccm Ns | Ns Sy aes-128-gcm Ns | Ns
1428.Sy aes-192-gcm Ns | Ns Sy aes-256-gcm
1429.Xc
1430Controls the encryption cipher suite (block cipher, key length, and mode) used
1431for this dataset. Requires the
1432.Sy encryption
1433feature to be enabled on the pool.
1434Requires a
1435.Sy keyformat
1436to be set at dataset creation time.
1437.Pp
1438Selecting
1439.Sy encryption Ns = Ns Sy on
1440when creating a dataset indicates that the default encryption suite will be
1441selected, which is currently
1442.Sy aes-256-ccm .
1443In order to provide consistent data protection, encryption must be specified at
1444dataset creation time and it cannot be changed afterwards.
1445.Pp
1446For more details and caveats about encryption see the
1447.Sy Encryption
1448section.
1449.It Sy keyformat Ns = Ns Sy raw Ns | Ns Sy hex Ns | Ns Sy passphrase
1450Controls what format the user's encryption key will be provided as. This
1451property is only set when the dataset is encrypted.
1452.Pp
1453Raw keys and hex keys must be 32 bytes long (regardless of the chosen
1454encryption suite) and must be randomly generated. A raw key can be generated
1455with the following command:
1456.Bd -literal
1457# dd if=/dev/urandom of=/path/to/output/key bs=32 count=1
1458.Ed
1459.Pp
1460Passphrases must be between 8 and 512 bytes long and will be processed through
1461PBKDF2 before being used (see the
1462.Sy pbkdf2iters
1463property). Even though the
1464encryption suite cannot be changed after dataset creation, the keyformat can be
1465with
1466.Nm zfs Cm change-key .
1467.It Xo
1468.Sy keylocation Ns = Ns Sy prompt Ns | Ns Sy file:// Ns Em </absolute/file/path>
1469.Xc
1470Controls where the user's encryption key will be loaded from by default for
1471commands such as
1472.Nm zfs Cm load-key
1473and
7106b236
AR
1474.Nm zfs Cm mount Cm -l .
1475This property is only set for encrypted datasets which are encryption roots. If
1476unspecified, the default is
b5256303
TC
1477.Sy prompt.
1478.Pp
1479Even though the encryption suite cannot be changed after dataset creation, the
1480keylocation can be with either
1481.Nm zfs Cm set
1482or
1483.Nm zfs Cm change-key .
1484If
1485.Sy prompt
1486is selected ZFS will ask for the key at the command prompt when it is required
1487to access the encrypted data (see
1488.Nm zfs Cm load-key
1489for details). This setting will also allow the key to be passed in via STDIN,
1490but users should be careful not to place keys which should be kept secret on
1491the command line. If a file URI is selected, the key will be loaded from the
1492specified absolute file path.
1493.It Sy pbkdf2iters Ns = Ns Ar iterations
1494Controls the number of PBKDF2 iterations that a
1495.Sy passphrase
1496encryption key should be run through when processing it into an encryption key.
1497This property is only defined when encryption is enabled and a keyformat of
1498.Sy passphrase
1499is selected. The goal of PBKDF2 is to significantly increase the
1500computational difficulty needed to brute force a user's passphrase. This is
1501accomplished by forcing the attacker to run each passphrase through a
1502computationally expensive hashing function many times before they arrive at the
1503resulting key. A user who actually knows the passphrase will only have to pay
1504this cost once. As CPUs become better at processing, this number should be
1505raised to ensure that a brute force attack is still not possible. The current
1506default is
1507.Sy 350000
1508and the minimum is
1509.Sy 100000 .
1510This property may be changed with
1511.Nm zfs Cm change-key .
44f09cdc
BB
1512.It Sy exec Ns = Ns Sy on Ns | Ns Sy off
1513Controls whether processes can be executed from within this file system.
1514The default value is
1515.Sy on .
1516The values
1517.Sy on
1518and
1519.Sy off
1520are equivalent to the
1521.Sy exec
1522and
1523.Sy noexec
1524mount options.
1525.It Sy filesystem_limit Ns = Ns Em count Ns | Ns Sy none
788eb90c 1526Limits the number of filesystems and volumes that can exist under this point in
44f09cdc
BB
1527the dataset tree.
1528The limit is not enforced if the user is allowed to change the limit.
1529Setting a
1530.Sy filesystem_limit
1531to
1532.Sy on
1533a descendent of a filesystem that already has a
1534.Sy filesystem_limit
1535does not override the ancestor's
1536.Sy filesystem_limit ,
1537but rather imposes an additional limit.
1538This feature must be enabled to be used
1539.Po see
1540.Xr zpool-features 5
1541.Pc .
cc99f275
DB
1542.It Sy special_small_blocks Ns = Ns Em size
1543This value represents the threshold block size for including small file
44170969 1544blocks into the special allocation class. Blocks smaller than or equal to this
1545value will be assigned to the special allocation class while greater blocks
1546will be assigned to the regular class. Valid values are zero or a power of two
1547from 512B up to 128K. The default size is 0 which means no small file blocks
1548will be allocated in the special class.
cc99f275
DB
1549.Pp
1550Before setting this property, a special class vdev must be added to the
1551pool. See
1552.Xr zpool 8
1553for more details on the special allocation class.
44f09cdc
BB
1554.It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
1555Controls the mount point used for this file system.
1556See the
1557.Sx Mount Points
1558section for more information on how this property is used.
1559.Pp
1560When the
1561.Sy mountpoint
1562property is changed for a file system, the file system and any children that
1563inherit the mount point are unmounted.
1564If the new value is
1565.Sy legacy ,
1566then they remain unmounted.
1567Otherwise, they are automatically remounted in the new location if the property
1568was previously
1569.Sy legacy
1570or
1571.Sy none ,
1572or if they were mounted before the property was changed.
1573In addition, any shared file systems are unshared and shared in the new
1574location.
1575.It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
1576Controls whether the file system should be mounted with
1577.Sy nbmand
1578.Pq Non Blocking mandatory locks .
1579This is used for SMB clients.
1580Changes to this property only take effect when the file system is umounted and
1581remounted.
1582See
1583.Xr mount 8
1584for more information on
1585.Sy nbmand
1586mounts. This property is not used on Linux.
1587.It Sy overlay Ns = Ns Sy off Ns | Ns Sy on
1588Allow mounting on a busy directory or a directory which already contains
1589files or directories. This is the default mount behavior for Linux file systems.
1590For consistency with OpenZFS on other platforms overlay mounts are
1591.Sy off
1592by default. Set to
1593.Sy on
1594to enable overlay mounts.
1595.It Sy primarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1596Controls what is cached in the primary cache
1597.Pq ARC .
1598If this property is set to
1599.Sy all ,
1600then both user data and metadata is cached.
1601If this property is set to
1602.Sy none ,
1603then neither user data nor metadata is cached.
1604If this property is set to
1605.Sy metadata ,
1606then only metadata is cached.
1607The default value is
1608.Sy all .
1609.It Sy quota Ns = Ns Em size Ns | Ns Sy none
1610Limits the amount of space a dataset and its descendents can consume.
1611This property enforces a hard limit on the amount of space used.
1612This includes all space consumed by descendents, including file systems and
1613snapshots.
1614Setting a quota on a descendent of a dataset that already has a quota does not
1615override the ancestor's quota, but rather imposes an additional limit.
1616.Pp
1617Quotas cannot be set on volumes, as the
1618.Sy volsize
1619property acts as an implicit quota.
1620.It Sy snapshot_limit Ns = Ns Em count Ns | Ns Sy none
788eb90c 1621Limits the number of snapshots that can be created on a dataset and its
44f09cdc
BB
1622descendents.
1623Setting a
1624.Sy snapshot_limit
1625on a descendent of a dataset that already has a
1626.Sy snapshot_limit
1627does not override the ancestor's
1628.Sy snapshot_limit ,
1629but rather imposes an additional limit.
1630The limit is not enforced if the user is allowed to change the limit.
1631For example, this means that recursive snapshots taken from the global zone are
1632counted against each delegated dataset within a zone.
1633This feature must be enabled to be used
1634.Po see
1635.Xr zpool-features 5
1636.Pc .
1637.It Sy userquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1638Limits the amount of space consumed by the specified user.
1639User space consumption is identified by the
1640.Sy userspace@ Ns Em user
1641property.
1642.Pp
1643Enforcement of user quotas may be delayed by several seconds.
1644This delay means that a user might exceed their quota before the system notices
1645that they are over quota and begins to refuse additional writes with the
1646.Er EDQUOT
1647error message.
1648See the
1649.Nm zfs Cm userspace
1650subcommand for more information.
1651.Pp
1652Unprivileged users can only access their own groups' space usage.
1653The root user, or a user who has been granted the
1654.Sy userquota
1655privilege with
1656.Nm zfs Cm allow ,
1657can get and set everyone's quota.
1658.Pp
1659This property is not available on volumes, on file systems before version 4, or
1660on pools before version 15.
1661The
1662.Sy userquota@ Ns Em ...
1663properties are not displayed by
1664.Nm zfs Cm get Sy all .
1665The user's name must be appended after the
1666.Sy @
1667symbol, using one of the following forms:
1668.Bl -bullet
1669.It
1670.Em POSIX name
1671.Po for example,
1672.Sy joe
1673.Pc
1674.It
1675.Em POSIX numeric ID
1676.Po for example,
1677.Sy 789
1678.Pc
1679.It
1680.Em SID name
1681.Po for example,
1682.Sy joe.smith@mydomain
1683.Pc
1684.It
1685.Em SID numeric ID
1686.Po for example,
1687.Sy S-1-123-456-789
1688.Pc
1689.El
1690.Pp
6a107f41 1691Files created on Linux always have POSIX owners.
44f09cdc
BB
1692.It Sy userobjquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1693The
1694.Sy userobjquota
1695is similar to
1696.Sy userquota
1697but it limits the number of objects a user can create. Please refer to
1698.Sy userobjused
1699for more information about how objects are counted.
1700.It Sy groupquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1701Limits the amount of space consumed by the specified group.
1702Group space consumption is identified by the
1703.Sy groupused@ Ns Em group
1704property.
1705.Pp
1706Unprivileged users can access only their own groups' space usage.
1707The root user, or a user who has been granted the
1708.Sy groupquota
1709privilege with
1710.Nm zfs Cm allow ,
1711can get and set all groups' quotas.
1712.It Sy groupobjquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1713The
1714.Sy groupobjquota
1715is similar to
1716.Sy groupquota
1717but it limits number of objects a group can consume. Please refer to
1718.Sy userobjused
1719for more information about how objects are counted.
9c5167d1
NF
1720.It Sy projectquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1721Limits the amount of space consumed by the specified project. Project
1722space consumption is identified by the
1723.Sy projectused@ Ns Em project
1724property. Please refer to
1725.Sy projectused
1726for more information about how project is identified and set/changed.
1727.Pp
1728The root user, or a user who has been granted the
1729.Sy projectquota
1730privilege with
1731.Nm zfs allow ,
1732can access all projects' quota.
1733.It Sy projectobjquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1734The
1735.Sy projectobjquota
1736is similar to
1737.Sy projectquota
1738but it limits number of objects a project can consume. Please refer to
1739.Sy userobjused
1740for more information about how objects are counted.
44f09cdc
BB
1741.It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
1742Controls whether this dataset can be modified.
1743The default value is
1744.Sy off .
1745The values
1746.Sy on
1747and
1748.Sy off
1749are equivalent to the
1750.Sy ro
1751and
1752.Sy rw
1753mount options.
1754.Pp
1755This property can also be referred to by its shortened column name,
1756.Sy rdonly .
1757.It Sy recordsize Ns = Ns Em size
1758Specifies a suggested block size for files in the file system.
1759This property is designed solely for use with database workloads that access
1760files in fixed-size records.
1761ZFS automatically tunes block sizes according to internal algorithms optimized
1762for typical access patterns.
1763.Pp
1764For databases that create very large files but access them in small random
1765chunks, these algorithms may be suboptimal.
1766Specifying a
1767.Sy recordsize
1768greater than or equal to the record size of the database can result in
1769significant performance gains.
1770Use of this property for general purpose file systems is strongly discouraged,
1771and may adversely affect performance.
1772.Pp
1773The size specified must be a power of two greater than or equal to 512 and less
1774than or equal to 128 Kbytes.
1775If the
1776.Sy large_blocks
1777feature is enabled on the pool, the size may be up to 1 Mbyte.
1778See
1779.Xr zpool-features 5
1780for details on ZFS feature flags.
1781.Pp
1782Changing the file system's
1783.Sy recordsize
1784affects only files created afterward; existing files are unaffected.
1785.Pp
1786This property can also be referred to by its shortened column name,
1787.Sy recsize .
1788.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1789Controls what types of metadata are stored redundantly.
1790ZFS stores an extra copy of metadata, so that if a single block is corrupted,
1791the amount of user data lost is limited.
1792This extra copy is in addition to any redundancy provided at the pool level
1793.Pq e.g. by mirroring or RAID-Z ,
1794and is in addition to an extra copy specified by the
1795.Sy copies
1796property
1797.Pq up to a total of 3 copies .
1798For example if the pool is mirrored,
1799.Sy copies Ns = Ns 2 ,
1800and
1801.Sy redundant_metadata Ns = Ns Sy most ,
1802then ZFS stores 6 copies of most metadata, and 4 copies of data and some
faf0f58c 1803metadata.
44f09cdc
BB
1804.Pp
1805When set to
1806.Sy all ,
1807ZFS stores an extra copy of all metadata.
1808If a single on-disk block is corrupt, at worst a single block of user data
1809.Po which is
1810.Sy recordsize
1811bytes long
1812.Pc
1813can be lost.
1814.Pp
1815When set to
1816.Sy most ,
1817ZFS stores an extra copy of most types of metadata.
1818This can improve performance of random writes, because less metadata must be
1819written.
1820In practice, at worst about 100 blocks
1821.Po of
1822.Sy recordsize
1823bytes each
1824.Pc
1825of user data can be lost if a single on-disk block is corrupt.
1826The exact behavior of which metadata blocks are stored redundantly may change in
1827future releases.
1828.Pp
1829The default value is
1830.Sy all .
1831.It Sy refquota Ns = Ns Em size Ns | Ns Sy none
1832Limits the amount of space a dataset can consume.
1833This property enforces a hard limit on the amount of space used.
1834This hard limit does not include space used by descendents, including file
1835systems and snapshots.
d22f3a82 1836.It Sy refreservation Ns = Ns Em size Ns | Ns Sy none Ns | Ns Sy auto
44f09cdc
BB
1837The minimum amount of space guaranteed to a dataset, not including its
1838descendents.
1839When the amount of space used is below this value, the dataset is treated as if
1840it were taking up the amount of space specified by
1841.Sy refreservation .
1842The
1843.Sy refreservation
1844reservation is accounted for in the parent datasets' space used, and counts
1845against the parent datasets' quotas and reservations.
1846.Pp
1847If
1848.Sy refreservation
1849is set, a snapshot is only allowed if there is enough free pool space outside of
1850this reservation to accommodate the current number of
1851.Qq referenced
1852bytes in the dataset.
1853.Pp
d22f3a82
MG
1854If
1855.Sy refreservation
1856is set to
1857.Sy auto ,
1858a volume is thick provisioned
1859.Po or
1860.Qq not sparse
1861.Pc .
1862.Sy refreservation Ns = Ns Sy auto
1863is only supported on volumes.
1864See
1865.Sy volsize
1866in the
1867.Sx Native Properties
1868section for more information about sparse volumes.
1869.Pp
44f09cdc
BB
1870This property can also be referred to by its shortened column name,
1871.Sy refreserv .
1872.It Sy relatime Ns = Ns Sy on Ns | Ns Sy off
1873Controls the manner in which the access time is updated when
1874.Sy atime=on
1875is set. Turning this property on causes the access time to be updated relative
1876to the modify or change time. Access time is only updated if the previous
1877access time was earlier than the current modify or change time or if the
1878existing access time hasn't been updated within the past 24 hours. The default
1879value is
1880.Sy off .
1881The values
1882.Sy on
1883and
1884.Sy off
1885are equivalent to the
1886.Sy relatime
1887and
1888.Sy norelatime
1889mount options.
1890.It Sy reservation Ns = Ns Em size Ns | Ns Sy none
1891The minimum amount of space guaranteed to a dataset and its descendants.
1892When the amount of space used is below this value, the dataset is treated as if
1893it were taking up the amount of space specified by its reservation.
1894Reservations are accounted for in the parent datasets' space used, and count
1895against the parent datasets' quotas and reservations.
1896.Pp
1897This property can also be referred to by its shortened column name,
1898.Sy reserv .
1899.It Sy secondarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1900Controls what is cached in the secondary cache
1901.Pq L2ARC .
1902If this property is set to
1903.Sy all ,
1904then both user data and metadata is cached.
1905If this property is set to
1906.Sy none ,
1907then neither user data nor metadata is cached.
1908If this property is set to
1909.Sy metadata ,
1910then only metadata is cached.
1911The default value is
1912.Sy all .
1913.It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
1914Controls whether the setuid bit is respected for the file system.
1915The default value is
1916.Sy on .
1917The values
1918.Sy on
1919and
1920.Sy off
1921are equivalent to the
1922.Sy suid
1923and
1924.Sy nosuid
1925mount options.
1926.It Sy sharesmb Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1927Controls whether the file system is shared by using
1928.Sy Samba USERSHARES
1929and what options are to be used. Otherwise, the file system is automatically
1930shared and unshared with the
1931.Nm zfs Cm share
1932and
1933.Nm zfs Cm unshare
1934commands. If the property is set to on, the
1935.Xr net 8
1936command is invoked to create a
1937.Sy USERSHARE .
1938.Pp
1939Because SMB shares requires a resource name, a unique resource name is
1940constructed from the dataset name. The constructed name is a copy of the
1941dataset name except that the characters in the dataset name, which would be
1942invalid in the resource name, are replaced with underscore (_) characters.
1943Linux does not currently support additional options which might be available
1944on Solaris.
1945.Pp
1946If the
1947.Sy sharesmb
1948property is set to
1949.Sy off ,
1950the file systems are unshared.
1951.Pp
1952The share is created with the ACL (Access Control List) "Everyone:F" ("F"
1953stands for "full permissions", ie. read and write permissions) and no guest
1954access (which means Samba must be able to authenticate a real user, system
1955passwd/shadow, LDAP or smbpasswd based) by default. This means that any
1956additional access control (disallow specific user specific access etc) must
1957be done on the underlying file system.
1958.It Sy sharenfs Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1959Controls whether the file system is shared via NFS, and what options are to be
1960used.
1961A file system with a
1962.Sy sharenfs
1963property of
1964.Sy off
1965is managed with the
1966.Xr exportfs 8
1967command and entries in the
1968.Em /etc/exports
1969file.
1970Otherwise, the file system is automatically shared and unshared with the
1971.Nm zfs Cm share
1972and
1973.Nm zfs Cm unshare
1974commands.
1975If the property is set to
1976.Sy on ,
1977the dataset is shared using the default options:
1978.Pp
1979.Em sec=sys,rw,crossmnt,no_subtree_check,no_root_squash
1980.Pp
1981See
1982.Xr exports 5
1983for the meaning of the default options. Otherwise, the
1984.Xr exportfs 8
1985command is invoked with options equivalent to the contents of this property.
1986.Pp
1987When the
1988.Sy sharenfs
1989property is changed for a dataset, the dataset and any children inheriting the
1990property are re-shared with the new options, only if the property was previously
1991.Sy off ,
1992or if they were shared before the property was changed.
1993If the new property is
1994.Sy off ,
1995the file systems are unshared.
1996.It Sy logbias Ns = Ns Sy latency Ns | Ns Sy throughput
1997Provide a hint to ZFS about handling of synchronous requests in this dataset.
1998If
1999.Sy logbias
2000is set to
2001.Sy latency
2002.Pq the default ,
2003ZFS will use pool log devices
2004.Pq if configured
2005to handle the requests at low latency.
2006If
2007.Sy logbias
2008is set to
2009.Sy throughput ,
2010ZFS will not use configured pool log devices.
2011ZFS will instead optimize synchronous operations for global pool throughput and
2012efficient use of resources.
2013.It Sy snapdev Ns = Ns Sy hidden Ns | Ns Sy visible
2014Controls whether the volume snapshot devices under
2015.Em /dev/zvol/<pool>
2016are hidden or visible. The default value is
2017.Sy hidden .
2018.It Sy snapdir Ns = Ns Sy hidden Ns | Ns Sy visible
2019Controls whether the
2020.Pa .zfs
2021directory is hidden or visible in the root of the file system as discussed in
2022the
2023.Sx Snapshots
2024section.
2025The default value is
2026.Sy hidden .
2027.It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled
2028Controls the behavior of synchronous requests
2029.Pq e.g. fsync, O_DSYNC .
2030.Sy standard
2031is the
2032.Tn POSIX
2033specified behavior of ensuring all synchronous requests are written to stable
2034storage and all devices are flushed to ensure data is not cached by device
2035controllers
2036.Pq this is the default .
2037.Sy always
330d06f9 2038causes every file system transaction to be written and flushed before its
44f09cdc
BB
2039system call returns.
2040This has a large performance penalty.
2041.Sy disabled
2042disables synchronous requests.
2043File system transactions are only committed to stable storage periodically.
2044This option will give the highest performance.
330d06f9 2045However, it is very dangerous as ZFS would be ignoring the synchronous
44f09cdc
BB
2046transaction demands of applications such as databases or NFS.
2047Administrators should only use this option when the risks are understood.
2048.It Sy version Ns = Ns Em N Ns | Ns Sy current
2049The on-disk version of this file system, which is independent of the pool
2050version.
2051This property can only be set to later supported versions.
2052See the
2053.Nm zfs Cm upgrade
2054command.
2055.It Sy volsize Ns = Ns Em size
2056For volumes, specifies the logical size of the volume.
2057By default, creating a volume establishes a reservation of equal size.
2058For storage pools with a version number of 9 or higher, a
2059.Sy refreservation
2060is set instead.
2061Any changes to
2062.Sy volsize
2063are reflected in an equivalent change to the reservation
2064.Po or
2065.Sy refreservation
2066.Pc .
2067The
2068.Sy volsize
2069can only be set to a multiple of
2070.Sy volblocksize ,
2071and cannot be zero.
2072.Pp
2073The reservation is kept equal to the volume's logical size to prevent unexpected
2074behavior for consumers.
2075Without the reservation, the volume could run out of space, resulting in
2076undefined behavior or data corruption, depending on how the volume is used.
2077These effects can also occur when the volume size is changed while it is in use
2078.Pq particularly when shrinking the size .
2079Extreme care should be used when adjusting the volume size.
2080.Pp
2081Though not recommended, a
2082.Qq sparse volume
2083.Po also known as
d22f3a82 2084.Qq thin provisioned
44f09cdc
BB
2085.Pc
2086can be created by specifying the
2087.Fl s
2088option to the
2089.Nm zfs Cm create Fl V
d22f3a82
MG
2090command, or by changing the value of the
2091.Sy refreservation
2092property
2093.Po or
2094.Sy reservation
2095property on pool version 8 or earlier
2096.Pc
2097after the volume has been created.
44f09cdc
BB
2098A
2099.Qq sparse volume
d22f3a82
MG
2100is a volume where the value of
2101.Sy refreservation
2102is less than the size of the volume plus the space required to store its
2103metadata.
44f09cdc
BB
2104Consequently, writes to a sparse volume can fail with
2105.Er ENOSPC
2106when the pool is low on space.
2107For a sparse volume, changes to
2108.Sy volsize
d22f3a82
MG
2109are not reflected in the
2110.Sy refreservation.
2111A volume that is not sparse is said to be
2112.Qq thick provisioned .
2113A sparse volume can become thick provisioned by setting
2114.Sy refreservation
2115to
2116.Sy auto .
cf8738d8 2117.It Sy volmode Ns = Ns Cm default | full | geom | dev | none
2118This property specifies how volumes should be exposed to the OS.
2119Setting it to
2120.Sy full
2121exposes volumes as fully fledged block devices, providing maximal
2122functionality. The value
2123.Sy geom
2124is just an alias for
2125.Sy full
2126and is kept for compatibility.
2127Setting it to
2128.Sy dev
2129hides its partitions.
2130Volumes with property set to
2131.Sy none
2132are not exposed outside ZFS, but can be snapshoted, cloned, replicated, etc,
2133that can be suitable for backup purposes.
2134Value
2135.Sy default
2136means that volumes exposition is controlled by system-wide tunable
2137.Va zvol_volmode ,
2138where
2139.Sy full ,
2140.Sy dev
2141and
2142.Sy none
2143are encoded as 1, 2 and 3 respectively.
2144The default values is
2145.Sy full .
44f09cdc
BB
2146.It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
2147Controls whether regular files should be scanned for viruses when a file is
2148opened and closed.
2149In addition to enabling this property, the virus scan service must also be
2150enabled for virus scanning to occur.
2151The default value is
2152.Sy off .
6a107f41 2153This property is not used on Linux.
44f09cdc
BB
2154.It Sy xattr Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy sa
2155Controls whether extended attributes are enabled for this file system. Two
7c2448a3
BB
2156styles of extended attributes are supported either directory based or system
2157attribute based.
44f09cdc
BB
2158.Pp
2159The default value of
2160.Sy on
2161enables directory based extended attributes. This style of extended attribute
2162imposes no practical limit on either the size or number of attributes which
2163can be set on a file. Although under Linux the
2164.Xr getxattr 2
2165and
2166.Xr setxattr 2
2167system calls limit the maximum size to 64K. This is the most compatible
2168style of extended attribute and is supported by all OpenZFS implementations.
2169.Pp
2170System attribute based xattrs can be enabled by setting the value to
2171.Sy sa .
2172The key advantage of this type of xattr is improved performance. Storing
2173extended attributes as system attributes significantly decreases the amount of
2174disk IO required. Up to 64K of data may be stored per-file in the space
2175reserved for system attributes. If there is not enough space available for
2176an extended attribute then it will be automatically written as a directory
2177based xattr. System attribute based extended attributes are not accessible
2178on platforms which do not support the
2179.Sy xattr=sa
2180feature.
2181.Pp
7c2448a3 2182The use of system attribute based xattrs is strongly encouraged for users of
06f3fc2a 2183SELinux or POSIX ACLs. Both of these features heavily rely of extended
44f09cdc
BB
2184attributes and benefit significantly from the reduced access time.
2185.Pp
2186The values
2187.Sy on
2188and
2189.Sy off
2190are equivalent to the
2191.Sy xattr
2192and
2193.Sy noxattr
2194mount options.
2195.It Sy zoned Ns = Ns Sy on Ns | Ns Sy off
2196Controls whether the dataset is managed from a non-global zone. Zones are a
2197Solaris feature and are not relevant on Linux. The default value is
2198.Sy off .
2199.El
2200.Pp
2201The following three properties cannot be changed after the file system is
2202created, and therefore, should be set when the file system is created.
2203If the properties are not set with the
2204.Nm zfs Cm create
2205or
2206.Nm zpool Cm create
2207commands, these properties are inherited from the parent dataset.
2208If the parent dataset lacks these properties due to having been created prior to
2209these features being supported, the new file system will have the default values
2210for these properties.
2211.Bl -tag -width ""
2212.It Xo
2213.Sy casesensitivity Ns = Ns Sy sensitive Ns | Ns
2214.Sy insensitive Ns | Ns Sy mixed
2215.Xc
2216Indicates whether the file name matching algorithm used by the file system
2217should be case-sensitive, case-insensitive, or allow a combination of both
2218styles of matching.
2219The default value for the
2220.Sy casesensitivity
2221property is
2222.Sy sensitive .
2223Traditionally,
2224.Ux
2225and
2226.Tn POSIX
2227file systems have case-sensitive file names.
2228.Pp
2229The
2230.Sy mixed
2231value for the
2232.Sy casesensitivity
2233property indicates that the file system can support requests for both
2234case-sensitive and case-insensitive matching behavior.
2235Currently, case-insensitive matching behavior on a file system that supports
2236mixed behavior is limited to the SMB server product.
2237For more information about the
2238.Sy mixed
2239value behavior, see the "ZFS Administration Guide".
2240.It Xo
2241.Sy normalization Ns = Ns Sy none Ns | Ns Sy formC Ns | Ns
2242.Sy formD Ns | Ns Sy formKC Ns | Ns Sy formKD
2243.Xc
2244Indicates whether the file system should perform a
2245.Sy unicode
2246normalization of file names whenever two file names are compared, and which
2247normalization algorithm should be used.
2248File names are always stored unmodified, names are normalized as part of any
2249comparison process.
2250If this property is set to a legal value other than
2251.Sy none ,
2252and the
2253.Sy utf8only
2254property was left unspecified, the
2255.Sy utf8only
2256property is automatically set to
2257.Sy on .
2258The default value of the
2259.Sy normalization
2260property is
2261.Sy none .
8fd888ba 2262This property cannot be changed after the file system is created.
44f09cdc
BB
2263.It Sy utf8only Ns = Ns Sy on Ns | Ns Sy off
2264Indicates whether the file system should reject file names that include
2265characters that are not present in the
2266.Sy UTF-8
2267character code set.
2268If this property is explicitly set to
2269.Sy off ,
2270the normalization property must either not be explicitly set or be set to
2271.Sy none .
2272The default value for the
2273.Sy utf8only
2274property is
2275.Sy off .
8fd888ba 2276This property cannot be changed after the file system is created.
44f09cdc
BB
2277.El
2278.Pp
2279The
2280.Sy casesensitivity ,
2281.Sy normalization ,
2282and
2283.Sy utf8only
2284properties are also new permissions that can be assigned to non-privileged users
2285by using the ZFS delegated administration feature.
2286.Ss "Temporary Mount Point Properties"
2287When a file system is mounted, either through
2288.Xr mount 8
2289for legacy mounts or the
2290.Nm zfs Cm mount
2291command for normal file systems, its mount options are set according to its
2292properties.
2293The correlation between properties and mount options is as follows:
2294.Bd -literal
058ac9ba 2295 PROPERTY MOUNT OPTION
44f09cdc
BB
2296 atime atime/noatime
2297 canmount auto/noauto
2298 devices dev/nodev
2299 exec exec/noexec
2300 readonly ro/rw
2301 relatime relatime/norelatime
2302 setuid suid/nosuid
2303 xattr xattr/noxattr
2304.Ed
2305.Pp
2306In addition, these options can be set on a per-mount basis using the
2307.Fl o
2308option, without affecting the property that is stored on disk.
2309The values specified on the command line override the values stored in the
2310dataset.
2311The
2312.Sy nosuid
2313option is an alias for
d7323e79 2314.Sy nodevices Ns \&, Ns Sy nosetuid .
44f09cdc
BB
2315These properties are reported as
2316.Qq temporary
2317by the
2318.Nm zfs Cm get
2319command.
2320If the properties are changed while the dataset is mounted, the new setting
2321overrides any temporary settings.
2322.Ss "User Properties"
2323In addition to the standard native properties, ZFS supports arbitrary user
2324properties.
2325User properties have no effect on ZFS behavior, but applications or
2326administrators can use them to annotate datasets
2327.Pq file systems, volumes, and snapshots .
2328.Pp
2329User property names must contain a colon
2330.Pq Qq Sy \&:
2331character to distinguish them from native properties.
2332They may contain lowercase letters, numbers, and the following punctuation
2333characters: colon
2334.Pq Qq Sy \&: ,
2335dash
2336.Pq Qq Sy - ,
2337period
2338.Pq Qq Sy \&. ,
2339and underscore
2340.Pq Qq Sy _ .
2341The expected convention is that the property name is divided into two portions
2342such as
d7323e79 2343.Em module Ns \&: Ns Em property ,
44f09cdc
BB
2344but this namespace is not enforced by ZFS.
2345User property names can be at most 256 characters, and cannot begin with a dash
2346.Pq Qq Sy - .
2347.Pp
2348When making programmatic use of user properties, it is strongly suggested to use
2349a reversed
2350.Sy DNS
2351domain name for the
2352.Em module
2353component of property names to reduce the chance that two
2354independently-developed packages use the same property name for different
2355purposes.
2356.Pp
2357The values of user properties are arbitrary strings, are always inherited, and
2358are never validated.
2359All of the commands that operate on properties
2360.Po Nm zfs Cm list ,
2361.Nm zfs Cm get ,
2362.Nm zfs Cm set ,
2363and so forth
2364.Pc
2365can be used to manipulate both native properties and user properties.
2366Use the
2367.Nm zfs Cm inherit
2368command to clear a user property.
2369If the property is not defined in any parent dataset, it is removed entirely.
2370Property values are limited to 8192 bytes.
2371.Ss ZFS Volumes as Swap
2372ZFS volumes may be used as swap devices. After creating the volume with the
2373.Nm zfs Cm create Fl V
2374command set up and enable the swap area using the
2375.Xr mkswap 8
2376and
2377.Xr swapon 8
2378commands. Do not swap to a file on a ZFS file system. A ZFS swap file
2379configuration is not supported.
b5256303
TC
2380.Ss Encryption
2381Enabling the
2382.Sy encryption
2b127afb
RL
2383feature allows for the creation of encrypted filesystems and volumes. ZFS
2384will encrypt file and zvol data, file attributes, ACLs, permission bits,
2385directory listings, FUID mappings, and
2386.Sy userused
2387/
2388.Sy groupused
2389data. ZFS will not encrypt metadata related to the pool structure, including
2390dataset and snapshot names, dataset hierarchy, properties, file size, file
2391holes, and deduplication tables.
2392.Pp
2393Key rotation is managed by ZFS. Changing the user's key (e.g. a passphrase)
2394does not require re-encrypting the entire dataset. Datasets can be scrubbed,
2395resilvered, renamed, and deleted without the encryption keys being loaded (see the
b5256303
TC
2396.Nm zfs Cm load-key
2397subcommand for more info on key loading).
2398.Pp
2399Creating an encrypted dataset requires specifying the
2400.Sy encryption
2401and
2402.Sy keyformat
2403properties at creation time, along with an optional
90cdf283 2404.Sy keylocation
b5256303
TC
2405and
2406.Sy pbkdf2iters .
2407After entering an encryption key, the
2408created dataset will become an encryption root. Any descendant datasets will
4807c0ba
TC
2409inherit their encryption key from the encryption root by default, meaning that
2410loading, unloading, or changing the key for the encryption root will implicitly
2411do the same for all inheriting datasets. If this inheritance is not desired,
2412simply supply a
b5256303
TC
2413.Sy keyformat
2414when creating the child dataset or use
2415.Nm zfs Cm change-key
4807c0ba
TC
2416to break an existing relationship, creating a new encryption root on the child.
2417Note that the child's
2418.Sy keyformat
2419may match that of the parent while still creating a new encryption root, and
2420that changing the
2421.Sy encryption
2422property alone does not create a new encryption root; this would simply use a
2423different cipher suite with the same key as its encryption root. The one
2424exception is that clones will always use their origin's encryption key.
2425As a result of this exception, some encryption-related properties (namely
2426.Sy keystatus ,
2427.Sy keyformat ,
2428.Sy keylocation ,
2429and
2430.Sy pbkdf2iters )
2431do not inherit like other ZFS properties and instead use the value determined
2432by their encryption root. Encryption root inheritance can be tracked via the
2433read-only
b5256303
TC
2434.Sy encryptionroot
2435property.
2436.Pp
2b127afb 2437Encryption changes the behavior of a few ZFS
b5256303
TC
2438operations. Encryption is applied after compression so compression ratios are
2439preserved. Normally checksums in ZFS are 256 bits long, but for encrypted data
2440the checksum is 128 bits of the user-chosen checksum and 128 bits of MAC from
2441the encryption suite, which provides additional protection against maliciously
2442altered data. Deduplication is still possible with encryption enabled but for
2443security, datasets will only dedup against themselves, their snapshots, and
2444their clones.
2445.Pp
2446There are a few limitations on encrypted datasets. Encrypted data cannot be
2447embedded via the
2448.Sy embedded_data
2449feature. Encrypted datasets may not have
2450.Sy copies Ns = Ns Em 3
2451since the implementation stores some encryption metadata where the third copy
2452would normally be. Since compression is applied before encryption datasets may
2453be vulnerable to a CRIME-like attack if applications accessing the data allow
2454for it. Deduplication with encryption will leak information about which blocks
2455are equivalent in a dataset and will incur an extra CPU cost per block written.
44f09cdc
BB
2456.Sh SUBCOMMANDS
2457All subcommands that modify state are logged persistently to the pool in their
2458original form.
2459.Bl -tag -width ""
2460.It Nm Fl ?
058ac9ba 2461Displays a help message.
44f09cdc
BB
2462.It Xo
2463.Nm
50478c6d
T
2464.Fl V, -version
2465.Xc
2466An alias for the
2467.Nm zfs Cm version
2468subcommand.
2469.It Xo
2470.Nm
44f09cdc
BB
2471.Cm create
2472.Op Fl p
2473.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2474.Ar filesystem
2475.Xc
2476Creates a new ZFS file system.
2477The file system is automatically mounted according to the
2478.Sy mountpoint
2479property inherited from the parent.
2480.Bl -tag -width "-o"
2481.It Fl o Ar property Ns = Ns Ar value
2482Sets the specified property as if the command
2483.Nm zfs Cm set Ar property Ns = Ns Ar value
2484was invoked at the same time the dataset was created.
2485Any editable ZFS property can also be set at creation time.
2486Multiple
2487.Fl o
2488options can be specified.
2489An error results if the same property is specified in multiple
2490.Fl o
2491options.
2492.It Fl p
2493Creates all the non-existing parent datasets.
2494Datasets created in this manner are automatically mounted according to the
2495.Sy mountpoint
2496property inherited from their parent.
2497Any property specified on the command line using the
2498.Fl o
2499option is ignored.
2500If the target filesystem already exists, the operation completes successfully.
2501.El
2502.It Xo
2503.Nm
2504.Cm create
2505.Op Fl ps
2506.Op Fl b Ar blocksize
2507.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2508.Fl V Ar size Ar volume
2509.Xc
2510Creates a volume of the given size.
2511The volume is exported as a block device in
2512.Pa /dev/zvol/path ,
2513where
2514.Em path
2515is the name of the volume in the ZFS namespace.
2516The size represents the logical size as exported by the device.
2517By default, a reservation of equal size is created.
2518.Pp
2519.Ar size
2520is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
2521has an integral number of blocks regardless of
2522.Sy blocksize .
2523.Bl -tag -width "-b"
2524.It Fl b Ar blocksize
2525Equivalent to
2526.Fl o Sy volblocksize Ns = Ns Ar blocksize .
2527If this option is specified in conjunction with
2528.Fl o Sy volblocksize ,
2529the resulting behavior is undefined.
2530.It Fl o Ar property Ns = Ns Ar value
2531Sets the specified property as if the
2532.Nm zfs Cm set Ar property Ns = Ns Ar value
2533command was invoked at the same time the dataset was created.
2534Any editable ZFS property can also be set at creation time.
2535Multiple
2536.Fl o
2537options can be specified.
2538An error results if the same property is specified in multiple
2539.Fl o
2540options.
2541.It Fl p
2542Creates all the non-existing parent datasets.
2543Datasets created in this manner are automatically mounted according to the
2544.Sy mountpoint
2545property inherited from their parent.
2546Any property specified on the command line using the
2547.Fl o
2548option is ignored.
2549If the target filesystem already exists, the operation completes successfully.
2550.It Fl s
2551Creates a sparse volume with no reservation.
2552See
2553.Sy volsize
2554in the
2555.Sx Native Properties
2556section for more information about sparse volumes.
2557.El
2558.It Xo
2559.Nm
2560.Cm destroy
2561.Op Fl Rfnprv
2562.Ar filesystem Ns | Ns Ar volume
2563.Xc
2564Destroys the given dataset.
2565By default, the command unshares any file systems that are currently shared,
2566unmounts any file systems that are currently mounted, and refuses to destroy a
2567dataset that has active dependents
2568.Pq children or clones .
2569.Bl -tag -width "-R"
2570.It Fl R
2571Recursively destroy all dependents, including cloned file systems outside the
2572target hierarchy.
2573.It Fl f
2574Force an unmount of any file systems using the
2575.Nm unmount Fl f
2576command.
2577This option has no effect on non-file systems or unmounted file systems.
2578.It Fl n
2579Do a dry-run
2580.Pq Qq No-op
2581deletion.
2582No data will be deleted.
2583This is useful in conjunction with the
2584.Fl v
2585or
2586.Fl p
2587flags to determine what data would be deleted.
2588.It Fl p
330d06f9 2589Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2590.It Fl r
2591Recursively destroy all children.
2592.It Fl v
330d06f9 2593Print verbose information about the deleted data.
44f09cdc
BB
2594.El
2595.Pp
2596Extreme care should be taken when applying either the
2597.Fl r
2598or the
2599.Fl R
2600options, as they can destroy large portions of a pool and cause unexpected
2601behavior for mounted file systems in use.
2602.It Xo
2603.Nm
2604.Cm destroy
2605.Op Fl Rdnprv
2606.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
2607.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
2608.Xc
2609The given snapshots are destroyed immediately if and only if the
2610.Nm zfs Cm destroy
2611command without the
2612.Fl d
2613option would have destroyed it.
2614Such immediate destruction would occur, for example, if the snapshot had no
2615clones and the user-initiated reference count were zero.
2616.Pp
2617If a snapshot does not qualify for immediate destruction, it is marked for
2618deferred deletion.
2619In this state, it exists as a usable, visible snapshot until both of the
2620preconditions listed above are met, at which point it is destroyed.
2621.Pp
2622An inclusive range of snapshots may be specified by separating the first and
2623last snapshots with a percent sign.
330d06f9
MA
2624The first and/or last snapshots may be left blank, in which case the
2625filesystem's oldest or newest snapshot will be implied.
44f09cdc 2626.Pp
330d06f9 2627Multiple snapshots
44f09cdc
BB
2628.Pq or ranges of snapshots
2629of the same filesystem or volume may be specified in a comma-separated list of
2630snapshots.
2631Only the snapshot's short name
2632.Po the part after the
2633.Sy @
2634.Pc
2635should be specified when using a range or comma-separated list to identify
2636multiple snapshots.
2637.Bl -tag -width "-R"
2638.It Fl R
13fe0198 2639Recursively destroy all clones of these snapshots, including the clones,
44f09cdc
BB
2640snapshots, and children.
2641If this flag is specified, the
2642.Fl d
2643flag will have no effect.
2644.It Fl d
83362e8e
PZ
2645Destroy immediately. If a snapshot cannot be destroyed now, mark it for
2646deferred destruction.
44f09cdc
BB
2647.It Fl n
2648Do a dry-run
2649.Pq Qq No-op
2650deletion.
2651No data will be deleted.
2652This is useful in conjunction with the
2653.Fl p
2654or
2655.Fl v
2656flags to determine what data would be deleted.
2657.It Fl p
330d06f9 2658Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2659.It Fl r
2660Destroy
2661.Pq or mark for deferred deletion
2662all snapshots with this name in descendent file systems.
2663.It Fl v
330d06f9 2664Print verbose information about the deleted data.
44f09cdc
BB
2665.Pp
2666Extreme care should be taken when applying either the
2667.Fl r
2668or the
2669.Fl R
330d06f9
MA
2670options, as they can destroy large portions of a pool and cause unexpected
2671behavior for mounted file systems in use.
44f09cdc
BB
2672.El
2673.It Xo
2674.Nm
2675.Cm destroy
2676.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2677.Xc
da536844 2678The given bookmark is destroyed.
44f09cdc
BB
2679.It Xo
2680.Nm
2681.Cm snapshot
2682.Op Fl r
63f88c12 2683.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
44f09cdc
BB
2684.Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2685.Xc
2686Creates snapshots with the given names.
2687All previous modifications by successful system calls to the file system are
2688part of the snapshots.
2689Snapshots are taken atomically, so that all snapshots correspond to the same
2690moment in time.
63f88c12 2691.Nm zfs Cm snap
2692can be used as an alias for
2693.Nm zfs Cm snapshot.
44f09cdc
BB
2694See the
2695.Sx Snapshots
2696section for details.
2697.Bl -tag -width "-o"
2698.It Fl o Ar property Ns = Ns Ar value
2699Sets the specified property; see
2700.Nm zfs Cm create
2701for details.
2702.It Fl r
2703Recursively create snapshots of all descendent datasets
2704.El
2705.It Xo
2706.Nm
2707.Cm rollback
2708.Op Fl Rfr
2709.Ar snapshot
2710.Xc
2711Roll back the given dataset to a previous snapshot.
2712When a dataset is rolled back, all data that has changed since the snapshot is
2713discarded, and the dataset reverts to the state at the time of the snapshot.
2714By default, the command refuses to roll back to a snapshot other than the most
2715recent one.
2716In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2717specifying the
2718.Fl r
2719option.
2720.Pp
2721The
2722.Fl rR
2723options do not recursively destroy the child snapshots of a recursive snapshot.
2724Only direct snapshots of the specified filesystem are destroyed by either of
2725these options.
2726To completely roll back a recursive snapshot, you must rollback the individual
2727child snapshots.
2728.Bl -tag -width "-R"
2729.It Fl R
2730Destroy any more recent snapshots and bookmarks, as well as any clones of those
2731snapshots.
2732.It Fl f
2733Used with the
2734.Fl R
2735option to force an unmount of any clone file systems that are to be destroyed.
2736.It Fl r
da536844 2737Destroy any snapshots and bookmarks more recent than the one specified.
44f09cdc
BB
2738.El
2739.It Xo
2740.Nm
2741.Cm clone
2742.Op Fl p
2743.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2744.Ar snapshot Ar filesystem Ns | Ns Ar volume
2745.Xc
2746Creates a clone of the given snapshot.
2747See the
2748.Sx Clones
2749section for details.
2750The target dataset can be located anywhere in the ZFS hierarchy, and is created
2751as the same type as the original.
2752.Bl -tag -width "-o"
2753.It Fl o Ar property Ns = Ns Ar value
2754Sets the specified property; see
2755.Nm zfs Cm create
2756for details.
2757.It Fl p
2758Creates all the non-existing parent datasets.
2759Datasets created in this manner are automatically mounted according to the
2760.Sy mountpoint
2761property inherited from their parent.
2762If the target filesystem or volume already exists, the operation completes
2763successfully.
2764.El
2765.It Xo
2766.Nm
2767.Cm promote
2768.Ar clone-filesystem
2769.Xc
2770Promotes a clone file system to no longer be dependent on its
2771.Qq origin
2772snapshot.
2773This makes it possible to destroy the file system that the clone was created
2774from.
2775The clone parent-child dependency relationship is reversed, so that the origin
2776file system becomes a clone of the specified file system.
2777.Pp
2778The snapshot that was cloned, and any snapshots previous to this snapshot, are
2779now owned by the promoted clone.
2780The space they use moves from the origin file system to the promoted clone, so
2781enough space must be available to accommodate these snapshots.
2782No new space is consumed by this operation, but the space accounting is
2783adjusted.
2784The promoted clone must not have any conflicting snapshot names of its own.
2785The
2786.Cm rename
2787subcommand can be used to rename any conflicting snapshots.
2788.It Xo
2789.Nm
2790.Cm rename
2791.Op Fl f
2792.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2793.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2794.Xc
2795.It Xo
2796.Nm
2797.Cm rename
2798.Op Fl fp
2799.Ar filesystem Ns | Ns Ar volume
2800.Ar filesystem Ns | Ns Ar volume
2801.Xc
2802Renames the given dataset.
2803The new target can be located anywhere in the ZFS hierarchy, with the exception
2804of snapshots.
2805Snapshots can only be renamed within the parent file system or volume.
2806When renaming a snapshot, the parent file system of the snapshot does not need
2807to be specified as part of the second argument.
2808Renamed file systems can inherit new mount points, in which case they are
2809unmounted and remounted at the new mount point.
2810.Bl -tag -width "-a"
2811.It Fl f
db49968e 2812Force unmount any filesystems that need to be unmounted in the process.
44f09cdc
BB
2813.It Fl p
2814Creates all the nonexistent parent datasets.
2815Datasets created in this manner are automatically mounted according to the
2816.Sy mountpoint
2817property inherited from their parent.
2818.El
2819.It Xo
2820.Nm
2821.Cm rename
2822.Fl r
2823.Ar snapshot Ar snapshot
2824.Xc
2825Recursively rename the snapshots of all descendent datasets.
2826Snapshots are the only dataset that can be renamed recursively.
2827.It Xo
2828.Nm
2829.Cm list
2830.Op Fl r Ns | Ns Fl d Ar depth
2831.Op Fl Hp
2832.Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2833.Oo Fl s Ar property Oc Ns ...
2834.Oo Fl S Ar property Oc Ns ...
2835.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2836.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2837.Xc
2838Lists the property information for the given datasets in tabular form.
2839If specified, you can list property information by the absolute pathname or the
2840relative pathname.
2841By default, all file systems and volumes are displayed.
2842Snapshots are displayed if the
2843.Sy listsnaps
2844property is
2845.Sy on
2846.Po the default is
2847.Sy off
2848.Pc .
7106b236
AR
2849The following fields are displayed:
2850.Sy name Ns \&, Sy used Ns \&, Sy available Ns \&, Sy referenced Ns \&, Sy mountpoint Ns .
44f09cdc
BB
2851.Bl -tag -width "-H"
2852.It Fl H
2853Used for scripting mode.
2854Do not print headers and separate fields by a single tab instead of arbitrary
2855white space.
2856.It Fl S Ar property
2857Same as the
2858.Fl s
2859option, but sorts by property in descending order.
2860.It Fl d Ar depth
2861Recursively display any children of the dataset, limiting the recursion to
2862.Ar depth .
2863A
2864.Ar depth
2865of
2866.Sy 1
2867will display only the dataset and its direct children.
2868.It Fl o Ar property
2869A comma-separated list of properties to display.
2870The property must be:
2871.Bl -bullet
2872.It
2873One of the properties described in the
2874.Sx Native Properties
2875section
2876.It
058ac9ba 2877A user property
44f09cdc
BB
2878.It
2879The value
2880.Sy name
2881to display the dataset name
2882.It
2883The value
2884.Sy space
2885to display space usage properties on file systems and volumes.
2886This is a shortcut for specifying
d7323e79
GDN
2887.Fl o Sy name Ns \&, Ns Sy avail Ns \&, Ns Sy used Ns \&, Ns Sy usedsnap Ns \&, Ns
2888.Sy usedds Ns \&, Ns Sy usedrefreserv Ns \&, Ns Sy usedchild Fl t
2889.Sy filesystem Ns \&, Ns Sy volume
44f09cdc
BB
2890syntax.
2891.El
2892.It Fl p
2893Display numbers in parsable
2894.Pq exact
2895values.
2896.It Fl r
2897Recursively display any children of the dataset on the command line.
2898.It Fl s Ar property
2899A property for sorting the output by column in ascending order based on the
2900value of the property.
2901The property must be one of the properties described in the
2902.Sx Properties
9810410a 2903section or the value
44f09cdc
BB
2904.Sy name
2905to sort by the dataset name.
2906Multiple properties can be specified at one time using multiple
2907.Fl s
2908property options.
2909Multiple
2910.Fl s
2911options are evaluated from left to right in decreasing order of importance.
058ac9ba 2912The following is a list of sorting criteria:
44f09cdc
BB
2913.Bl -bullet
2914.It
058ac9ba 2915Numeric types sort in numeric order.
44f09cdc 2916.It
058ac9ba 2917String types sort in alphabetical order.
44f09cdc
BB
2918.It
2919Types inappropriate for a row sort that row to the literal bottom, regardless of
2920the specified ordering.
2921.El
2922.Pp
2923If no sorting options are specified the existing behavior of
2924.Nm zfs Cm list
2925is preserved.
2926.It Fl t Ar type
2927A comma-separated list of types to display, where
2928.Ar type
2929is one of
2930.Sy filesystem ,
2931.Sy snapshot ,
2932.Sy volume ,
2933.Sy bookmark ,
2934or
2935.Sy all .
2936For example, specifying
2937.Fl t Sy snapshot
2938displays only snapshots.
2939.El
2940.It Xo
2941.Nm
2942.Cm set
2943.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2944.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2945.Xc
23de906c 2946Sets the property or list of properties to the given value(s) for each dataset.
44f09cdc
BB
2947Only some properties can be edited.
2948See the
2949.Sx Properties
2950section for more information on what properties can be set and acceptable
2951values.
2952Numeric values can be specified as exact values, or in a human-readable form
2953with a suffix of
2954.Sy B , K , M , G , T , P , E , Z
2955.Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2956or zettabytes, respectively
2957.Pc .
2958User properties can be set on snapshots.
2959For more information, see the
2960.Sx User Properties
2961section.
2962.It Xo
2963.Nm
2964.Cm get
2965.Op Fl r Ns | Ns Fl d Ar depth
2966.Op Fl Hp
2967.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2968.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2969.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2970.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
48b0b649 2971.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns ...
44f09cdc
BB
2972.Xc
2973Displays properties for the given datasets.
2974If no datasets are specified, then the command displays properties for all
2975datasets on the system.
2976For each property, the following columns are displayed:
2977.Bd -literal
058ac9ba 2978 name Dataset name
44f09cdc
BB
2979 property Property name
2980 value Property value
bd9c1958
CS
2981 source Property source \fBlocal\fP, \fBdefault\fP, \fBinherited\fP,
2982 \fBtemporary\fP, \fBreceived\fP or none (\fB-\fP).
44f09cdc
BB
2983.Ed
2984.Pp
2985All columns are displayed by default, though this can be controlled by using the
2986.Fl o
2987option.
2988This command takes a comma-separated list of properties as described in the
2989.Sx Native Properties
2990and
2991.Sx User Properties
2992sections.
2993.Pp
9810410a 2994The value
44f09cdc
BB
2995.Sy all
2996can be used to display all properties that apply to the given dataset's type
2997.Pq filesystem, volume, snapshot, or bookmark .
2998.Bl -tag -width "-H"
2999.It Fl H
3000Display output in a form more easily parsed by scripts.
3001Any headers are omitted, and fields are explicitly separated by a single tab
3002instead of an arbitrary amount of space.
3003.It Fl d Ar depth
3004Recursively display any children of the dataset, limiting the recursion to
3005.Ar depth .
3006A depth of
3007.Sy 1
3008will display only the dataset and its direct children.
3009.It Fl o Ar field
3010A comma-separated list of columns to display.
d7323e79 3011.Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
44f09cdc
BB
3012is the default value.
3013.It Fl p
3014Display numbers in parsable
3015.Pq exact
3016values.
3017.It Fl r
058ac9ba 3018Recursively display properties for any children.
44f09cdc
BB
3019.It Fl s Ar source
3020A comma-separated list of sources to display.
3021Those properties coming from a source other than those in this list are ignored.
3022Each source must be one of the following:
3023.Sy local ,
3024.Sy default ,
3025.Sy inherited ,
3026.Sy temporary ,
bd9c1958 3027.Sy received ,
44f09cdc
BB
3028and
3029.Sy none .
3030The default value is all sources.
3031.It Fl t Ar type
3032A comma-separated list of types to display, where
3033.Ar type
3034is one of
3035.Sy filesystem ,
3036.Sy snapshot ,
3037.Sy volume ,
3038.Sy bookmark ,
3039or
3040.Sy all .
3041.El
3042.It Xo
3043.Nm
3044.Cm inherit
3045.Op Fl rS
3046.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
3047.Xc
3048Clears the specified property, causing it to be inherited from an ancestor,
3049restored to default if no ancestor has the property set, or with the
3050.Fl S
3051option reverted to the received value if one exists.
3052See the
3053.Sx Properties
3054section for a listing of default values, and details on which properties can be
3055inherited.
3056.Bl -tag -width "-r"
3057.It Fl r
058ac9ba 3058Recursively inherit the given property for all children.
44f09cdc 3059.It Fl S
0bf8501a 3060Revert the property to the received value if one exists; otherwise operate as
44f09cdc
BB
3061if the
3062.Fl S
3063option was not specified.
3064.El
3065.It Xo
3066.Nm
3067.Cm upgrade
3068.Xc
058ac9ba 3069Displays a list of file systems that are not the most recent version.
44f09cdc
BB
3070.It Xo
3071.Nm
3072.Cm upgrade
3073.Fl v
3074.Xc
3075Displays a list of currently supported file system versions.
3076.It Xo
3077.Nm
3078.Cm upgrade
3079.Op Fl r
3080.Op Fl V Ar version
3081.Fl a | Ar filesystem
3082.Xc
3083Upgrades file systems to a new on-disk version.
3084Once this is done, the file systems will no longer be accessible on systems
3085running older versions of the software.
3086.Nm zfs Cm send
3087streams generated from new snapshots of these file systems cannot be accessed on
3088systems running older versions of the software.
3089.Pp
3090In general, the file system version is independent of the pool version.
3091See
3092.Xr zpool 8
3093for information on the
3094.Nm zpool Cm upgrade
3095command.
3096.Pp
3097In some cases, the file system version and the pool version are interrelated and
3098the pool version must be upgraded before the file system version can be
3099upgraded.
3100.Bl -tag -width "-V"
3101.It Fl V Ar version
3102Upgrade to the specified
3103.Ar version .
3104If the
3105.Fl V
3106flag is not specified, this command upgrades to the most recent version.
3107This
3108option can only be used to increase the version number, and only up to the most
3109recent version supported by this software.
3110.It Fl a
3111Upgrade all file systems on all imported pools.
3112.It Ar filesystem
3113Upgrade the specified file system.
3114.It Fl r
3115Upgrade the specified file system and all descendent file systems.
3116.El
3117.It Xo
3118.Nm
3119.Cm userspace
3120.Op Fl Hinp
3121.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3122.Oo Fl s Ar field Oc Ns ...
3123.Oo Fl S Ar field Oc Ns ...
3124.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3125.Ar filesystem Ns | Ns Ar snapshot
3126.Xc
3127Displays space consumed by, and quotas on, each user in the specified filesystem
3128or snapshot.
3129This corresponds to the
3130.Sy userused@ Ns Em user ,
3131.Sy userobjused@ Ns Em user ,
3132.Sy userquota@ Ns Em user,
3133and
3134.Sy userobjquota@ Ns Em user
3135properties.
3136.Bl -tag -width "-H"
3137.It Fl H
3138Do not print headers, use tab-delimited output.
3139.It Fl S Ar field
3140Sort by this field in reverse order.
3141See
3142.Fl s .
3143.It Fl i
3144Translate SID to POSIX ID.
3145The POSIX ID may be ephemeral if no mapping exists.
3146Normal POSIX interfaces
3147.Po for example,
3148.Xr stat 2 ,
3149.Nm ls Fl l
3150.Pc
3151perform this translation, so the
3152.Fl i
3153option allows the output from
3154.Nm zfs Cm userspace
3155to be compared directly with those utilities.
3156However,
3157.Fl i
5990da81 3158may lead to confusion if some files were created by an SMB user before a
44f09cdc
BB
3159SMB-to-POSIX name mapping was established.
3160In such a case, some files will be owned by the SMB entity and some by the POSIX
3161entity.
3162However, the
3163.Fl i
3164option will report that the POSIX entity has the total usage and quota for both.
3165.It Fl n
3166Print numeric ID instead of user/group name.
3167.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
3168Display only the specified fields from the following set:
3169.Sy type ,
3170.Sy name ,
3171.Sy used ,
3172.Sy quota .
3173The default is to display all fields.
3174.It Fl p
3175Use exact
3176.Pq parsable
3177numeric output.
3178.It Fl s Ar field
3179Sort output by this field.
3180The
3181.Fl s
3182and
3183.Fl S
3184flags may be specified multiple times to sort first by one field, then by
3185another.
3186The default is
3187.Fl s Sy type Fl s Sy name .
3188.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
3189Print only the specified types from the following set:
3190.Sy all ,
3191.Sy posixuser ,
3192.Sy smbuser ,
3193.Sy posixgroup ,
3194.Sy smbgroup .
3195The default is
d7323e79 3196.Fl t Sy posixuser Ns \&, Ns Sy smbuser .
44f09cdc
BB
3197The default can be changed to include group types.
3198.El
3199.It Xo
3200.Nm
3201.Cm groupspace
3202.Op Fl Hinp
3203.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3204.Oo Fl s Ar field Oc Ns ...
3205.Oo Fl S Ar field Oc Ns ...
3206.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3207.Ar filesystem Ns | Ns Ar snapshot
3208.Xc
5990da81 3209Displays space consumed by, and quotas on, each group in the specified
44f09cdc
BB
3210filesystem or snapshot.
3211This subcommand is identical to
3212.Nm zfs Cm userspace ,
3213except that the default types to display are
d7323e79 3214.Fl t Sy posixgroup Ns \&, Ns Sy smbgroup .
44f09cdc
BB
3215.It Xo
3216.Nm
9c5167d1
NF
3217.Cm projectspace
3218.Op Fl Hp
3219.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3220.Oo Fl s Ar field Oc Ns ...
3221.Oo Fl S Ar field Oc Ns ...
3222.Ar filesystem Ns | Ns Ar snapshot
3223.Xc
3224Displays space consumed by, and quotas on, each project in the specified
3225filesystem or snapshot. This subcommand is identical to
3226.Nm zfs Cm userspace ,
3227except that the project identifier is numeral, not name. So need neither
3228the option
3229.Sy -i
3230for SID to POSIX ID nor
3231.Sy -n
3232for numeric ID, nor
3233.Sy -t
3234for types.
3235.It Xo
3236.Nm
3237.Cm project
3238.Oo Fl d Ns | Ns Fl r Ns Oc
3239.Ar file Ns | Ns Ar directory Ns ...
3240.Xc
3241List project identifier (ID) and inherit flag of file(s) or directories.
3242.Bl -tag -width "-d"
3243.It Fl d
3244Show the directory project ID and inherit flag, not its childrens. It will
3245overwrite the former specified
3246.Fl r
3247option.
3248.It Fl r
3249Show on subdirectories recursively. It will overwrite the former specified
3250.Fl d
3251option.
3252.El
3253.It Xo
3254.Nm
3255.Cm project
3256.Fl C
3257.Oo Fl kr Ns Oc
3258.Ar file Ns | Ns Ar directory Ns ...
3259.Xc
3260Clear project inherit flag and/or ID on the file(s) or directories.
3261.Bl -tag -width "-k"
3262.It Fl k
3263Keep the project ID unchanged. If not specified, the project ID will be reset
3264as zero.
3265.It Fl r
3266Clear on subdirectories recursively.
3267.El
3268.It Xo
3269.Nm
3270.Cm project
3271.Fl c
3272.Oo Fl 0 Ns Oc
3273.Oo Fl d Ns | Ns Fl r Ns Oc
3274.Op Fl p Ar id
3275.Ar file Ns | Ns Ar directory Ns ...
3276.Xc
3277Check project ID and inherit flag on the file(s) or directories, report the
3278entries without project inherit flag or with different project IDs from the
3279specified (via
3280.Fl p
3281option) value or the target directory's project ID.
3282.Bl -tag -width "-0"
3283.It Fl 0
3284Print file name with a trailing NUL instead of newline (by default), like
3285"find -print0".
3286.It Fl d
3287Check the directory project ID and inherit flag, not its childrens. It will
3288overwrite the former specified
3289.Fl r
3290option.
3291.It Fl p
3292Specify the referenced ID for comparing with the target file(s) or directories'
3293project IDs. If not specified, the target (top) directory's project ID will be
3294used as the referenced one.
3295.It Fl r
3296Check on subdirectories recursively. It will overwrite the former specified
3297.Fl d
3298option.
3299.El
3300.It Xo
3301.Nm
3302.Cm project
3303.Op Fl p Ar id
3304.Oo Fl rs Ns Oc
3305.Ar file Ns | Ns Ar directory Ns ...
3306.Xc
3307.Bl -tag -width "-p"
3308Set project ID and/or inherit flag on the file(s) or directories.
3309.It Fl p
3310Set the file(s)' or directories' project ID with the given value.
3311.It Fl r
3312Set on subdirectories recursively.
3313.It Fl s
3314Set project inherit flag on the given file(s) or directories. It is usually used
3315for setup tree quota on the directory target with
3316.Fl r
3317option specified together. When setup tree quota, by default the directory's
3318project ID will be set to all its descendants unless you specify the project
3319ID via
3320.Fl p
3321option explicitly.
3322.El
3323.It Xo
3324.Nm
44f09cdc
BB
3325.Cm mount
3326.Xc
3327Displays all ZFS file systems currently mounted.
3328.It Xo
3329.Nm
3330.Cm mount
b5256303 3331.Op Fl Olv
44f09cdc
BB
3332.Op Fl o Ar options
3333.Fl a | Ar filesystem
3334.Xc
11f6127a
KP
3335Mount ZFS filesystem on a path described by its
3336.Sy mountpoint
3337property, if the path exists and is empty. If
3338.Sy mountpoint
3339is set to
3340.Em legacy ,
3341the filesystem should be instead mounted using
3342.Xr mount 8 .
44f09cdc
BB
3343.Bl -tag -width "-O"
3344.It Fl O
11f6127a
KP
3345Perform an overlay mount. Allows mounting in non-empty
3346.Sy mountpoint .
44f09cdc
BB
3347See
3348.Xr mount 8
3349for more information.
3350.It Fl a
3351Mount all available ZFS file systems.
11f6127a 3352Invoked automatically as part of the boot process if configured.
44f09cdc 3353.It Ar filesystem
058ac9ba 3354Mount the specified filesystem.
44f09cdc
BB
3355.It Fl o Ar options
3356An optional, comma-separated list of mount options to use temporarily for the
3357duration of the mount.
3358See the
3359.Sx Temporary Mount Point Properties
3360section for details.
b5256303
TC
3361.It Fl l
3362Load keys for encrypted filesystems as they are being mounted. This is
3363equivalent to executing
3364.Nm zfs Cm load-key
3365on each encryption root before mounting it. Note that if a filesystem has a
3366.Sy keylocation
3367of
3368.Sy prompt
3369this will cause the terminal to interactively block after asking for the key.
44f09cdc
BB
3370.It Fl v
3371Report mount progress.
3372.El
3373.It Xo
3374.Nm
3375.Cm unmount
3376.Op Fl f
3377.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3378.Xc
3379Unmounts currently mounted ZFS file systems.
3380.Bl -tag -width "-a"
3381.It Fl a
3382Unmount all available ZFS file systems.
3383Invoked automatically as part of the shutdown process.
3384.It Ar filesystem Ns | Ns Ar mountpoint
3385Unmount the specified filesystem.
3386The command can also be given a path to a ZFS file system mount point on the
3387system.
3388.It Fl f
058ac9ba 3389Forcefully unmount the file system, even if it is currently in use.
44f09cdc
BB
3390.El
3391.It Xo
3392.Nm
3393.Cm share
3394.Fl a | Ar filesystem
3395.Xc
3396Shares available ZFS file systems.
3397.Bl -tag -width "-a"
3398.It Fl a
3399Share all available ZFS file systems.
3400Invoked automatically as part of the boot process.
3401.It Ar filesystem
3402Share the specified filesystem according to the
3403.Sy sharenfs
3404and
3405.Sy sharesmb
3406properties.
3407File systems are shared when the
3408.Sy sharenfs
3409or
3410.Sy sharesmb
3411property is set.
3412.El
3413.It Xo
3414.Nm
3415.Cm unshare
3416.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3417.Xc
3418Unshares currently shared ZFS file systems.
3419.Bl -tag -width "-a"
3420.It Fl a
3421Unshare all available ZFS file systems.
3422Invoked automatically as part of the shutdown process.
3423.It Ar filesystem Ns | Ns Ar mountpoint
3424Unshare the specified filesystem.
3425The command can also be given a path to a ZFS file system shared on the system.
3426.El
3427.It Xo
3428.Nm
3429.Cm bookmark
3430.Ar snapshot bookmark
3431.Xc
3432Creates a bookmark of the given snapshot.
3433Bookmarks mark the point in time when the snapshot was created, and can be used
3434as the incremental source for a
3435.Nm zfs Cm send
3436command.
3437.Pp
da536844 3438This feature must be enabled to be used.
44f09cdc
BB
3439See
3440.Xr zpool-features 5
3441for details on ZFS feature flags and the
3442.Sy bookmarks
3443feature.
3444.It Xo
3445.Nm
3446.Cm send
9c5e88b1 3447.Op Fl DLPRbcehnpvw
44f09cdc
BB
3448.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
3449.Ar snapshot
3450.Xc
3451Creates a stream representation of the second
3452.Ar snapshot ,
3453which is written to standard output.
3454The output can be redirected to a file or to a different system
3455.Po for example, using
3456.Xr ssh 1
3457.Pc .
3458By default, a full stream is generated.
3459.Bl -tag -width "-D"
3460.It Fl D, -dedup
3461Generate a deduplicated stream.
3462Blocks which would have been sent multiple times in the send stream will only be
3463sent once.
3464The receiving system must also support this feature to receive a deduplicated
3465stream.
3466This flag can be used regardless of the dataset's
3467.Sy dedup
3468property, but performance will be much better if the filesystem uses a
3469dedup-capable checksum
3470.Po for example,
3471.Sy sha256
3472.Pc .
3473.It Fl I Ar snapshot
3474Generate a stream package that sends all intermediary snapshots from the first
3475snapshot to the second snapshot.
3476For example,
3477.Fl I Em @a Em fs@d
3478is similar to
d7323e79 3479.Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
44f09cdc
BB
3480The incremental source may be specified as with the
3481.Fl i
3482option.
3483.It Fl L, -large-block
3484Generate a stream which may contain blocks larger than 128KB.
3485This flag has no effect if the
3486.Sy large_blocks
3487pool feature is disabled, or if the
3488.Sy recordsize
3489property of this filesystem has never been set above 128KB.
3490The receiving system must have the
3491.Sy large_blocks
3492pool feature enabled as well.
3493See
3494.Xr zpool-features 5
3495for details on ZFS feature flags and the
3496.Sy large_blocks
3497feature.
3498.It Fl P, -parsable
9566fb1a 3499Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3500.It Fl R, -replicate
3501Generate a replication stream package, which will replicate the specified
3502file system, and all descendent file systems, up to the named snapshot.
3503When received, all properties, snapshots, descendent file systems, and clones
3504are preserved.
3505.Pp
3506If the
3507.Fl i
3508or
3509.Fl I
3510flags are used in conjunction with the
3511.Fl R
3512flag, an incremental replication stream is generated.
3513The current values of properties, and current snapshot and file system names are
3514set when the stream is received.
3515If the
3516.Fl F
3517flag is specified when this stream is received, snapshots and file systems that
dd29864b
TC
3518do not exist on the sending side are destroyed. If the
3519.Fl R
3520flag is used to send encrypted datasets, then
3521.Fl w
3522must also be specified.
44f09cdc
BB
3523.It Fl e, -embed
3524Generate a more compact stream by using
3525.Sy WRITE_EMBEDDED
3526records for blocks which are stored more compactly on disk by the
3527.Sy embedded_data
3528pool feature.
3529This flag has no effect if the
3530.Sy embedded_data
3531feature is disabled.
3532The receiving system must have the
3533.Sy embedded_data
3534feature enabled.
3535If the
3536.Sy lz4_compress
3537feature is active on the sending system, then the receiving system must have
4807c0ba
TC
3538that feature enabled as well. Datasets that are sent with this flag may not be
3539received as an encrypted dataset, since encrypted datasets cannot use the
3540.Sy embedded_data
3541feature.
44f09cdc
BB
3542See
3543.Xr zpool-features 5
3544for details on ZFS feature flags and the
3545.Sy embedded_data
3546feature.
faa97c16 3547.It Fl b, -backup
3548Sends only received property values whether or not they are overridden by local
3549settings, but only if the dataset has ever been received. Use this option when
3550you want
3551.Nm zfs Cm receive
3552to restore received properties backed up on the sent dataset and to avoid
3553sending local settings that may have nothing to do with the source dataset,
3554but only with how the data is backed up.
44f09cdc 3555.It Fl c, -compressed
2aa34383 3556Generate a more compact stream by using compressed WRITE records for blocks
44f09cdc
BB
3557which are compressed on disk and in memory
3558.Po see the
3559.Sy compression
3560property for details
3561.Pc .
3562If the
3563.Sy lz4_compress
3564feature is active on the sending system, then the receiving system must have
3565that feature enabled as well.
3566If the
3567.Sy large_blocks
3568feature is enabled on the sending system but the
3569.Fl L
3570option is not supplied in conjunction with
3571.Fl c ,
3572then the data will be decompressed before sending so it can be split into
3573smaller block sizes.
b5256303
TC
3574.It Fl w, -raw
3575For encrypted datasets, send data exactly as it exists on disk. This allows
3576backups to be taken even if encryption keys are not currently loaded. The
3577backup may then be received on an untrusted machine since that machine will
3578not have the encryption keys to read the protected data or alter it without
3579being detected. Upon being received, the dataset will have the same encryption
3580keys as it did on the send side, although the
3581.Sy keylocation
3582property will be defaulted to
3583.Sy prompt
3584if not otherwise provided. For unencrypted datasets, this flag will be
3585equivalent to
3586.Fl Lec .
3587Note that if you do not use this flag for sending encrypted datasets, data will
3588be sent unencrypted and may be re-encrypted with a different encryption key on
3589the receiving system, which will disable the ability to do a raw send to that
3590system for incrementals.
9c5e88b1
PZ
3591.It Fl h, -holds
3592Generate a stream package that includes any snapshot holds (created with the
3593.Sy zfs hold
3594command), and indicating to
dd29864b 3595.Sy zfs receive
9c5e88b1 3596that the holds be applied to the dataset on the receiving system.
44f09cdc
BB
3597.It Fl i Ar snapshot
3598Generate an incremental stream from the first
3599.Ar snapshot
3600.Pq the incremental source
3601to the second
3602.Ar snapshot
3603.Pq the incremental target .
3604The incremental source can be specified as the last component of the snapshot
3605name
3606.Po the
3607.Sy @
3608character and following
3609.Pc
3610and it is assumed to be from the same file system as the incremental target.
3611.Pp
3612If the destination is a clone, the source may be the origin snapshot, which must
3613be fully specified
3614.Po for example,
3615.Em pool/fs@origin ,
3616not just
3617.Em @origin
3618.Pc .
3619.It Fl n, -dryrun
3620Do a dry-run
3621.Pq Qq No-op
3622send.
3623Do not generate any actual send data.
3624This is useful in conjunction with the
3625.Fl v
3626or
3627.Fl P
3628flags to determine what data will be sent.
3629In this case, the verbose output will be written to standard output
3630.Po contrast with a non-dry-run, where the stream is written to standard output
3631and the verbose output goes to standard error
3632.Pc .
3633.It Fl p, -props
3634Include the dataset's properties in the stream.
3635This flag is implicit when
3636.Fl R
3637is specified.
4807c0ba
TC
3638The receiving system must also support this feature. Sends of encrypted datasets
3639must use
3640.Fl w
3641when using this flag.
44f09cdc
BB
3642.It Fl v, -verbose
3643Print verbose information about the stream package generated.
3644This information includes a per-second report of how much data has been sent.
3645.Pp
3646The format of the stream is committed.
29179568 3647You will be able to receive your streams on future versions of ZFS.
835db585 3648.El
44f09cdc
BB
3649.It Xo
3650.Nm
3651.Cm send
835db585 3652.Op Fl LPcenvw
44f09cdc
BB
3653.Op Fl i Ar snapshot Ns | Ns Ar bookmark
3654.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3655.Xc
3656Generate a send stream, which may be of a filesystem, and may be incremental
3657from a bookmark.
3658If the destination is a filesystem or volume, the pool must be read-only, or the
3659filesystem must not be mounted.
3660When the stream generated from a filesystem or volume is received, the default
3661snapshot name will be
3662.Qq --head-- .
3663.Bl -tag -width "-L"
3664.It Fl L, -large-block
3665Generate a stream which may contain blocks larger than 128KB.
3666This flag has no effect if the
3667.Sy large_blocks
3668pool feature is disabled, or if the
3669.Sy recordsize
3670property of this filesystem has never been set above 128KB.
3671The receiving system must have the
3672.Sy large_blocks
3673pool feature enabled as well.
3674See
3675.Xr zpool-features 5
3676for details on ZFS feature flags and the
3677.Sy large_blocks
3678feature.
835db585 3679.It Fl P, -parsable
3680Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3681.It Fl c, -compressed
3682Generate a more compact stream by using compressed WRITE records for blocks
3683which are compressed on disk and in memory
3684.Po see the
3685.Sy compression
3686property for details
3687.Pc .
3688If the
3689.Sy lz4_compress
3690feature is active on the sending system, then the receiving system must have
3691that feature enabled as well.
3692If the
3693.Sy large_blocks
3694feature is enabled on the sending system but the
3695.Fl L
3696option is not supplied in conjunction with
3697.Fl c ,
3698then the data will be decompressed before sending so it can be split into
3699smaller block sizes.
b5256303
TC
3700.It Fl w, -raw
3701For encrypted datasets, send data exactly as it exists on disk. This allows
3702backups to be taken even if encryption keys are not currently loaded. The
3703backup may then be received on an untrusted machine since that machine will
3704not have the encryption keys to read the protected data or alter it without
3705being detected. Upon being received, the dataset will have the same encryption
3706keys as it did on the send side, although the
3707.Sy keylocation
3708property will be defaulted to
3709.Sy prompt
3710if not otherwise provided. For unencrypted datasets, this flag will be
3711equivalent to
3712.Fl Lec .
3713Note that if you do not use this flag for sending encrypted datasets, data will
3714be sent unencrypted and may be re-encrypted with a different encryption key on
3715the receiving system, which will disable the ability to do a raw send to that
3716system for incrementals.
44f09cdc
BB
3717.It Fl e, -embed
3718Generate a more compact stream by using
3719.Sy WRITE_EMBEDDED
3720records for blocks which are stored more compactly on disk by the
3721.Sy embedded_data
3722pool feature.
3723This flag has no effect if the
3724.Sy embedded_data
3725feature is disabled.
3726The receiving system must have the
3727.Sy embedded_data
3728feature enabled.
3729If the
3730.Sy lz4_compress
3731feature is active on the sending system, then the receiving system must have
4807c0ba
TC
3732that feature enabled as well. Datasets that are sent with this flag may not be
3733received as an encrypted dataset, since encrypted datasets cannot use the
3734.Sy embedded_data
3735feature.
44f09cdc
BB
3736See
3737.Xr zpool-features 5
3738for details on ZFS feature flags and the
3739.Sy embedded_data
3740feature.
3741.It Fl i Ar snapshot Ns | Ns Ar bookmark
3742Generate an incremental send stream.
3743The incremental source must be an earlier snapshot in the destination's history.
3744It will commonly be an earlier snapshot in the destination's file system, in
3745which case it can be specified as the last component of the name
3746.Po the
3747.Sy #
3748or
3749.Sy @
3750character and following
3751.Pc .
3752.Pp
3753If the incremental target is a clone, the incremental source can be the origin
3754snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
3755origin, etc.
835db585 3756.It Fl n, -dryrun
3757Do a dry-run
3758.Pq Qq No-op
3759send.
3760Do not generate any actual send data.
3761This is useful in conjunction with the
3762.Fl v
3763or
3764.Fl P
3765flags to determine what data will be sent.
3766In this case, the verbose output will be written to standard output
3767.Po contrast with a non-dry-run, where the stream is written to standard output
3768and the verbose output goes to standard error
3769.Pc .
3770.It Fl v, -verbose
3771Print verbose information about the stream package generated.
3772This information includes a per-second report of how much data has been sent.
44f09cdc
BB
3773.El
3774.It Xo
3775.Nm
3776.Cm send
3777.Op Fl Penv
3778.Fl t
3779.Ar receive_resume_token
3780.Xc
3781Creates a send stream which resumes an interrupted receive.
3782The
3783.Ar receive_resume_token
3784is the value of this property on the filesystem or volume that was being
3785received into.
3786See the documentation for
3787.Sy zfs receive -s
3788for more details.
3789.It Xo
3790.Nm
3791.Cm receive
9c5e88b1 3792.Op Fl Fhnsuv
44f09cdc
BB
3793.Op Fl o Sy origin Ns = Ns Ar snapshot
3794.Op Fl o Ar property Ns = Ns Ar value
3795.Op Fl x Ar property
3796.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3797.Xc
3798.It Xo
3799.Nm
3800.Cm receive
9c5e88b1 3801.Op Fl Fhnsuv
44f09cdc
BB
3802.Op Fl d Ns | Ns Fl e
3803.Op Fl o Sy origin Ns = Ns Ar snapshot
3804.Op Fl o Ar property Ns = Ns Ar value
3805.Op Fl x Ar property
3806.Ar filesystem
3807.Xc
3808Creates a snapshot whose contents are as specified in the stream provided on
3809standard input.
3810If a full stream is received, then a new file system is created as well.
3811Streams are created using the
3812.Nm zfs Cm send
3813subcommand, which by default creates a full stream.
3814.Nm zfs Cm recv
3815can be used as an alias for
3816.Nm zfs Cm receive.
3817.Pp
3818If an incremental stream is received, then the destination file system must
3819already exist, and its most recent snapshot must match the incremental stream's
3820source.
3821For
3822.Sy zvols ,
3823the destination device link is destroyed and recreated, which means the
3824.Sy zvol
3825cannot be accessed during the
3826.Cm receive
3827operation.
3828.Pp
3829When a snapshot replication package stream that is generated by using the
3830.Nm zfs Cm send Fl R
3831command is received, any snapshots that do not exist on the sending location are
3832destroyed by using the
3833.Nm zfs Cm destroy Fl d
3834command.
3835.Pp
3836If
90cdf283 3837.Fl o Em property Ns = Ns Ar value
44f09cdc 3838or
90cdf283 3839.Fl x Em property
44f09cdc
BB
3840is specified, it applies to the effective value of the property throughout
3841the entire subtree of replicated datasets. Effective property values will be
3842set (
3843.Fl o
3844) or inherited (
3845.Fl x
3846) on the topmost in the replicated subtree. In descendant datasets, if the
3847property is set by the send stream, it will be overridden by forcing the
3848property to be inherited from the top‐most file system. Received properties
3849are retained in spite of being overridden and may be restored with
3850.Nm zfs Cm inherit Fl S .
3851Specifying
90cdf283 3852.Fl o Sy origin Ns = Ns Em snapshot
44f09cdc
BB
3853is a special case because, even if
3854.Sy origin
3855is a read-only property and cannot be set, it's allowed to receive the send
3856stream as a clone of the given snapshot.
3857.Pp
4807c0ba
TC
3858Raw encrypted send streams (created with
3859.Nm zfs Cm send Fl w
3860) may only be received as is, and cannot be re-encrypted, decrypted, or
3861recompressed by the receive process. Unencrypted streams can be received as
3862encrypted datasets, either through inheritance or by specifying encryption
3863parameters with the
3864.Fl o
dd29864b
TC
3865options. Note that the
3866.Sy keylocation
3867property cannot be overridden to
3868.Sy prompt
3869during a receive. This is because the receive process itself is already using
3870stdin for the send stream. Instead, the property can be overridden after the
3871receive completes.
4807c0ba 3872.Pp
f00ab3f2
TC
3873The added security provided by raw sends adds some restrictions to the send
3874and receive process. ZFS will not allow a mix of raw receives and non-raw
3875receives. Specifically, any raw incremental receives that are attempted after
3876a non-raw receive will fail. Non-raw receives do not have this restriction and,
3877therefore, are always possible. Because of this, it is best practice to always
3878use either raw sends for their security benefits or non-raw sends for their
3879flexibility when working with encrypted datasets, but not a combination.
3880.Pp
3881The reason for this restriction stems from the inherent restrictions of the
3882AEAD ciphers that ZFS uses to encrypt data. When using ZFS native encryption,
3883each block of data is encrypted against a randomly generated number known as
3884the "initialization vector" (IV), which is stored in the filesystem metadata.
3885This number is required by the encryption algorithms whenever the data is to
3886be decrypted. Together, all of the IVs provided for all of the blocks in a
3887given snapshot are collectively called an "IV set". When ZFS performs a raw
3888send, the IV set is transferred from the source to the destination in the send
3889stream. When ZFS performs a non-raw send, the data is decrypted by the source
3890system and re-encrypted by the destination system, creating a snapshot with
3891effectively the same data, but a different IV set. In order for decryption to
3892work after a raw send, ZFS must ensure that the IV set used on both the source
3893and destination side match. When an incremental raw receive is performed on
3894top of an existing snapshot, ZFS will check to confirm that the "from"
3895snapshot on both the source and destination were using the same IV set,
3896ensuring the new IV set is consistent.
3897.Pp
44f09cdc
BB
3898The name of the snapshot
3899.Pq and file system, if a full stream is received
3900that this subcommand creates depends on the argument type and the use of the
3901.Fl d
3902or
3903.Fl e
3904options.
3905.Pp
3906If the argument is a snapshot name, the specified
3907.Ar snapshot
3908is created.
3909If the argument is a file system or volume name, a snapshot with the same name
3910as the sent snapshot is created within the specified
3911.Ar filesystem
3912or
3913.Ar volume .
3914If neither of the
3915.Fl d
3916or
3917.Fl e
3918options are specified, the provided target snapshot name is used exactly as
3919provided.
3920.Pp
3921The
3922.Fl d
3923and
3924.Fl e
3925options cause the file system name of the target snapshot to be determined by
3926appending a portion of the sent snapshot's name to the specified target
3927.Ar filesystem .
3928If the
3929.Fl d
3930option is specified, all but the first element of the sent snapshot's file
3931system path
3932.Pq usually the pool name
3933is used and any required intermediate file systems within the specified one are
3934created.
3935If the
3936.Fl e
3937option is specified, then only the last element of the sent snapshot's file
3938system name
3939.Pq i.e. the name of the source file system itself
3940is used as the target file system name.
3941.Bl -tag -width "-F"
3942.It Fl F
3943Force a rollback of the file system to the most recent snapshot before
3944performing the receive operation.
3945If receiving an incremental replication stream
3946.Po for example, one generated by
3947.Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3948.Pc ,
3949destroy snapshots and file systems that do not exist on the sending side.
3950.It Fl d
3951Discard the first element of the sent snapshot's file system name, using the
3952remaining elements to determine the name of the target file system for the new
3953snapshot as described in the paragraph above.
3954.It Fl e
3955Discard all but the last element of the sent snapshot's file system name, using
3956that element to determine the name of the target file system for the new
3957snapshot as described in the paragraph above.
dd29864b 3958.It Fl h
9c5e88b1 3959Skip the receive of holds. There is no effect if holds are not sent.
44f09cdc
BB
3960.It Fl n
3961Do not actually receive the stream.
3962This can be useful in conjunction with the
3963.Fl v
3964option to verify the name the receive operation would use.
3965.It Fl o Sy origin Ns = Ns Ar snapshot
e6d3a843
PD
3966Forces the stream to be received as a clone of the given snapshot.
3967If the stream is a full send stream, this will create the filesystem
44f09cdc
BB
3968described by the stream as a clone of the specified snapshot.
3969Which snapshot was specified will not affect the success or failure of the
3970receive, as long as the snapshot does exist.
3971If the stream is an incremental send stream, all the normal verification will be
3972performed.
90cdf283 3973.It Fl o Em property Ns = Ns Ar value
44f09cdc 3974Sets the specified property as if the command
90cdf283 3975.Nm zfs Cm set Em property Ns = Ns Ar value
44f09cdc
BB
3976was invoked immediately before the receive. When receiving a stream from
3977.Nm zfs Cm send Fl R ,
3978causes the property to be inherited by all descendant datasets, as through
3979.Nm zfs Cm inherit Em property
3980was run on any descendant datasets that have this property set on the
3981sending system.
3982.Pp
3983Any editable property can be set at receive time. Set-once properties bound
3984to the received data, such as
3985.Sy normalization
3986and
3987.Sy casesensitivity ,
3988cannot be set at receive time even when the datasets are newly created by
3989.Nm zfs Cm receive .
3990Additionally both settable properties
3991.Sy version
3992and
3993.Sy volsize
3994cannot be set at receive time.
3995.Pp
3996The
3997.Fl o
3998option may be specified multiple times, for different properties. An error
3999results if the same property is specified in multiple
4000.Fl o
4001or
4002.Fl x
4003options.
d9c460a0
TC
4004.Pp
4005The
4006.Fl o
4007option may also be used to override encryption properties upon initial
4008receive. This allows unencrypted streams to be received as encrypted datasets.
4009To cause the received dataset (or root dataset of a recursive stream) to be
4010received as an encryption root, specify encryption properties in the same
4011manner as is required for
4012.Nm
4013.Cm create .
4014For instance:
4015.Bd -literal
4016# zfs send tank/test@snap1 | zfs recv -o encryption=on -o keyformat=passphrase -o keylocation=file:///path/to/keyfile
4017.Ed
4018.Pp
4019Note that
4020.Op Fl o Ar keylocation Ns = Ns Ar prompt
4021may not be specified here, since stdin is already being utilized for the send
4022stream. Once the receive has completed, you can use
4023.Nm
4024.Cm set
4025to change this setting after the fact. Similarly, you can receive a dataset as
4026an encrypted child by specifying
4027.Op Fl x Ar encryption
4028to force the property to be inherited. Overriding encryption properties (except
4029for
4030.Sy keylocation Ns )
4031is not possible with raw send streams.
44f09cdc
BB
4032.It Fl s
4033If the receive is interrupted, save the partially received state, rather
4034than deleting it.
4035Interruption may be due to premature termination of the stream
4036.Po e.g. due to network failure or failure of the remote system
4037if the stream is being read over a network connection
4038.Pc ,
4039a checksum error in the stream, termination of the
4040.Nm zfs Cm receive
4041process, or unclean shutdown of the system.
4042.Pp
4043The receive can be resumed with a stream generated by
4044.Nm zfs Cm send Fl t Ar token ,
4045where the
4046.Ar token
4047is the value of the
4048.Sy receive_resume_token
4049property of the filesystem or volume which is received into.
4050.Pp
4051To use this flag, the storage pool must have the
4052.Sy extensible_dataset
4053feature enabled.
4054See
4055.Xr zpool-features 5
4056for details on ZFS feature flags.
4057.It Fl u
4058File system that is associated with the received stream is not mounted.
4059.It Fl v
4060Print verbose information about the stream and the time required to perform the
4061receive operation.
4062.It Fl x Em property
4063Ensures that the effective value of the specified property after the
4064receive is unaffected by the value of that property in the send stream (if any),
4065as if the property had been excluded from the send stream.
4066.Pp
4067If the specified property is not present in the send stream, this option does
4068nothing.
4069.Pp
4070If a received property needs to be overridden, the effective value will be
4071set or inherited, depending on whether the property is inheritable or not.
4072.Pp
4073In the case of an incremental update,
4074.Fl x
4075leaves any existing local setting or explicit inheritance unchanged.
4076.Pp
4077All
4078.Fl o
9810410a 4079restrictions (e.g. set-once) apply equally to
44f09cdc
BB
4080.Fl x .
4081.El
4082.It Xo
4083.Nm
4084.Cm receive
4085.Fl A
4086.Ar filesystem Ns | Ns Ar volume
4087.Xc
4088Abort an interrupted
4089.Nm zfs Cm receive Fl s ,
4090deleting its saved partially received state.
4091.It Xo
4092.Nm
4093.Cm allow
4094.Ar filesystem Ns | Ns Ar volume
4095.Xc
4096Displays permissions that have been delegated on the specified filesystem or
4097volume.
4098See the other forms of
4099.Nm zfs Cm allow
4100for more information.
4101.Pp
4102Delegations are supported under Linux with the exception of
4103.Sy mount ,
4104.Sy unmount ,
4105.Sy mountpoint ,
4106.Sy canmount ,
4107.Sy rename ,
4108and
4109.Sy share .
4110These permissions cannot be delegated because the Linux
4111.Xr mount 8
4112command restricts modifications of the global namespace to the root user.
4113.It Xo
4114.Nm
4115.Cm allow
4116.Op Fl dglu
4117.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4118.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4119.Ar setname Oc Ns ...
4120.Ar filesystem Ns | Ns Ar volume
0238a975 4121.Xc
4122.It Xo
44f09cdc
BB
4123.Nm
4124.Cm allow
4125.Op Fl dl
4126.Fl e Ns | Ns Sy everyone
4127.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4128.Ar setname Oc Ns ...
4129.Ar filesystem Ns | Ns Ar volume
4130.Xc
4131Delegates ZFS administration permission for the file systems to non-privileged
4132users.
4133.Bl -tag -width "-d"
4134.It Fl d
4135Allow only for the descendent file systems.
4136.It Fl e Ns | Ns Sy everyone
4137Specifies that the permissions be delegated to everyone.
4138.It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
4139Explicitly specify that permissions are delegated to the group.
4140.It Fl l
4141Allow
4142.Qq locally
4143only for the specified file system.
4144.It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
4145Explicitly specify that permissions are delegated to the user.
4146.It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4147Specifies to whom the permissions are delegated.
4148Multiple entities can be specified as a comma-separated list.
4149If neither of the
4150.Fl gu
4151options are specified, then the argument is interpreted preferentially as the
4152keyword
4153.Sy everyone ,
4154then as a user name, and lastly as a group name.
4155To specify a user or group named
4156.Qq everyone ,
4157use the
4158.Fl g
4159or
4160.Fl u
4161options.
4162To specify a group with the same name as a user, use the
4163.Fl g
4164options.
4165.It Xo
4166.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4167.Ar setname Oc Ns ...
4168.Xc
4169The permissions to delegate.
4170Multiple permissions may be specified as a comma-separated list.
4171Permission names are the same as ZFS subcommand and property names.
4172See the property list below.
4173Property set names, which begin with
4174.Sy @ ,
4175may be specified.
4176See the
4177.Fl s
4178form below for details.
4179.El
4180.Pp
4181If neither of the
4182.Fl dl
4183options are specified, or both are, then the permissions are allowed for the
4184file system or volume, and all of its descendents.
4185.Pp
4186Permissions are generally the ability to use a ZFS subcommand or change a ZFS
4187property.
4188The following permissions are available:
4189.Bd -literal
058ac9ba 4190NAME TYPE NOTES
44f09cdc
BB
4191allow subcommand Must also have the permission that is
4192 being allowed
4193clone subcommand Must also have the 'create' ability and
4194 'mount' ability in the origin file system
8750edf1
RL
4195create subcommand Must also have the 'mount' ability.
4196 Must also have the 'refreservation' ability to
4197 create a non-sparse volume.
058ac9ba 4198destroy subcommand Must also have the 'mount' ability
0677cb6f 4199diff subcommand Allows lookup of paths within a dataset
44f09cdc
BB
4200 given an object number, and the ability
4201 to create snapshots necessary to
4202 'zfs diff'.
b5256303
TC
4203load-key subcommand Allows loading and unloading of encryption key
4204 (see 'zfs load-key' and 'zfs unload-key').
4205change-key subcommand Allows changing an encryption key via
4206 'zfs change-key'.
058ac9ba 4207mount subcommand Allows mount/umount of ZFS datasets
44f09cdc
BB
4208promote subcommand Must also have the 'mount' and 'promote'
4209 ability in the origin file system
4210receive subcommand Must also have the 'mount' and 'create'
4211 ability
058ac9ba
BB
4212rename subcommand Must also have the 'mount' and 'create'
4213 ability in the new parent
4214rollback subcommand Must also have the 'mount' ability
6b4e21c6 4215send subcommand
44f09cdc
BB
4216share subcommand Allows sharing file systems over NFS
4217 or SMB protocols
058ac9ba 4218snapshot subcommand Must also have the 'mount' ability
44f09cdc
BB
4219
4220groupquota other Allows accessing any groupquota@...
4221 property
058ac9ba
BB
4222groupused other Allows reading any groupused@... property
4223userprop other Allows changing any user property
44f09cdc
BB
4224userquota other Allows accessing any userquota@...
4225 property
058ac9ba 4226userused other Allows reading any userused@... property
9c5167d1
NF
4227projectobjquota other Allows accessing any projectobjquota@...
4228 property
4229projectquota other Allows accessing any projectquota@... property
4230projectobjused other Allows reading any projectobjused@... property
4231projectused other Allows reading any projectused@... property
058ac9ba 4232
6b4e21c6 4233aclinherit property
44f09cdc 4234acltype property
6b4e21c6
NB
4235atime property
4236canmount property
4237casesensitivity property
4238checksum property
4239compression property
4240copies property
6b4e21c6
NB
4241devices property
4242exec property
788eb90c 4243filesystem_limit property
6b4e21c6
NB
4244mountpoint property
4245nbmand property
4246normalization property
4247primarycache property
4248quota property
4249readonly property
4250recordsize property
4251refquota property
4252refreservation property
4253reservation property
4254secondarycache property
4255setuid property
4256sharenfs property
4257sharesmb property
4258snapdir property
788eb90c 4259snapshot_limit property
6b4e21c6
NB
4260utf8only property
4261version property
4262volblocksize property
4263volsize property
4264vscan property
4265xattr property
4266zoned property
44f09cdc
BB
4267.Ed
4268.It Xo
4269.Nm
4270.Cm allow
4271.Fl c
4272.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4273.Ar setname Oc Ns ...
4274.Ar filesystem Ns | Ns Ar volume
4275.Xc
4276Sets
4277.Qq create time
4278permissions.
4279These permissions are granted
4280.Pq locally
4281to the creator of any newly-created descendent file system.
4282.It Xo
4283.Nm
4284.Cm allow
4285.Fl s No @ Ns Ar setname
4286.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4287.Ar setname Oc Ns ...
4288.Ar filesystem Ns | Ns Ar volume
4289.Xc
4290Defines or adds permissions to a permission set.
4291The set can be used by other
4292.Nm zfs Cm allow
4293commands for the specified file system and its descendents.
4294Sets are evaluated dynamically, so changes to a set are immediately reflected.
4295Permission sets follow the same naming restrictions as ZFS file systems, but the
4296name must begin with
4297.Sy @ ,
4298and can be no more than 64 characters long.
4299.It Xo
4300.Nm
4301.Cm unallow
4302.Op Fl dglru
4303.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4304.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4305.Ar setname Oc Ns ... Oc
4306.Ar filesystem Ns | Ns Ar volume
0238a975 4307.Xc
4308.It Xo
44f09cdc
BB
4309.Nm
4310.Cm unallow
4311.Op Fl dlr
4312.Fl e Ns | Ns Sy everyone
4313.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4314.Ar setname Oc Ns ... Oc
4315.Ar filesystem Ns | Ns Ar volume
cb110f25
YP
4316.Xc
4317.It Xo
44f09cdc
BB
4318.Nm
4319.Cm unallow
4320.Op Fl r
4321.Fl c
4322.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4323.Ar setname Oc Ns ... Oc
4324.Ar filesystem Ns | Ns Ar volume
4325.Xc
4326Removes permissions that were granted with the
4327.Nm zfs Cm allow
4328command.
4329No permissions are explicitly denied, so other permissions granted are still in
4330effect.
4331For example, if the permission is granted by an ancestor.
4332If no permissions are specified, then all permissions for the specified
4333.Ar user ,
4334.Ar group ,
4335or
4336.Sy everyone
4337are removed.
4338Specifying
4339.Sy everyone
4340.Po or using the
4341.Fl e
4342option
4343.Pc
4344only removes the permissions that were granted to everyone, not all permissions
4345for every user and group.
4346See the
4347.Nm zfs Cm allow
4348command for a description of the
4349.Fl ldugec
4350options.
4351.Bl -tag -width "-r"
4352.It Fl r
058ac9ba 4353Recursively remove the permissions from this file system and all descendents.
44f09cdc
BB
4354.El
4355.It Xo
4356.Nm
4357.Cm unallow
4358.Op Fl r
4359.Fl s No @ Ns Ar setname
4360.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4361.Ar setname Oc Ns ... Oc
4362.Ar filesystem Ns | Ns Ar volume
4363.Xc
4364Removes permissions from a permission set.
4365If no permissions are specified, then all permissions are removed, thus removing
4366the set entirely.
4367.It Xo
4368.Nm
4369.Cm hold
4370.Op Fl r
4371.Ar tag Ar snapshot Ns ...
4372.Xc
4373Adds a single reference, named with the
4374.Ar tag
4375argument, to the specified snapshot or snapshots.
4376Each snapshot has its own tag namespace, and tags must be unique within that
4377space.
4378.Pp
4379If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4380.Nm zfs Cm destroy
4381command return
4382.Er EBUSY .
4383.Bl -tag -width "-r"
4384.It Fl r
4385Specifies that a hold with the given tag is applied recursively to the snapshots
4386of all descendent file systems.
4387.El
4388.It Xo
4389.Nm
4390.Cm holds
a9d6270a 4391.Op Fl rH
44f09cdc
BB
4392.Ar snapshot Ns ...
4393.Xc
058ac9ba 4394Lists all existing user references for the given snapshot or snapshots.
44f09cdc
BB
4395.Bl -tag -width "-r"
4396.It Fl r
4397Lists the holds that are set on the named descendent snapshots, in addition to
4398listing the holds on the named snapshot.
a9d6270a 4399.It Fl H
4400Do not print headers, use tab-delimited output.
44f09cdc
BB
4401.El
4402.It Xo
4403.Nm
4404.Cm release
4405.Op Fl r
4406.Ar tag Ar snapshot Ns ...
4407.Xc
4408Removes a single reference, named with the
4409.Ar tag
4410argument, from the specified snapshot or snapshots.
4411The tag must already exist for each snapshot.
4412If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4413.Nm zfs Cm destroy
4414command return
4415.Er EBUSY .
4416.Bl -tag -width "-r"
4417.It Fl r
4418Recursively releases a hold with the given tag on the snapshots of all
4419descendent file systems.
4420.El
4421.It Xo
4422.Nm
4423.Cm diff
4424.Op Fl FHt
4425.Ar snapshot Ar snapshot Ns | Ns Ar filesystem
4426.Xc
0677cb6f
RL
4427Display the difference between a snapshot of a given filesystem and another
4428snapshot of that filesystem from a later time or the current contents of the
44f09cdc
BB
4429filesystem.
4430The first column is a character indicating the type of change, the other columns
4431indicate pathname, new pathname
4432.Pq in case of rename ,
4433change in link count, and optionally file type and/or change time.
0677cb6f 4434The types of change are:
44f09cdc 4435.Bd -literal
0677cb6f
RL
4436- The path has been removed
4437+ The path has been created
4438M The path has been modified
4439R The path has been renamed
44f09cdc
BB
4440.Ed
4441.Bl -tag -width "-F"
4442.It Fl F
4443Display an indication of the type of file, in a manner similar to the
4444.Fl
4445option of
4446.Xr ls 1 .
4447.Bd -literal
0677cb6f
RL
4448B Block device
4449C Character device
4450/ Directory
4451> Door
4452| Named pipe
4453@ Symbolic link
4454P Event port
4455= Socket
4456F Regular file
44f09cdc
BB
4457.Ed
4458.It Fl H
4459Give more parsable tab-separated output, without header lines and without
4460arrows.
4461.It Fl t
0677cb6f 4462Display the path's inode change time as the first column of output.
44f09cdc 4463.El
b5256303
TC
4464.It Xo
4465.Nm
d99a0153 4466.Cm program
272b5d73 4467.Op Fl jn
c568ab8d
MA
4468.Op Fl t Ar instruction-limit
4469.Op Fl m Ar memory-limit
d99a0153
CW
4470.Ar pool script
4471.Op Ar arg1 No ...
4472.Xc
4473Executes
4474.Ar script
4475as a ZFS channel program on
4476.Ar pool .
4477The ZFS channel
4478program interface allows ZFS administrative operations to be run
4479programmatically via a Lua script.
4480The entire script is executed atomically, with no other administrative
4481operations taking effect concurrently.
4482A library of ZFS calls is made available to channel program scripts.
4483Channel programs may only be run with root privileges.
4484.sp
4485For full documentation of the ZFS channel program interface, see the manual
4486page for
4487.Xr zfs-program 8 .
4488.Bl -tag -width ""
272b5d73
AP
4489.It Fl j
4490Display channel program output in JSON format. When this flag is specified and
4491standard output is empty - channel program encountered an error. The details of
4492such an error will be printed to standard error in plain text.
5b72a38d
SD
4493.It Fl n
4494Executes a read-only channel program, which runs faster.
4495The program cannot change on-disk state by calling functions from
4496the zfs.sync submodule.
4497The program can be used to gather information such as properties and
4498determining if changes would succeed (zfs.check.*).
4499Without this flag, all pending changes must be synced to disk before
4500a channel program can complete.
c568ab8d
MA
4501.It Fl t Ar instruction-limit
4502Limit the number of Lua instructions to execute.
4503If a channel program executes more than the specified number of instructions,
4504it will be stopped and an error will be returned.
4505The default limit is 10 million instructions, and it can be set to a maximum of
4506100 million instructions.
d99a0153
CW
4507.It Fl m Ar memory-limit
4508Memory limit, in bytes.
4509If a channel program attempts to allocate more memory than the given limit,
4510it will be stopped and an error returned.
4511The default memory limit is 10 MB, and can be set to a maximum of 100 MB.
4512.sp
4513All remaining argument strings are passed directly to the channel program as
4514arguments.
4515See
4516.Xr zfs-program 8
4517for more information.
4518.El
4519.It Xo
4520.Nm
b5256303
TC
4521.Cm load-key
4522.Op Fl nr
4523.Op Fl L Ar keylocation
4524.Fl a | Ar filesystem
4525.Xc
4526Load the key for
4527.Ar filesystem ,
4528allowing it and all children that inherit the
4529.Sy keylocation
4530property to be accessed. The key will be expected in the format specified by the
4531.Sy keyformat
4532and location specified by the
4533.Sy keylocation
4534property. Note that if the
4535.Sy keylocation
4536is set to
4537.Sy prompt
4538the terminal will interactively wait for the key to be entered. Loading a key
4539will not automatically mount the dataset. If that functionality is desired,
4540.Nm zfs Cm mount Sy -l
4541will ask for the key and mount the dataset. Once the key is loaded the
4542.Sy keystatus
4543property will become
4544.Sy available .
4545.Bl -tag -width "-r"
4546.It Fl r
4547Recursively loads the keys for the specified filesystem and all descendent
4548encryption roots.
4549.It Fl a
4550Loads the keys for all encryption roots in all imported pools.
4551.It Fl n
4552Do a dry-run
4553.Pq Qq No-op
4554load-key. This will cause zfs to simply check that the
4555provided key is correct. This command may be run even if the key is already
4556loaded.
4557.It Fl L Ar keylocation
4558Use
4559.Ar keylocation
4560instead of the
4561.Sy keylocation
4562property. This will not change the value of the property on the dataset. Note
4563that if used with either
4564.Fl r
4565or
4566.Fl a ,
4567.Ar keylocation
4568may only be given as
4569.Sy prompt .
4570.El
4571.It Xo
4572.Nm
4573.Cm unload-key
4574.Op Fl r
4575.Fl a | Ar filesystem
4576.Xc
4577Unloads a key from ZFS, removing the ability to access the dataset and all of
4578its children that inherit the
4579.Sy keylocation
4580property. This requires that the dataset is not currently open or mounted. Once
4581the key is unloaded the
4582.Sy keystatus
4583property will become
4584.Sy unavailable .
4585.Bl -tag -width "-r"
4586.It Fl r
4587Recursively unloads the keys for the specified filesystem and all descendent
4588encryption roots.
4589.It Fl a
4590Unloads the keys for all encryption roots in all imported pools.
4591.El
4592.It Xo
4593.Nm
4594.Cm change-key
4595.Op Fl l
4596.Op Fl o Ar keylocation Ns = Ns Ar value
4597.Op Fl o Ar keyformat Ns = Ns Ar value
4598.Op Fl o Ar pbkdf2iters Ns = Ns Ar value
4599.Ar filesystem
4600.Xc
4601.It Xo
4602.Nm
4603.Cm change-key
4604.Fl i
4605.Op Fl l
4606.Ar filesystem
4607.Xc
4608Allows a user to change the encryption key used to access a dataset. This
4609command requires that the existing key for the dataset is already loaded into
4610ZFS. This command may also be used to change the
4611.Sy keylocation ,
4612.Sy keyformat ,
4613and
4614.Sy pbkdf2iters
4615properties as needed. If the dataset was not previously an encryption root it
4616will become one. Alternatively, the
4617.Fl i
4618flag may be provided to cause an encryption root to inherit the parent's key
4619instead.
4620.Bl -tag -width "-r"
4621.It Fl l
4622Ensures the key is loaded before attempting to change the key. This is
4623effectively equivalent to
4624.Qq Nm zfs Cm load-key Ar filesystem ; Nm zfs Cm change-key Ar filesystem
4625.It Fl o Ar property Ns = Ns Ar value
4626Allows the user to set encryption key properties (
4627.Sy keyformat ,
4628.Sy keylocation ,
4629and
4630.Sy pbkdf2iters
4631) while changing the key. This is the only way to alter
4632.Sy keyformat
4633and
4634.Sy pbkdf2iters
4635after the dataset has been created.
4636.It Fl i
4637Indicates that zfs should make
4638.Ar filesystem
4639inherit the key of its parent. Note that this command can only be run on an
4640encryption root that has an encrypted parent.
4641.El
50478c6d
T
4642.It Xo
4643.Nm
4644.Cm version
4645.Xc
4646Displays the software version of the
4647.Nm
4648userland utility and the zfs kernel module.
44f09cdc
BB
4649.El
4650.Sh EXIT STATUS
4651The
4652.Nm
4653utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
4654options were specified.
4655.Sh EXAMPLES
4656.Bl -tag -width ""
4657.It Sy Example 1 No Creating a ZFS File System Hierarchy
4658The following commands create a file system named
4659.Em pool/home
4660and a file system named
4661.Em pool/home/bob .
4662The mount point
4663.Pa /export/home
4664is set for the parent file system, and is automatically inherited by the child
4665file system.
4666.Bd -literal
4667# zfs create pool/home
4668# zfs set mountpoint=/export/home pool/home
4669# zfs create pool/home/bob
4670.Ed
4671.It Sy Example 2 No Creating a ZFS Snapshot
4672The following command creates a snapshot named
4673.Sy yesterday .
4674This snapshot is mounted on demand in the
4675.Pa .zfs/snapshot
4676directory at the root of the
4677.Em pool/home/bob
4678file system.
4679.Bd -literal
4680# zfs snapshot pool/home/bob@yesterday
4681.Ed
4682.It Sy Example 3 No Creating and Destroying Multiple Snapshots
4683The following command creates snapshots named
4684.Sy yesterday
4685of
4686.Em pool/home
4687and all of its descendent file systems.
4688Each snapshot is mounted on demand in the
4689.Pa .zfs/snapshot
4690directory at the root of its file system.
4691The second command destroys the newly created snapshots.
4692.Bd -literal
4693# zfs snapshot -r pool/home@yesterday
4694# zfs destroy -r pool/home@yesterday
4695.Ed
4696.It Sy Example 4 No Disabling and Enabling File System Compression
4697The following command disables the
4698.Sy compression
4699property for all file systems under
4700.Em pool/home .
4701The next command explicitly enables
4702.Sy compression
4703for
4704.Em pool/home/anne .
4705.Bd -literal
4706# zfs set compression=off pool/home
4707# zfs set compression=on pool/home/anne
4708.Ed
4709.It Sy Example 5 No Listing ZFS Datasets
4710The following command lists all active file systems and volumes in the system.
4711Snapshots are displayed if the
4712.Sy listsnaps
4713property is
4714.Sy on .
4715The default is
4716.Sy off .
4717See
4718.Xr zpool 8
4719for more information on pool properties.
4720.Bd -literal
4721# zfs list
4722NAME USED AVAIL REFER MOUNTPOINT
4723pool 450K 457G 18K /pool
4724pool/home 315K 457G 21K /export/home
4725pool/home/anne 18K 457G 18K /export/home/anne
4726pool/home/bob 276K 457G 276K /export/home/bob
4727.Ed
4728.It Sy Example 6 No Setting a Quota on a ZFS File System
4729The following command sets a quota of 50 Gbytes for
4730.Em pool/home/bob .
4731.Bd -literal
4732# zfs set quota=50G pool/home/bob
4733.Ed
4734.It Sy Example 7 No Listing ZFS Properties
4735The following command lists all properties for
4736.Em pool/home/bob .
4737.Bd -literal
4738# zfs get all pool/home/bob
058ac9ba
BB
4739NAME PROPERTY VALUE SOURCE
4740pool/home/bob type filesystem -
4741pool/home/bob creation Tue Jul 21 15:53 2009 -
4742pool/home/bob used 21K -
4743pool/home/bob available 20.0G -
4744pool/home/bob referenced 21K -
4745pool/home/bob compressratio 1.00x -
4746pool/home/bob mounted yes -
4747pool/home/bob quota 20G local
4748pool/home/bob reservation none default
4749pool/home/bob recordsize 128K default
4750pool/home/bob mountpoint /pool/home/bob default
4751pool/home/bob sharenfs off default
4752pool/home/bob checksum on default
4753pool/home/bob compression on local
4754pool/home/bob atime on default
4755pool/home/bob devices on default
4756pool/home/bob exec on default
4757pool/home/bob setuid on default
4758pool/home/bob readonly off default
4759pool/home/bob zoned off default
4760pool/home/bob snapdir hidden default
023699cd 4761pool/home/bob acltype off default
058ac9ba
BB
4762pool/home/bob aclinherit restricted default
4763pool/home/bob canmount on default
058ac9ba
BB
4764pool/home/bob xattr on default
4765pool/home/bob copies 1 default
4766pool/home/bob version 4 -
4767pool/home/bob utf8only off -
4768pool/home/bob normalization none -
4769pool/home/bob casesensitivity sensitive -
4770pool/home/bob vscan off default
4771pool/home/bob nbmand off default
4772pool/home/bob sharesmb off default
4773pool/home/bob refquota none default
4774pool/home/bob refreservation none default
4775pool/home/bob primarycache all default
4776pool/home/bob secondarycache all default
4777pool/home/bob usedbysnapshots 0 -
4778pool/home/bob usedbydataset 21K -
4779pool/home/bob usedbychildren 0 -
4780pool/home/bob usedbyrefreservation 0 -
44f09cdc
BB
4781.Ed
4782.Pp
058ac9ba 4783The following command gets a single property value.
44f09cdc
BB
4784.Bd -literal
4785# zfs get -H -o value compression pool/home/bob
058ac9ba 4786on
44f09cdc
BB
4787.Ed
4788The following command lists all properties with local settings for
4789.Em pool/home/bob .
4790.Bd -literal
4791# zfs get -r -s local -o name,property,value all pool/home/bob
058ac9ba
BB
4792NAME PROPERTY VALUE
4793pool/home/bob quota 20G
4794pool/home/bob compression on
44f09cdc
BB
4795.Ed
4796.It Sy Example 8 No Rolling Back a ZFS File System
4797The following command reverts the contents of
4798.Em pool/home/anne
4799to the snapshot named
4800.Sy yesterday ,
4801deleting all intermediate snapshots.
4802.Bd -literal
4803# zfs rollback -r pool/home/anne@yesterday
4804.Ed
4805.It Sy Example 9 No Creating a ZFS Clone
4806The following command creates a writable file system whose initial contents are
4807the same as
4808.Em pool/home/bob@yesterday .
4809.Bd -literal
4810# zfs clone pool/home/bob@yesterday pool/clone
4811.Ed
4812.It Sy Example 10 No Promoting a ZFS Clone
4813The following commands illustrate how to test out changes to a file system, and
4814then replace the original file system with the changed one, using clones, clone
4815promotion, and renaming:
4816.Bd -literal
4817# zfs create pool/project/production
058ac9ba 4818 populate /pool/project/production with data
44f09cdc
BB
4819# zfs snapshot pool/project/production@today
4820# zfs clone pool/project/production@today pool/project/beta
4821 make changes to /pool/project/beta and test them
4822# zfs promote pool/project/beta
4823# zfs rename pool/project/production pool/project/legacy
4824# zfs rename pool/project/beta pool/project/production
4825 once the legacy version is no longer needed, it can be destroyed
4826# zfs destroy pool/project/legacy
4827.Ed
4828.It Sy Example 11 No Inheriting ZFS Properties
4829The following command causes
4830.Em pool/home/bob
4831and
4832.Em pool/home/anne
4833to inherit the
4834.Sy checksum
4835property from their parent.
4836.Bd -literal
4837# zfs inherit checksum pool/home/bob pool/home/anne
4838.Ed
4839.It Sy Example 12 No Remotely Replicating ZFS Data
4840The following commands send a full stream and then an incremental stream to a
4841remote machine, restoring them into
4842.Em poolB/received/fs@a
4843and
4844.Em poolB/received/fs@b ,
4845respectively.
4846.Em poolB
4847must contain the file system
4848.Em poolB/received ,
4849and must not initially contain
4850.Em poolB/received/fs .
4851.Bd -literal
4852# zfs send pool/fs@a | \e
4853 ssh host zfs receive poolB/received/fs@a
4854# zfs send -i a pool/fs@b | \e
4855 ssh host zfs receive poolB/received/fs
4856.Ed
4857.It Sy Example 13 No Using the zfs receive -d Option
4858The following command sends a full stream of
4859.Em poolA/fsA/fsB@snap
4860to a remote machine, receiving it into
4861.Em poolB/received/fsA/fsB@snap .
4862The
4863.Em fsA/fsB@snap
4864portion of the received snapshot's name is determined from the name of the sent
4865snapshot.
4866.Em poolB
4867must contain the file system
4868.Em poolB/received .
4869If
4870.Em poolB/received/fsA
4871does not exist, it is created as an empty file system.
4872.Bd -literal
4873# zfs send poolA/fsA/fsB@snap | \e
4874 ssh host zfs receive -d poolB/received
4875.Ed
4876.It Sy Example 14 No Setting User Properties
4877The following example sets the user-defined
4878.Sy com.example:department
4879property for a dataset.
4880.Bd -literal
4881# zfs set com.example:department=12345 tank/accounting
4882.Ed
4883.It Sy Example 15 No Performing a Rolling Snapshot
4884The following example shows how to maintain a history of snapshots with a
4885consistent naming scheme.
4886To keep a week's worth of snapshots, the user destroys the oldest snapshot,
4887renames the remaining snapshots, and then creates a new snapshot, as follows:
4888.Bd -literal
4889# zfs destroy -r pool/users@7daysago
4890# zfs rename -r pool/users@6daysago @7daysago
4891# zfs rename -r pool/users@5daysago @6daysago
22448f08
BG
4892# zfs rename -r pool/users@4daysago @5daysago
4893# zfs rename -r pool/users@3daysago @4daysago
4894# zfs rename -r pool/users@2daysago @3daysago
44f09cdc
BB
4895# zfs rename -r pool/users@yesterday @2daysago
4896# zfs rename -r pool/users@today @yesterday
4897# zfs snapshot -r pool/users@today
4898.Ed
4899.It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
4900The following commands show how to set
4901.Sy sharenfs
4902property options to enable
4903.Sy rw
4904access for a set of
4905.Sy IP
4906addresses and to enable root access for system
4907.Sy neo
4908on the
4909.Em tank/home
4910file system.
4911.Bd -literal
4912# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
4913.Ed
4914.Pp
4915If you are using
4916.Sy DNS
4917for host name resolution, specify the fully qualified hostname.
4918.It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
4919The following example shows how to set permissions so that user
4920.Sy cindys
4921can create, destroy, mount, and take snapshots on
4922.Em tank/cindys .
4923The permissions on
4924.Em tank/cindys
4925are also displayed.
4926.Bd -literal
4927# zfs allow cindys create,destroy,mount,snapshot tank/cindys
4928# zfs allow tank/cindys
4929---- Permissions on tank/cindys --------------------------------------
4930Local+Descendent permissions:
4931 user cindys create,destroy,mount,snapshot
4932.Ed
4933.Pp
4934Because the
4935.Em tank/cindys
4936mount point permission is set to 755 by default, user
4937.Sy cindys
4938will be unable to mount file systems under
4939.Em tank/cindys .
4940Add an ACE similar to the following syntax to provide mount point access:
4941.Bd -literal
4942# chmod A+user:cindys:add_subdirectory:allow /tank/cindys
4943.Ed
4944.It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
4945The following example shows how to grant anyone in the group
4946.Sy staff
4947to create file systems in
4948.Em tank/users .
4949This syntax also allows staff members to destroy their own file systems, but not
4950destroy anyone else's file system.
4951The permissions on
4952.Em tank/users
4953are also displayed.
4954.Bd -literal
4955# zfs allow staff create,mount tank/users
4956# zfs allow -c destroy tank/users
4957# zfs allow tank/users
4958---- Permissions on tank/users ---------------------------------------
4959Permission sets:
4960 destroy
4961Local+Descendent permissions:
4962 group staff create,mount
4963.Ed
4964.It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
4965The following example shows how to define and grant a permission set on the
4966.Em tank/users
4967file system.
4968The permissions on
4969.Em tank/users
4970are also displayed.
4971.Bd -literal
4972# zfs allow -s @pset create,destroy,snapshot,mount tank/users
4973# zfs allow staff @pset tank/users
4974# zfs allow tank/users
4975---- Permissions on tank/users ---------------------------------------
4976Permission sets:
058ac9ba 4977 @pset create,destroy,mount,snapshot
44f09cdc
BB
4978Local+Descendent permissions:
4979 group staff @pset
4980.Ed
4981.It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
4982The following example shows to grant the ability to set quotas and reservations
4983on the
4984.Em users/home
4985file system.
4986The permissions on
4987.Em users/home
4988are also displayed.
4989.Bd -literal
4990# zfs allow cindys quota,reservation users/home
4991# zfs allow users/home
4992---- Permissions on users/home ---------------------------------------
4993Local+Descendent permissions:
058ac9ba 4994 user cindys quota,reservation
44f09cdc
BB
4995cindys% zfs set quota=10G users/home/marks
4996cindys% zfs get quota users/home/marks
4997NAME PROPERTY VALUE SOURCE
4998users/home/marks quota 10G local
4999.Ed
5000.It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
5001The following example shows how to remove the snapshot permission from the
5002.Sy staff
5003group on the
5004.Em tank/users
5005file system.
5006The permissions on
5007.Em tank/users
5008are also displayed.
5009.Bd -literal
5010# zfs unallow staff snapshot tank/users
5011# zfs allow tank/users
5012---- Permissions on tank/users ---------------------------------------
5013Permission sets:
058ac9ba 5014 @pset create,destroy,mount,snapshot
44f09cdc
BB
5015Local+Descendent permissions:
5016 group staff @pset
5017.Ed
5018.It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
0677cb6f 5019The following example shows how to see what has changed between a prior
44f09cdc
BB
5020snapshot of a ZFS dataset and its current state.
5021The
5022.Fl F
5023option is used to indicate type information for the files affected.
5024.Bd -literal
0677cb6f
RL
5025# zfs diff -F tank/test@before tank/test
5026M / /tank/test/
5027M F /tank/test/linked (+1)
5028R F /tank/test/oldname -> /tank/test/newname
5029- F /tank/test/deleted
5030+ F /tank/test/created
5031M F /tank/test/modified
44f09cdc
BB
5032.Ed
5033.It Sy Example 23 No Creating a bookmark
5034The following example create a bookmark to a snapshot. This bookmark
5035can then be used instead of snapshot in send streams.
5036.Bd -literal
a215ee16 5037# zfs bookmark rpool@snapshot rpool#bookmark
44f09cdc
BB
5038.Ed
5039.It Sy Example 24 No Setting sharesmb Property Options on a ZFS File System
5040The following example show how to share SMB filesystem through ZFS. Note that
5041that a user and his/her password must be given.
5042.Bd -literal
5043# smbmount //127.0.0.1/share_tmp /mnt/tmp \\
5044 -o user=workgroup/turbo,password=obrut,uid=1000
5045.Ed
5046.Pp
5047Minimal
5048.Em /etc/samba/smb.conf
5049configuration required:
5050.Pp
5051Samba will need to listen to 'localhost' (127.0.0.1) for the ZFS utilities to
5052communicate with Samba. This is the default behavior for most Linux
5053distributions.
5054.Pp
5055Samba must be able to authenticate a user. This can be done in a number of
5056ways, depending on if using the system password file, LDAP or the Samba
5057specific smbpasswd file. How to do this is outside the scope of this manual.
5058Please refer to the
5059.Xr smb.conf 5
5060man page for more information.
5061.Pp
5062See the
5063.Sy USERSHARE section
5064of the
5065.Xr smb.conf 5
5066man page for all configuration options in case you need to modify any options
5067to the share afterwards. Do note that any changes done with the
5068.Xr net 8
5069command will be undone if the share is ever unshared (such as at a reboot etc).
5070.El
5071.Sh INTERFACE STABILITY
5072.Sy Committed .
5073.Sh SEE ALSO
90cdf283 5074.Xr attr 1 ,
44f09cdc
BB
5075.Xr gzip 1 ,
5076.Xr ssh 1 ,
44f09cdc 5077.Xr chmod 2 ,
90cdf283 5078.Xr fsync 2 ,
44f09cdc
BB
5079.Xr stat 2 ,
5080.Xr write 2 ,
44f09cdc 5081.Xr acl 5 ,
90cdf283 5082.Xr attributes 5 ,
44f09cdc
BB
5083.Xr exports 5 ,
5084.Xr exportfs 8 ,
90cdf283 5085.Xr mount 8 ,
44f09cdc 5086.Xr net 8 ,
90cdf283 5087.Xr selinux 8 ,
5088.Xr zpool 8