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