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