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