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