]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zfs.8
Relax ASSERT for #6526
[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
2182inherit their encryption key from the encryption root, meaning that loading,
2183unloading, or changing the key for the encryption root will implicitly do the
2184same for all inheriting datasets. If this inheritence is not desired, simply
2185supply a new
2186.Sy encryption
2187and
2188.Sy keyformat
2189when creating the child dataset or use
2190.Nm zfs Cm change-key
2191to break the relationship. The one exception is that clones will always use
2192their origin's encryption key. Encryption root inheritence can be tracked via
2193the read-only
2194.Sy encryptionroot
2195property.
2196.Pp
2197Encryption changes the behavior of a few
2198.Nm
2199operations. Encryption is applied after compression so compression ratios are
2200preserved. Normally checksums in ZFS are 256 bits long, but for encrypted data
2201the checksum is 128 bits of the user-chosen checksum and 128 bits of MAC from
2202the encryption suite, which provides additional protection against maliciously
2203altered data. Deduplication is still possible with encryption enabled but for
2204security, datasets will only dedup against themselves, their snapshots, and
2205their clones.
2206.Pp
2207There are a few limitations on encrypted datasets. Encrypted data cannot be
2208embedded via the
2209.Sy embedded_data
2210feature. Encrypted datasets may not have
2211.Sy copies Ns = Ns Em 3
2212since the implementation stores some encryption metadata where the third copy
2213would normally be. Since compression is applied before encryption datasets may
2214be vulnerable to a CRIME-like attack if applications accessing the data allow
2215for it. Deduplication with encryption will leak information about which blocks
2216are equivalent in a dataset and will incur an extra CPU cost per block written.
44f09cdc
BB
2217.Sh SUBCOMMANDS
2218All subcommands that modify state are logged persistently to the pool in their
2219original form.
2220.Bl -tag -width ""
2221.It Nm Fl ?
058ac9ba 2222Displays a help message.
44f09cdc
BB
2223.It Xo
2224.Nm
2225.Cm create
2226.Op Fl p
2227.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2228.Ar filesystem
2229.Xc
2230Creates a new ZFS file system.
2231The file system is automatically mounted according to the
2232.Sy mountpoint
2233property inherited from the parent.
2234.Bl -tag -width "-o"
2235.It Fl o Ar property Ns = Ns Ar value
2236Sets the specified property as if the command
2237.Nm zfs Cm set Ar property Ns = Ns Ar value
2238was invoked at the same time the dataset was created.
2239Any editable ZFS property can also be set at creation time.
2240Multiple
2241.Fl o
2242options can be specified.
2243An error results if the same property is specified in multiple
2244.Fl o
2245options.
2246.It Fl p
2247Creates all the non-existing parent datasets.
2248Datasets created in this manner are automatically mounted according to the
2249.Sy mountpoint
2250property inherited from their parent.
2251Any property specified on the command line using the
2252.Fl o
2253option is ignored.
2254If the target filesystem already exists, the operation completes successfully.
2255.El
2256.It Xo
2257.Nm
2258.Cm create
2259.Op Fl ps
2260.Op Fl b Ar blocksize
2261.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2262.Fl V Ar size Ar volume
2263.Xc
2264Creates a volume of the given size.
2265The volume is exported as a block device in
2266.Pa /dev/zvol/path ,
2267where
2268.Em path
2269is the name of the volume in the ZFS namespace.
2270The size represents the logical size as exported by the device.
2271By default, a reservation of equal size is created.
2272.Pp
2273.Ar size
2274is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
2275has an integral number of blocks regardless of
2276.Sy blocksize .
2277.Bl -tag -width "-b"
2278.It Fl b Ar blocksize
2279Equivalent to
2280.Fl o Sy volblocksize Ns = Ns Ar blocksize .
2281If this option is specified in conjunction with
2282.Fl o Sy volblocksize ,
2283the resulting behavior is undefined.
2284.It Fl o Ar property Ns = Ns Ar value
2285Sets the specified property as if the
2286.Nm zfs Cm set Ar property Ns = Ns Ar value
2287command was invoked at the same time the dataset was created.
2288Any editable ZFS property can also be set at creation time.
2289Multiple
2290.Fl o
2291options can be specified.
2292An error results if the same property is specified in multiple
2293.Fl o
2294options.
2295.It Fl p
2296Creates all the non-existing parent datasets.
2297Datasets created in this manner are automatically mounted according to the
2298.Sy mountpoint
2299property inherited from their parent.
2300Any property specified on the command line using the
2301.Fl o
2302option is ignored.
2303If the target filesystem already exists, the operation completes successfully.
2304.It Fl s
2305Creates a sparse volume with no reservation.
2306See
2307.Sy volsize
2308in the
2309.Sx Native Properties
2310section for more information about sparse volumes.
2311.El
2312.It Xo
2313.Nm
2314.Cm destroy
2315.Op Fl Rfnprv
2316.Ar filesystem Ns | Ns Ar volume
2317.Xc
2318Destroys the given dataset.
2319By default, the command unshares any file systems that are currently shared,
2320unmounts any file systems that are currently mounted, and refuses to destroy a
2321dataset that has active dependents
2322.Pq children or clones .
2323.Bl -tag -width "-R"
2324.It Fl R
2325Recursively destroy all dependents, including cloned file systems outside the
2326target hierarchy.
2327.It Fl f
2328Force an unmount of any file systems using the
2329.Nm unmount Fl f
2330command.
2331This option has no effect on non-file systems or unmounted file systems.
2332.It Fl n
2333Do a dry-run
2334.Pq Qq No-op
2335deletion.
2336No data will be deleted.
2337This is useful in conjunction with the
2338.Fl v
2339or
2340.Fl p
2341flags to determine what data would be deleted.
2342.It Fl p
330d06f9 2343Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2344.It Fl r
2345Recursively destroy all children.
2346.It Fl v
330d06f9 2347Print verbose information about the deleted data.
44f09cdc
BB
2348.El
2349.Pp
2350Extreme care should be taken when applying either the
2351.Fl r
2352or the
2353.Fl R
2354options, as they can destroy large portions of a pool and cause unexpected
2355behavior for mounted file systems in use.
2356.It Xo
2357.Nm
2358.Cm destroy
2359.Op Fl Rdnprv
2360.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
2361.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
2362.Xc
2363The given snapshots are destroyed immediately if and only if the
2364.Nm zfs Cm destroy
2365command without the
2366.Fl d
2367option would have destroyed it.
2368Such immediate destruction would occur, for example, if the snapshot had no
2369clones and the user-initiated reference count were zero.
2370.Pp
2371If a snapshot does not qualify for immediate destruction, it is marked for
2372deferred deletion.
2373In this state, it exists as a usable, visible snapshot until both of the
2374preconditions listed above are met, at which point it is destroyed.
2375.Pp
2376An inclusive range of snapshots may be specified by separating the first and
2377last snapshots with a percent sign.
330d06f9
MA
2378The first and/or last snapshots may be left blank, in which case the
2379filesystem's oldest or newest snapshot will be implied.
44f09cdc 2380.Pp
330d06f9 2381Multiple snapshots
44f09cdc
BB
2382.Pq or ranges of snapshots
2383of the same filesystem or volume may be specified in a comma-separated list of
2384snapshots.
2385Only the snapshot's short name
2386.Po the part after the
2387.Sy @
2388.Pc
2389should be specified when using a range or comma-separated list to identify
2390multiple snapshots.
2391.Bl -tag -width "-R"
2392.It Fl R
13fe0198 2393Recursively destroy all clones of these snapshots, including the clones,
44f09cdc
BB
2394snapshots, and children.
2395If this flag is specified, the
2396.Fl d
2397flag will have no effect.
2398.It Fl d
2399Defer snapshot deletion.
2400.It Fl n
2401Do a dry-run
2402.Pq Qq No-op
2403deletion.
2404No data will be deleted.
2405This is useful in conjunction with the
2406.Fl p
2407or
2408.Fl v
2409flags to determine what data would be deleted.
2410.It Fl p
330d06f9 2411Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2412.It Fl r
2413Destroy
2414.Pq or mark for deferred deletion
2415all snapshots with this name in descendent file systems.
2416.It Fl v
330d06f9 2417Print verbose information about the deleted data.
44f09cdc
BB
2418.Pp
2419Extreme care should be taken when applying either the
2420.Fl r
2421or the
2422.Fl R
330d06f9
MA
2423options, as they can destroy large portions of a pool and cause unexpected
2424behavior for mounted file systems in use.
44f09cdc
BB
2425.El
2426.It Xo
2427.Nm
2428.Cm destroy
2429.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2430.Xc
da536844 2431The given bookmark is destroyed.
44f09cdc
BB
2432.It Xo
2433.Nm
2434.Cm snapshot
2435.Op Fl r
2436.Oo Fl o Ar property Ns = Ns value Oc Ns ...
2437.Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2438.Xc
2439Creates snapshots with the given names.
2440All previous modifications by successful system calls to the file system are
2441part of the snapshots.
2442Snapshots are taken atomically, so that all snapshots correspond to the same
2443moment in time.
2444See the
2445.Sx Snapshots
2446section for details.
2447.Bl -tag -width "-o"
2448.It Fl o Ar property Ns = Ns Ar value
2449Sets the specified property; see
2450.Nm zfs Cm create
2451for details.
2452.It Fl r
2453Recursively create snapshots of all descendent datasets
2454.El
2455.It Xo
2456.Nm
2457.Cm rollback
2458.Op Fl Rfr
2459.Ar snapshot
2460.Xc
2461Roll back the given dataset to a previous snapshot.
2462When a dataset is rolled back, all data that has changed since the snapshot is
2463discarded, and the dataset reverts to the state at the time of the snapshot.
2464By default, the command refuses to roll back to a snapshot other than the most
2465recent one.
2466In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2467specifying the
2468.Fl r
2469option.
2470.Pp
2471The
2472.Fl rR
2473options do not recursively destroy the child snapshots of a recursive snapshot.
2474Only direct snapshots of the specified filesystem are destroyed by either of
2475these options.
2476To completely roll back a recursive snapshot, you must rollback the individual
2477child snapshots.
2478.Bl -tag -width "-R"
2479.It Fl R
2480Destroy any more recent snapshots and bookmarks, as well as any clones of those
2481snapshots.
2482.It Fl f
2483Used with the
2484.Fl R
2485option to force an unmount of any clone file systems that are to be destroyed.
2486.It Fl r
da536844 2487Destroy any snapshots and bookmarks more recent than the one specified.
44f09cdc
BB
2488.El
2489.It Xo
2490.Nm
2491.Cm clone
2492.Op Fl p
2493.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2494.Ar snapshot Ar filesystem Ns | Ns Ar volume
2495.Xc
2496Creates a clone of the given snapshot.
2497See the
2498.Sx Clones
2499section for details.
2500The target dataset can be located anywhere in the ZFS hierarchy, and is created
2501as the same type as the original.
2502.Bl -tag -width "-o"
2503.It Fl o Ar property Ns = Ns Ar value
2504Sets the specified property; see
2505.Nm zfs Cm create
2506for details.
2507.It Fl p
2508Creates all the non-existing parent datasets.
2509Datasets created in this manner are automatically mounted according to the
2510.Sy mountpoint
2511property inherited from their parent.
2512If the target filesystem or volume already exists, the operation completes
2513successfully.
2514.El
2515.It Xo
2516.Nm
2517.Cm promote
2518.Ar clone-filesystem
2519.Xc
2520Promotes a clone file system to no longer be dependent on its
2521.Qq origin
2522snapshot.
2523This makes it possible to destroy the file system that the clone was created
2524from.
2525The clone parent-child dependency relationship is reversed, so that the origin
2526file system becomes a clone of the specified file system.
2527.Pp
2528The snapshot that was cloned, and any snapshots previous to this snapshot, are
2529now owned by the promoted clone.
2530The space they use moves from the origin file system to the promoted clone, so
2531enough space must be available to accommodate these snapshots.
2532No new space is consumed by this operation, but the space accounting is
2533adjusted.
2534The promoted clone must not have any conflicting snapshot names of its own.
2535The
2536.Cm rename
2537subcommand can be used to rename any conflicting snapshots.
2538.It Xo
2539.Nm
2540.Cm rename
2541.Op Fl f
2542.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2543.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2544.Xc
2545.It Xo
2546.Nm
2547.Cm rename
2548.Op Fl fp
2549.Ar filesystem Ns | Ns Ar volume
2550.Ar filesystem Ns | Ns Ar volume
2551.Xc
2552Renames the given dataset.
2553The new target can be located anywhere in the ZFS hierarchy, with the exception
2554of snapshots.
2555Snapshots can only be renamed within the parent file system or volume.
2556When renaming a snapshot, the parent file system of the snapshot does not need
2557to be specified as part of the second argument.
2558Renamed file systems can inherit new mount points, in which case they are
2559unmounted and remounted at the new mount point.
2560.Bl -tag -width "-a"
2561.It Fl f
db49968e 2562Force unmount any filesystems that need to be unmounted in the process.
44f09cdc
BB
2563.It Fl p
2564Creates all the nonexistent parent datasets.
2565Datasets created in this manner are automatically mounted according to the
2566.Sy mountpoint
2567property inherited from their parent.
2568.El
2569.It Xo
2570.Nm
2571.Cm rename
2572.Fl r
2573.Ar snapshot Ar snapshot
2574.Xc
2575Recursively rename the snapshots of all descendent datasets.
2576Snapshots are the only dataset that can be renamed recursively.
2577.It Xo
2578.Nm
2579.Cm list
2580.Op Fl r Ns | Ns Fl d Ar depth
2581.Op Fl Hp
2582.Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2583.Oo Fl s Ar property Oc Ns ...
2584.Oo Fl S Ar property Oc Ns ...
2585.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2586.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2587.Xc
2588Lists the property information for the given datasets in tabular form.
2589If specified, you can list property information by the absolute pathname or the
2590relative pathname.
2591By default, all file systems and volumes are displayed.
2592Snapshots are displayed if the
2593.Sy listsnaps
2594property is
2595.Sy on
2596.Po the default is
2597.Sy off
2598.Pc .
2599The following fields are displayed,
d7323e79 2600.Sy name Ns \&, Ns Sy used Ns \&, Ns Sy available Ns \&, Ns Sy referenced Ns \&, Ns
44f09cdc
BB
2601.Sy mountpoint .
2602.Bl -tag -width "-H"
2603.It Fl H
2604Used for scripting mode.
2605Do not print headers and separate fields by a single tab instead of arbitrary
2606white space.
2607.It Fl S Ar property
2608Same as the
2609.Fl s
2610option, but sorts by property in descending order.
2611.It Fl d Ar depth
2612Recursively display any children of the dataset, limiting the recursion to
2613.Ar depth .
2614A
2615.Ar depth
2616of
2617.Sy 1
2618will display only the dataset and its direct children.
2619.It Fl o Ar property
2620A comma-separated list of properties to display.
2621The property must be:
2622.Bl -bullet
2623.It
2624One of the properties described in the
2625.Sx Native Properties
2626section
2627.It
058ac9ba 2628A user property
44f09cdc
BB
2629.It
2630The value
2631.Sy name
2632to display the dataset name
2633.It
2634The value
2635.Sy space
2636to display space usage properties on file systems and volumes.
2637This is a shortcut for specifying
d7323e79
GDN
2638.Fl o Sy name Ns \&, Ns Sy avail Ns \&, Ns Sy used Ns \&, Ns Sy usedsnap Ns \&, Ns
2639.Sy usedds Ns \&, Ns Sy usedrefreserv Ns \&, Ns Sy usedchild Fl t
2640.Sy filesystem Ns \&, Ns Sy volume
44f09cdc
BB
2641syntax.
2642.El
2643.It Fl p
2644Display numbers in parsable
2645.Pq exact
2646values.
2647.It Fl r
2648Recursively display any children of the dataset on the command line.
2649.It Fl s Ar property
2650A property for sorting the output by column in ascending order based on the
2651value of the property.
2652The property must be one of the properties described in the
2653.Sx Properties
2654section, or the special value
2655.Sy name
2656to sort by the dataset name.
2657Multiple properties can be specified at one time using multiple
2658.Fl s
2659property options.
2660Multiple
2661.Fl s
2662options are evaluated from left to right in decreasing order of importance.
058ac9ba 2663The following is a list of sorting criteria:
44f09cdc
BB
2664.Bl -bullet
2665.It
058ac9ba 2666Numeric types sort in numeric order.
44f09cdc 2667.It
058ac9ba 2668String types sort in alphabetical order.
44f09cdc
BB
2669.It
2670Types inappropriate for a row sort that row to the literal bottom, regardless of
2671the specified ordering.
2672.El
2673.Pp
2674If no sorting options are specified the existing behavior of
2675.Nm zfs Cm list
2676is preserved.
2677.It Fl t Ar type
2678A comma-separated list of types to display, where
2679.Ar type
2680is one of
2681.Sy filesystem ,
2682.Sy snapshot ,
2683.Sy volume ,
2684.Sy bookmark ,
2685or
2686.Sy all .
2687For example, specifying
2688.Fl t Sy snapshot
2689displays only snapshots.
2690.El
2691.It Xo
2692.Nm
2693.Cm set
2694.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2695.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2696.Xc
23de906c 2697Sets the property or list of properties to the given value(s) for each dataset.
44f09cdc
BB
2698Only some properties can be edited.
2699See the
2700.Sx Properties
2701section for more information on what properties can be set and acceptable
2702values.
2703Numeric values can be specified as exact values, or in a human-readable form
2704with a suffix of
2705.Sy B , K , M , G , T , P , E , Z
2706.Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2707or zettabytes, respectively
2708.Pc .
2709User properties can be set on snapshots.
2710For more information, see the
2711.Sx User Properties
2712section.
2713.It Xo
2714.Nm
2715.Cm get
2716.Op Fl r Ns | Ns Fl d Ar depth
2717.Op Fl Hp
2718.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2719.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2720.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2721.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
2722.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
2723.Xc
2724Displays properties for the given datasets.
2725If no datasets are specified, then the command displays properties for all
2726datasets on the system.
2727For each property, the following columns are displayed:
2728.Bd -literal
058ac9ba 2729 name Dataset name
44f09cdc
BB
2730 property Property name
2731 value Property value
2732 source Property source. Can either be local, default,
2733 temporary, inherited, or none (-).
2734.Ed
2735.Pp
2736All columns are displayed by default, though this can be controlled by using the
2737.Fl o
2738option.
2739This command takes a comma-separated list of properties as described in the
2740.Sx Native Properties
2741and
2742.Sx User Properties
2743sections.
2744.Pp
2745The special value
2746.Sy all
2747can be used to display all properties that apply to the given dataset's type
2748.Pq filesystem, volume, snapshot, or bookmark .
2749.Bl -tag -width "-H"
2750.It Fl H
2751Display output in a form more easily parsed by scripts.
2752Any headers are omitted, and fields are explicitly separated by a single tab
2753instead of an arbitrary amount of space.
2754.It Fl d Ar depth
2755Recursively display any children of the dataset, limiting the recursion to
2756.Ar depth .
2757A depth of
2758.Sy 1
2759will display only the dataset and its direct children.
2760.It Fl o Ar field
2761A comma-separated list of columns to display.
d7323e79 2762.Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
44f09cdc
BB
2763is the default value.
2764.It Fl p
2765Display numbers in parsable
2766.Pq exact
2767values.
2768.It Fl r
058ac9ba 2769Recursively display properties for any children.
44f09cdc
BB
2770.It Fl s Ar source
2771A comma-separated list of sources to display.
2772Those properties coming from a source other than those in this list are ignored.
2773Each source must be one of the following:
2774.Sy local ,
2775.Sy default ,
2776.Sy inherited ,
2777.Sy temporary ,
2778and
2779.Sy none .
2780The default value is all sources.
2781.It Fl t Ar type
2782A comma-separated list of types to display, where
2783.Ar type
2784is one of
2785.Sy filesystem ,
2786.Sy snapshot ,
2787.Sy volume ,
2788.Sy bookmark ,
2789or
2790.Sy all .
2791.El
2792.It Xo
2793.Nm
2794.Cm inherit
2795.Op Fl rS
2796.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2797.Xc
2798Clears the specified property, causing it to be inherited from an ancestor,
2799restored to default if no ancestor has the property set, or with the
2800.Fl S
2801option reverted to the received value if one exists.
2802See the
2803.Sx Properties
2804section for a listing of default values, and details on which properties can be
2805inherited.
2806.Bl -tag -width "-r"
2807.It Fl r
058ac9ba 2808Recursively inherit the given property for all children.
44f09cdc 2809.It Fl S
0bf8501a 2810Revert the property to the received value if one exists; otherwise operate as
44f09cdc
BB
2811if the
2812.Fl S
2813option was not specified.
2814.El
2815.It Xo
2816.Nm
2817.Cm upgrade
2818.Xc
058ac9ba 2819Displays a list of file systems that are not the most recent version.
44f09cdc
BB
2820.It Xo
2821.Nm
2822.Cm upgrade
2823.Fl v
2824.Xc
2825Displays a list of currently supported file system versions.
2826.It Xo
2827.Nm
2828.Cm upgrade
2829.Op Fl r
2830.Op Fl V Ar version
2831.Fl a | Ar filesystem
2832.Xc
2833Upgrades file systems to a new on-disk version.
2834Once this is done, the file systems will no longer be accessible on systems
2835running older versions of the software.
2836.Nm zfs Cm send
2837streams generated from new snapshots of these file systems cannot be accessed on
2838systems running older versions of the software.
2839.Pp
2840In general, the file system version is independent of the pool version.
2841See
2842.Xr zpool 8
2843for information on the
2844.Nm zpool Cm upgrade
2845command.
2846.Pp
2847In some cases, the file system version and the pool version are interrelated and
2848the pool version must be upgraded before the file system version can be
2849upgraded.
2850.Bl -tag -width "-V"
2851.It Fl V Ar version
2852Upgrade to the specified
2853.Ar version .
2854If the
2855.Fl V
2856flag is not specified, this command upgrades to the most recent version.
2857This
2858option can only be used to increase the version number, and only up to the most
2859recent version supported by this software.
2860.It Fl a
2861Upgrade all file systems on all imported pools.
2862.It Ar filesystem
2863Upgrade the specified file system.
2864.It Fl r
2865Upgrade the specified file system and all descendent file systems.
2866.El
2867.It Xo
2868.Nm
2869.Cm userspace
2870.Op Fl Hinp
2871.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2872.Oo Fl s Ar field Oc Ns ...
2873.Oo Fl S Ar field Oc Ns ...
2874.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2875.Ar filesystem Ns | Ns Ar snapshot
2876.Xc
2877Displays space consumed by, and quotas on, each user in the specified filesystem
2878or snapshot.
2879This corresponds to the
2880.Sy userused@ Ns Em user ,
2881.Sy userobjused@ Ns Em user ,
2882.Sy userquota@ Ns Em user,
2883and
2884.Sy userobjquota@ Ns Em user
2885properties.
2886.Bl -tag -width "-H"
2887.It Fl H
2888Do not print headers, use tab-delimited output.
2889.It Fl S Ar field
2890Sort by this field in reverse order.
2891See
2892.Fl s .
2893.It Fl i
2894Translate SID to POSIX ID.
2895The POSIX ID may be ephemeral if no mapping exists.
2896Normal POSIX interfaces
2897.Po for example,
2898.Xr stat 2 ,
2899.Nm ls Fl l
2900.Pc
2901perform this translation, so the
2902.Fl i
2903option allows the output from
2904.Nm zfs Cm userspace
2905to be compared directly with those utilities.
2906However,
2907.Fl i
5990da81 2908may lead to confusion if some files were created by an SMB user before a
44f09cdc
BB
2909SMB-to-POSIX name mapping was established.
2910In such a case, some files will be owned by the SMB entity and some by the POSIX
2911entity.
2912However, the
2913.Fl i
2914option will report that the POSIX entity has the total usage and quota for both.
2915.It Fl n
2916Print numeric ID instead of user/group name.
2917.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
2918Display only the specified fields from the following set:
2919.Sy type ,
2920.Sy name ,
2921.Sy used ,
2922.Sy quota .
2923The default is to display all fields.
2924.It Fl p
2925Use exact
2926.Pq parsable
2927numeric output.
2928.It Fl s Ar field
2929Sort output by this field.
2930The
2931.Fl s
2932and
2933.Fl S
2934flags may be specified multiple times to sort first by one field, then by
2935another.
2936The default is
2937.Fl s Sy type Fl s Sy name .
2938.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
2939Print only the specified types from the following set:
2940.Sy all ,
2941.Sy posixuser ,
2942.Sy smbuser ,
2943.Sy posixgroup ,
2944.Sy smbgroup .
2945The default is
d7323e79 2946.Fl t Sy posixuser Ns \&, Ns Sy smbuser .
44f09cdc
BB
2947The default can be changed to include group types.
2948.El
2949.It Xo
2950.Nm
2951.Cm groupspace
2952.Op Fl Hinp
2953.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2954.Oo Fl s Ar field Oc Ns ...
2955.Oo Fl S Ar field Oc Ns ...
2956.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2957.Ar filesystem Ns | Ns Ar snapshot
2958.Xc
5990da81 2959Displays space consumed by, and quotas on, each group in the specified
44f09cdc
BB
2960filesystem or snapshot.
2961This subcommand is identical to
2962.Nm zfs Cm userspace ,
2963except that the default types to display are
d7323e79 2964.Fl t Sy posixgroup Ns \&, Ns Sy smbgroup .
44f09cdc
BB
2965.It Xo
2966.Nm
2967.Cm mount
2968.Xc
2969Displays all ZFS file systems currently mounted.
2970.It Xo
2971.Nm
2972.Cm mount
b5256303 2973.Op Fl Olv
44f09cdc
BB
2974.Op Fl o Ar options
2975.Fl a | Ar filesystem
2976.Xc
2977Mounts ZFS file systems.
2978.Bl -tag -width "-O"
2979.It Fl O
2980Perform an overlay mount.
2981See
2982.Xr mount 8
2983for more information.
2984.It Fl a
2985Mount all available ZFS file systems.
2986Invoked automatically as part of the boot process.
2987.It Ar filesystem
058ac9ba 2988Mount the specified filesystem.
44f09cdc
BB
2989.It Fl o Ar options
2990An optional, comma-separated list of mount options to use temporarily for the
2991duration of the mount.
2992See the
2993.Sx Temporary Mount Point Properties
2994section for details.
b5256303
TC
2995.It Fl l
2996Load keys for encrypted filesystems as they are being mounted. This is
2997equivalent to executing
2998.Nm zfs Cm load-key
2999on each encryption root before mounting it. Note that if a filesystem has a
3000.Sy keylocation
3001of
3002.Sy prompt
3003this will cause the terminal to interactively block after asking for the key.
44f09cdc
BB
3004.It Fl v
3005Report mount progress.
3006.El
3007.It Xo
3008.Nm
3009.Cm unmount
3010.Op Fl f
3011.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3012.Xc
3013Unmounts currently mounted ZFS file systems.
3014.Bl -tag -width "-a"
3015.It Fl a
3016Unmount all available ZFS file systems.
3017Invoked automatically as part of the shutdown process.
3018.It Ar filesystem Ns | Ns Ar mountpoint
3019Unmount the specified filesystem.
3020The command can also be given a path to a ZFS file system mount point on the
3021system.
3022.It Fl f
058ac9ba 3023Forcefully unmount the file system, even if it is currently in use.
44f09cdc
BB
3024.El
3025.It Xo
3026.Nm
3027.Cm share
3028.Fl a | Ar filesystem
3029.Xc
3030Shares available ZFS file systems.
3031.Bl -tag -width "-a"
3032.It Fl a
3033Share all available ZFS file systems.
3034Invoked automatically as part of the boot process.
3035.It Ar filesystem
3036Share the specified filesystem according to the
3037.Sy sharenfs
3038and
3039.Sy sharesmb
3040properties.
3041File systems are shared when the
3042.Sy sharenfs
3043or
3044.Sy sharesmb
3045property is set.
3046.El
3047.It Xo
3048.Nm
3049.Cm unshare
3050.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3051.Xc
3052Unshares currently shared ZFS file systems.
3053.Bl -tag -width "-a"
3054.It Fl a
3055Unshare all available ZFS file systems.
3056Invoked automatically as part of the shutdown process.
3057.It Ar filesystem Ns | Ns Ar mountpoint
3058Unshare the specified filesystem.
3059The command can also be given a path to a ZFS file system shared on the system.
3060.El
3061.It Xo
3062.Nm
3063.Cm bookmark
3064.Ar snapshot bookmark
3065.Xc
3066Creates a bookmark of the given snapshot.
3067Bookmarks mark the point in time when the snapshot was created, and can be used
3068as the incremental source for a
3069.Nm zfs Cm send
3070command.
3071.Pp
da536844 3072This feature must be enabled to be used.
44f09cdc
BB
3073See
3074.Xr zpool-features 5
3075for details on ZFS feature flags and the
3076.Sy bookmarks
3077feature.
3078.It Xo
3079.Nm
3080.Cm send
b5256303 3081.Op Fl DLPRcenpvw
44f09cdc
BB
3082.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
3083.Ar snapshot
3084.Xc
3085Creates a stream representation of the second
3086.Ar snapshot ,
3087which is written to standard output.
3088The output can be redirected to a file or to a different system
3089.Po for example, using
3090.Xr ssh 1
3091.Pc .
3092By default, a full stream is generated.
3093.Bl -tag -width "-D"
3094.It Fl D, -dedup
3095Generate a deduplicated stream.
3096Blocks which would have been sent multiple times in the send stream will only be
3097sent once.
3098The receiving system must also support this feature to receive a deduplicated
3099stream.
3100This flag can be used regardless of the dataset's
3101.Sy dedup
3102property, but performance will be much better if the filesystem uses a
3103dedup-capable checksum
3104.Po for example,
3105.Sy sha256
3106.Pc .
3107.It Fl I Ar snapshot
3108Generate a stream package that sends all intermediary snapshots from the first
3109snapshot to the second snapshot.
3110For example,
3111.Fl I Em @a Em fs@d
3112is similar to
d7323e79 3113.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
3114The incremental source may be specified as with the
3115.Fl i
3116option.
3117.It Fl L, -large-block
3118Generate a stream which may contain blocks larger than 128KB.
3119This flag has no effect if the
3120.Sy large_blocks
3121pool feature is disabled, or if the
3122.Sy recordsize
3123property of this filesystem has never been set above 128KB.
3124The receiving system must have the
3125.Sy large_blocks
3126pool feature enabled as well.
3127See
3128.Xr zpool-features 5
3129for details on ZFS feature flags and the
3130.Sy large_blocks
3131feature.
3132.It Fl P, -parsable
9566fb1a 3133Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3134.It Fl R, -replicate
3135Generate a replication stream package, which will replicate the specified
3136file system, and all descendent file systems, up to the named snapshot.
3137When received, all properties, snapshots, descendent file systems, and clones
3138are preserved.
3139.Pp
3140If the
3141.Fl i
3142or
3143.Fl I
3144flags are used in conjunction with the
3145.Fl R
3146flag, an incremental replication stream is generated.
3147The current values of properties, and current snapshot and file system names are
3148set when the stream is received.
3149If the
3150.Fl F
3151flag is specified when this stream is received, snapshots and file systems that
3152do not exist on the sending side are destroyed.
3153.It Fl e, -embed
3154Generate a more compact stream by using
3155.Sy WRITE_EMBEDDED
3156records for blocks which are stored more compactly on disk by the
3157.Sy embedded_data
3158pool feature.
3159This flag has no effect if the
3160.Sy embedded_data
3161feature is disabled.
3162The receiving system must have the
3163.Sy embedded_data
3164feature enabled.
3165If the
3166.Sy lz4_compress
3167feature is active on the sending system, then the receiving system must have
3168that feature enabled as well.
3169See
3170.Xr zpool-features 5
3171for details on ZFS feature flags and the
3172.Sy embedded_data
3173feature.
3174.It Fl c, -compressed
2aa34383 3175Generate a more compact stream by using compressed WRITE records for blocks
44f09cdc
BB
3176which are compressed on disk and in memory
3177.Po see the
3178.Sy compression
3179property for details
3180.Pc .
3181If the
3182.Sy lz4_compress
3183feature is active on the sending system, then the receiving system must have
3184that feature enabled as well.
3185If the
3186.Sy large_blocks
3187feature is enabled on the sending system but the
3188.Fl L
3189option is not supplied in conjunction with
3190.Fl c ,
3191then the data will be decompressed before sending so it can be split into
3192smaller block sizes.
b5256303
TC
3193.It Fl w, -raw
3194For encrypted datasets, send data exactly as it exists on disk. This allows
3195backups to be taken even if encryption keys are not currently loaded. The
3196backup may then be received on an untrusted machine since that machine will
3197not have the encryption keys to read the protected data or alter it without
3198being detected. Upon being received, the dataset will have the same encryption
3199keys as it did on the send side, although the
3200.Sy keylocation
3201property will be defaulted to
3202.Sy prompt
3203if not otherwise provided. For unencrypted datasets, this flag will be
3204equivalent to
3205.Fl Lec .
3206Note that if you do not use this flag for sending encrypted datasets, data will
3207be sent unencrypted and may be re-encrypted with a different encryption key on
3208the receiving system, which will disable the ability to do a raw send to that
3209system for incrementals.
44f09cdc
BB
3210.It Fl i Ar snapshot
3211Generate an incremental stream from the first
3212.Ar snapshot
3213.Pq the incremental source
3214to the second
3215.Ar snapshot
3216.Pq the incremental target .
3217The incremental source can be specified as the last component of the snapshot
3218name
3219.Po the
3220.Sy @
3221character and following
3222.Pc
3223and it is assumed to be from the same file system as the incremental target.
3224.Pp
3225If the destination is a clone, the source may be the origin snapshot, which must
3226be fully specified
3227.Po for example,
3228.Em pool/fs@origin ,
3229not just
3230.Em @origin
3231.Pc .
3232.It Fl n, -dryrun
3233Do a dry-run
3234.Pq Qq No-op
3235send.
3236Do not generate any actual send data.
3237This is useful in conjunction with the
3238.Fl v
3239or
3240.Fl P
3241flags to determine what data will be sent.
3242In this case, the verbose output will be written to standard output
3243.Po contrast with a non-dry-run, where the stream is written to standard output
3244and the verbose output goes to standard error
3245.Pc .
3246.It Fl p, -props
3247Include the dataset's properties in the stream.
3248This flag is implicit when
3249.Fl R
3250is specified.
3251The receiving system must also support this feature.
3252.It Fl v, -verbose
3253Print verbose information about the stream package generated.
3254This information includes a per-second report of how much data has been sent.
3255.Pp
3256The format of the stream is committed.
29179568 3257You will be able to receive your streams on future versions of ZFS.
835db585 3258.El
44f09cdc
BB
3259.It Xo
3260.Nm
3261.Cm send
835db585 3262.Op Fl LPcenvw
44f09cdc
BB
3263.Op Fl i Ar snapshot Ns | Ns Ar bookmark
3264.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3265.Xc
3266Generate a send stream, which may be of a filesystem, and may be incremental
3267from a bookmark.
3268If the destination is a filesystem or volume, the pool must be read-only, or the
3269filesystem must not be mounted.
3270When the stream generated from a filesystem or volume is received, the default
3271snapshot name will be
3272.Qq --head-- .
3273.Bl -tag -width "-L"
3274.It Fl L, -large-block
3275Generate a stream which may contain blocks larger than 128KB.
3276This flag has no effect if the
3277.Sy large_blocks
3278pool feature is disabled, or if the
3279.Sy recordsize
3280property of this filesystem has never been set above 128KB.
3281The receiving system must have the
3282.Sy large_blocks
3283pool feature enabled as well.
3284See
3285.Xr zpool-features 5
3286for details on ZFS feature flags and the
3287.Sy large_blocks
3288feature.
835db585 3289.It Fl P, -parsable
3290Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3291.It Fl c, -compressed
3292Generate a more compact stream by using compressed WRITE records for blocks
3293which are compressed on disk and in memory
3294.Po see the
3295.Sy compression
3296property for details
3297.Pc .
3298If the
3299.Sy lz4_compress
3300feature is active on the sending system, then the receiving system must have
3301that feature enabled as well.
3302If the
3303.Sy large_blocks
3304feature is enabled on the sending system but the
3305.Fl L
3306option is not supplied in conjunction with
3307.Fl c ,
3308then the data will be decompressed before sending so it can be split into
3309smaller block sizes.
b5256303
TC
3310.It Fl w, -raw
3311For encrypted datasets, send data exactly as it exists on disk. This allows
3312backups to be taken even if encryption keys are not currently loaded. The
3313backup may then be received on an untrusted machine since that machine will
3314not have the encryption keys to read the protected data or alter it without
3315being detected. Upon being received, the dataset will have the same encryption
3316keys as it did on the send side, although the
3317.Sy keylocation
3318property will be defaulted to
3319.Sy prompt
3320if not otherwise provided. For unencrypted datasets, this flag will be
3321equivalent to
3322.Fl Lec .
3323Note that if you do not use this flag for sending encrypted datasets, data will
3324be sent unencrypted and may be re-encrypted with a different encryption key on
3325the receiving system, which will disable the ability to do a raw send to that
3326system for incrementals.
44f09cdc
BB
3327.It Fl e, -embed
3328Generate a more compact stream by using
3329.Sy WRITE_EMBEDDED
3330records for blocks which are stored more compactly on disk by the
3331.Sy embedded_data
3332pool feature.
3333This flag has no effect if the
3334.Sy embedded_data
3335feature is disabled.
3336The receiving system must have the
3337.Sy embedded_data
3338feature enabled.
3339If the
3340.Sy lz4_compress
3341feature is active on the sending system, then the receiving system must have
9b840763
TC
3342that feature enabled as well. Note that streams generated using this flag are
3343unable to be received into an encrypted dataset.
44f09cdc
BB
3344See
3345.Xr zpool-features 5
3346for details on ZFS feature flags and the
3347.Sy embedded_data
3348feature.
3349.It Fl i Ar snapshot Ns | Ns Ar bookmark
3350Generate an incremental send stream.
3351The incremental source must be an earlier snapshot in the destination's history.
3352It will commonly be an earlier snapshot in the destination's file system, in
3353which case it can be specified as the last component of the name
3354.Po the
3355.Sy #
3356or
3357.Sy @
3358character and following
3359.Pc .
3360.Pp
3361If the incremental target is a clone, the incremental source can be the origin
3362snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
3363origin, etc.
835db585 3364.It Fl n, -dryrun
3365Do a dry-run
3366.Pq Qq No-op
3367send.
3368Do not generate any actual send data.
3369This is useful in conjunction with the
3370.Fl v
3371or
3372.Fl P
3373flags to determine what data will be sent.
3374In this case, the verbose output will be written to standard output
3375.Po contrast with a non-dry-run, where the stream is written to standard output
3376and the verbose output goes to standard error
3377.Pc .
3378.It Fl v, -verbose
3379Print verbose information about the stream package generated.
3380This information includes a per-second report of how much data has been sent.
44f09cdc
BB
3381.El
3382.It Xo
3383.Nm
3384.Cm send
3385.Op Fl Penv
3386.Fl t
3387.Ar receive_resume_token
3388.Xc
3389Creates a send stream which resumes an interrupted receive.
3390The
3391.Ar receive_resume_token
3392is the value of this property on the filesystem or volume that was being
3393received into.
3394See the documentation for
3395.Sy zfs receive -s
3396for more details.
3397.It Xo
3398.Nm
3399.Cm receive
3400.Op Fl Fnsuv
3401.Op Fl o Sy origin Ns = Ns Ar snapshot
3402.Op Fl o Ar property Ns = Ns Ar value
3403.Op Fl x Ar property
3404.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3405.Xc
3406.It Xo
3407.Nm
3408.Cm receive
3409.Op Fl Fnsuv
3410.Op Fl d Ns | Ns Fl e
3411.Op Fl o Sy origin Ns = Ns Ar snapshot
3412.Op Fl o Ar property Ns = Ns Ar value
3413.Op Fl x Ar property
3414.Ar filesystem
3415.Xc
3416Creates a snapshot whose contents are as specified in the stream provided on
3417standard input.
3418If a full stream is received, then a new file system is created as well.
3419Streams are created using the
3420.Nm zfs Cm send
3421subcommand, which by default creates a full stream.
3422.Nm zfs Cm recv
3423can be used as an alias for
3424.Nm zfs Cm receive.
3425.Pp
3426If an incremental stream is received, then the destination file system must
3427already exist, and its most recent snapshot must match the incremental stream's
3428source.
3429For
3430.Sy zvols ,
3431the destination device link is destroyed and recreated, which means the
3432.Sy zvol
3433cannot be accessed during the
3434.Cm receive
3435operation.
3436.Pp
3437When a snapshot replication package stream that is generated by using the
3438.Nm zfs Cm send Fl R
3439command is received, any snapshots that do not exist on the sending location are
3440destroyed by using the
3441.Nm zfs Cm destroy Fl d
3442command.
3443.Pp
3444If
90cdf283 3445.Fl o Em property Ns = Ns Ar value
44f09cdc 3446or
90cdf283 3447.Fl x Em property
44f09cdc
BB
3448is specified, it applies to the effective value of the property throughout
3449the entire subtree of replicated datasets. Effective property values will be
3450set (
3451.Fl o
3452) or inherited (
3453.Fl x
3454) on the topmost in the replicated subtree. In descendant datasets, if the
3455property is set by the send stream, it will be overridden by forcing the
3456property to be inherited from the top‐most file system. Received properties
3457are retained in spite of being overridden and may be restored with
3458.Nm zfs Cm inherit Fl S .
3459Specifying
90cdf283 3460.Fl o Sy origin Ns = Ns Em snapshot
44f09cdc
BB
3461is a special case because, even if
3462.Sy origin
3463is a read-only property and cannot be set, it's allowed to receive the send
3464stream as a clone of the given snapshot.
3465.Pp
3466The name of the snapshot
3467.Pq and file system, if a full stream is received
3468that this subcommand creates depends on the argument type and the use of the
3469.Fl d
3470or
3471.Fl e
3472options.
3473.Pp
3474If the argument is a snapshot name, the specified
3475.Ar snapshot
3476is created.
3477If the argument is a file system or volume name, a snapshot with the same name
3478as the sent snapshot is created within the specified
3479.Ar filesystem
3480or
3481.Ar volume .
3482If neither of the
3483.Fl d
3484or
3485.Fl e
3486options are specified, the provided target snapshot name is used exactly as
3487provided.
3488.Pp
3489The
3490.Fl d
3491and
3492.Fl e
3493options cause the file system name of the target snapshot to be determined by
3494appending a portion of the sent snapshot's name to the specified target
3495.Ar filesystem .
3496If the
3497.Fl d
3498option is specified, all but the first element of the sent snapshot's file
3499system path
3500.Pq usually the pool name
3501is used and any required intermediate file systems within the specified one are
3502created.
3503If the
3504.Fl e
3505option is specified, then only the last element of the sent snapshot's file
3506system name
3507.Pq i.e. the name of the source file system itself
3508is used as the target file system name.
3509.Bl -tag -width "-F"
3510.It Fl F
3511Force a rollback of the file system to the most recent snapshot before
3512performing the receive operation.
3513If receiving an incremental replication stream
3514.Po for example, one generated by
3515.Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3516.Pc ,
3517destroy snapshots and file systems that do not exist on the sending side.
3518.It Fl d
3519Discard the first element of the sent snapshot's file system name, using the
3520remaining elements to determine the name of the target file system for the new
3521snapshot as described in the paragraph above.
3522.It Fl e
3523Discard all but the last element of the sent snapshot's file system name, using
3524that element to determine the name of the target file system for the new
3525snapshot as described in the paragraph above.
3526.It Fl n
3527Do not actually receive the stream.
3528This can be useful in conjunction with the
3529.Fl v
3530option to verify the name the receive operation would use.
3531.It Fl o Sy origin Ns = Ns Ar snapshot
e6d3a843
PD
3532Forces the stream to be received as a clone of the given snapshot.
3533If the stream is a full send stream, this will create the filesystem
44f09cdc
BB
3534described by the stream as a clone of the specified snapshot.
3535Which snapshot was specified will not affect the success or failure of the
3536receive, as long as the snapshot does exist.
3537If the stream is an incremental send stream, all the normal verification will be
3538performed.
90cdf283 3539.It Fl o Em property Ns = Ns Ar value
44f09cdc 3540Sets the specified property as if the command
90cdf283 3541.Nm zfs Cm set Em property Ns = Ns Ar value
44f09cdc
BB
3542was invoked immediately before the receive. When receiving a stream from
3543.Nm zfs Cm send Fl R ,
3544causes the property to be inherited by all descendant datasets, as through
3545.Nm zfs Cm inherit Em property
3546was run on any descendant datasets that have this property set on the
3547sending system.
3548.Pp
3549Any editable property can be set at receive time. Set-once properties bound
3550to the received data, such as
3551.Sy normalization
3552and
3553.Sy casesensitivity ,
3554cannot be set at receive time even when the datasets are newly created by
3555.Nm zfs Cm receive .
3556Additionally both settable properties
3557.Sy version
3558and
3559.Sy volsize
3560cannot be set at receive time.
3561.Pp
3562The
3563.Fl o
3564option may be specified multiple times, for different properties. An error
3565results if the same property is specified in multiple
3566.Fl o
3567or
3568.Fl x
3569options.
3570.It Fl s
3571If the receive is interrupted, save the partially received state, rather
3572than deleting it.
3573Interruption may be due to premature termination of the stream
3574.Po e.g. due to network failure or failure of the remote system
3575if the stream is being read over a network connection
3576.Pc ,
3577a checksum error in the stream, termination of the
3578.Nm zfs Cm receive
3579process, or unclean shutdown of the system.
3580.Pp
3581The receive can be resumed with a stream generated by
3582.Nm zfs Cm send Fl t Ar token ,
3583where the
3584.Ar token
3585is the value of the
3586.Sy receive_resume_token
3587property of the filesystem or volume which is received into.
3588.Pp
3589To use this flag, the storage pool must have the
3590.Sy extensible_dataset
3591feature enabled.
3592See
3593.Xr zpool-features 5
3594for details on ZFS feature flags.
3595.It Fl u
3596File system that is associated with the received stream is not mounted.
3597.It Fl v
3598Print verbose information about the stream and the time required to perform the
3599receive operation.
3600.It Fl x Em property
3601Ensures that the effective value of the specified property after the
3602receive is unaffected by the value of that property in the send stream (if any),
3603as if the property had been excluded from the send stream.
3604.Pp
3605If the specified property is not present in the send stream, this option does
3606nothing.
3607.Pp
3608If a received property needs to be overridden, the effective value will be
3609set or inherited, depending on whether the property is inheritable or not.
3610.Pp
3611In the case of an incremental update,
3612.Fl x
3613leaves any existing local setting or explicit inheritance unchanged.
3614.Pp
3615All
3616.Fl o
3617restrictions on set-once and special properties apply equally to
3618.Fl x .
3619.El
3620.It Xo
3621.Nm
3622.Cm receive
3623.Fl A
3624.Ar filesystem Ns | Ns Ar volume
3625.Xc
3626Abort an interrupted
3627.Nm zfs Cm receive Fl s ,
3628deleting its saved partially received state.
3629.It Xo
3630.Nm
3631.Cm allow
3632.Ar filesystem Ns | Ns Ar volume
3633.Xc
3634Displays permissions that have been delegated on the specified filesystem or
3635volume.
3636See the other forms of
3637.Nm zfs Cm allow
3638for more information.
3639.Pp
3640Delegations are supported under Linux with the exception of
3641.Sy mount ,
3642.Sy unmount ,
3643.Sy mountpoint ,
3644.Sy canmount ,
3645.Sy rename ,
3646and
3647.Sy share .
3648These permissions cannot be delegated because the Linux
3649.Xr mount 8
3650command restricts modifications of the global namespace to the root user.
3651.It Xo
3652.Nm
3653.Cm allow
3654.Op Fl dglu
3655.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3656.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3657.Ar setname Oc Ns ...
3658.Ar filesystem Ns | Ns Ar volume
058ac9ba 3659.br
44f09cdc
BB
3660.Nm
3661.Cm allow
3662.Op Fl dl
3663.Fl e Ns | Ns Sy everyone
3664.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3665.Ar setname Oc Ns ...
3666.Ar filesystem Ns | Ns Ar volume
3667.Xc
3668Delegates ZFS administration permission for the file systems to non-privileged
3669users.
3670.Bl -tag -width "-d"
3671.It Fl d
3672Allow only for the descendent file systems.
3673.It Fl e Ns | Ns Sy everyone
3674Specifies that the permissions be delegated to everyone.
3675.It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
3676Explicitly specify that permissions are delegated to the group.
3677.It Fl l
3678Allow
3679.Qq locally
3680only for the specified file system.
3681.It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
3682Explicitly specify that permissions are delegated to the user.
3683.It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3684Specifies to whom the permissions are delegated.
3685Multiple entities can be specified as a comma-separated list.
3686If neither of the
3687.Fl gu
3688options are specified, then the argument is interpreted preferentially as the
3689keyword
3690.Sy everyone ,
3691then as a user name, and lastly as a group name.
3692To specify a user or group named
3693.Qq everyone ,
3694use the
3695.Fl g
3696or
3697.Fl u
3698options.
3699To specify a group with the same name as a user, use the
3700.Fl g
3701options.
3702.It Xo
3703.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3704.Ar setname Oc Ns ...
3705.Xc
3706The permissions to delegate.
3707Multiple permissions may be specified as a comma-separated list.
3708Permission names are the same as ZFS subcommand and property names.
3709See the property list below.
3710Property set names, which begin with
3711.Sy @ ,
3712may be specified.
3713See the
3714.Fl s
3715form below for details.
3716.El
3717.Pp
3718If neither of the
3719.Fl dl
3720options are specified, or both are, then the permissions are allowed for the
3721file system or volume, and all of its descendents.
3722.Pp
3723Permissions are generally the ability to use a ZFS subcommand or change a ZFS
3724property.
3725The following permissions are available:
3726.Bd -literal
058ac9ba 3727NAME TYPE NOTES
44f09cdc
BB
3728allow subcommand Must also have the permission that is
3729 being allowed
3730clone subcommand Must also have the 'create' ability and
3731 'mount' ability in the origin file system
058ac9ba
BB
3732create subcommand Must also have the 'mount' ability
3733destroy subcommand Must also have the 'mount' ability
0677cb6f 3734diff subcommand Allows lookup of paths within a dataset
44f09cdc
BB
3735 given an object number, and the ability
3736 to create snapshots necessary to
3737 'zfs diff'.
b5256303
TC
3738load-key subcommand Allows loading and unloading of encryption key
3739 (see 'zfs load-key' and 'zfs unload-key').
3740change-key subcommand Allows changing an encryption key via
3741 'zfs change-key'.
058ac9ba 3742mount subcommand Allows mount/umount of ZFS datasets
44f09cdc
BB
3743promote subcommand Must also have the 'mount' and 'promote'
3744 ability in the origin file system
3745receive subcommand Must also have the 'mount' and 'create'
3746 ability
058ac9ba
BB
3747rename subcommand Must also have the 'mount' and 'create'
3748 ability in the new parent
3749rollback subcommand Must also have the 'mount' ability
6b4e21c6 3750send subcommand
44f09cdc
BB
3751share subcommand Allows sharing file systems over NFS
3752 or SMB protocols
058ac9ba 3753snapshot subcommand Must also have the 'mount' ability
44f09cdc
BB
3754
3755groupquota other Allows accessing any groupquota@...
3756 property
058ac9ba
BB
3757groupused other Allows reading any groupused@... property
3758userprop other Allows changing any user property
44f09cdc
BB
3759userquota other Allows accessing any userquota@...
3760 property
058ac9ba
BB
3761userused other Allows reading any userused@... property
3762
6b4e21c6 3763aclinherit property
44f09cdc 3764acltype property
6b4e21c6
NB
3765atime property
3766canmount property
3767casesensitivity property
3768checksum property
3769compression property
3770copies property
6b4e21c6
NB
3771devices property
3772exec property
788eb90c 3773filesystem_limit property
6b4e21c6
NB
3774mountpoint property
3775nbmand property
3776normalization property
3777primarycache property
3778quota property
3779readonly property
3780recordsize property
3781refquota property
3782refreservation property
3783reservation property
3784secondarycache property
3785setuid property
3786sharenfs property
3787sharesmb property
3788snapdir property
788eb90c 3789snapshot_limit property
6b4e21c6
NB
3790utf8only property
3791version property
3792volblocksize property
3793volsize property
3794vscan property
3795xattr property
3796zoned property
44f09cdc
BB
3797.Ed
3798.It Xo
3799.Nm
3800.Cm allow
3801.Fl c
3802.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3803.Ar setname Oc Ns ...
3804.Ar filesystem Ns | Ns Ar volume
3805.Xc
3806Sets
3807.Qq create time
3808permissions.
3809These permissions are granted
3810.Pq locally
3811to the creator of any newly-created descendent file system.
3812.It Xo
3813.Nm
3814.Cm allow
3815.Fl s No @ Ns Ar setname
3816.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3817.Ar setname Oc Ns ...
3818.Ar filesystem Ns | Ns Ar volume
3819.Xc
3820Defines or adds permissions to a permission set.
3821The set can be used by other
3822.Nm zfs Cm allow
3823commands for the specified file system and its descendents.
3824Sets are evaluated dynamically, so changes to a set are immediately reflected.
3825Permission sets follow the same naming restrictions as ZFS file systems, but the
3826name must begin with
3827.Sy @ ,
3828and can be no more than 64 characters long.
3829.It Xo
3830.Nm
3831.Cm unallow
3832.Op Fl dglru
3833.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3834.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3835.Ar setname Oc Ns ... Oc
3836.Ar filesystem Ns | Ns Ar volume
058ac9ba 3837.br
44f09cdc
BB
3838.Nm
3839.Cm unallow
3840.Op Fl dlr
3841.Fl e Ns | Ns Sy everyone
3842.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3843.Ar setname Oc Ns ... Oc
3844.Ar filesystem Ns | Ns Ar volume
058ac9ba 3845.br
44f09cdc
BB
3846.Nm
3847.Cm unallow
3848.Op Fl r
3849.Fl c
3850.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3851.Ar setname Oc Ns ... Oc
3852.Ar filesystem Ns | Ns Ar volume
3853.Xc
3854Removes permissions that were granted with the
3855.Nm zfs Cm allow
3856command.
3857No permissions are explicitly denied, so other permissions granted are still in
3858effect.
3859For example, if the permission is granted by an ancestor.
3860If no permissions are specified, then all permissions for the specified
3861.Ar user ,
3862.Ar group ,
3863or
3864.Sy everyone
3865are removed.
3866Specifying
3867.Sy everyone
3868.Po or using the
3869.Fl e
3870option
3871.Pc
3872only removes the permissions that were granted to everyone, not all permissions
3873for every user and group.
3874See the
3875.Nm zfs Cm allow
3876command for a description of the
3877.Fl ldugec
3878options.
3879.Bl -tag -width "-r"
3880.It Fl r
058ac9ba 3881Recursively remove the permissions from this file system and all descendents.
44f09cdc
BB
3882.El
3883.It Xo
3884.Nm
3885.Cm unallow
3886.Op Fl r
3887.Fl s No @ Ns Ar setname
3888.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3889.Ar setname Oc Ns ... Oc
3890.Ar filesystem Ns | Ns Ar volume
3891.Xc
3892Removes permissions from a permission set.
3893If no permissions are specified, then all permissions are removed, thus removing
3894the set entirely.
3895.It Xo
3896.Nm
3897.Cm hold
3898.Op Fl r
3899.Ar tag Ar snapshot Ns ...
3900.Xc
3901Adds a single reference, named with the
3902.Ar tag
3903argument, to the specified snapshot or snapshots.
3904Each snapshot has its own tag namespace, and tags must be unique within that
3905space.
3906.Pp
3907If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3908.Nm zfs Cm destroy
3909command return
3910.Er EBUSY .
3911.Bl -tag -width "-r"
3912.It Fl r
3913Specifies that a hold with the given tag is applied recursively to the snapshots
3914of all descendent file systems.
3915.El
3916.It Xo
3917.Nm
3918.Cm holds
3919.Op Fl r
3920.Ar snapshot Ns ...
3921.Xc
058ac9ba 3922Lists all existing user references for the given snapshot or snapshots.
44f09cdc
BB
3923.Bl -tag -width "-r"
3924.It Fl r
3925Lists the holds that are set on the named descendent snapshots, in addition to
3926listing the holds on the named snapshot.
3927.El
3928.It Xo
3929.Nm
3930.Cm release
3931.Op Fl r
3932.Ar tag Ar snapshot Ns ...
3933.Xc
3934Removes a single reference, named with the
3935.Ar tag
3936argument, from the specified snapshot or snapshots.
3937The tag must already exist for each snapshot.
3938If a hold exists on a snapshot, attempts to destroy that snapshot by using the
3939.Nm zfs Cm destroy
3940command return
3941.Er EBUSY .
3942.Bl -tag -width "-r"
3943.It Fl r
3944Recursively releases a hold with the given tag on the snapshots of all
3945descendent file systems.
3946.El
3947.It Xo
3948.Nm
3949.Cm diff
3950.Op Fl FHt
3951.Ar snapshot Ar snapshot Ns | Ns Ar filesystem
3952.Xc
0677cb6f
RL
3953Display the difference between a snapshot of a given filesystem and another
3954snapshot of that filesystem from a later time or the current contents of the
44f09cdc
BB
3955filesystem.
3956The first column is a character indicating the type of change, the other columns
3957indicate pathname, new pathname
3958.Pq in case of rename ,
3959change in link count, and optionally file type and/or change time.
0677cb6f 3960The types of change are:
44f09cdc 3961.Bd -literal
0677cb6f
RL
3962- The path has been removed
3963+ The path has been created
3964M The path has been modified
3965R The path has been renamed
44f09cdc
BB
3966.Ed
3967.Bl -tag -width "-F"
3968.It Fl F
3969Display an indication of the type of file, in a manner similar to the
3970.Fl
3971option of
3972.Xr ls 1 .
3973.Bd -literal
0677cb6f
RL
3974B Block device
3975C Character device
3976/ Directory
3977> Door
3978| Named pipe
3979@ Symbolic link
3980P Event port
3981= Socket
3982F Regular file
44f09cdc
BB
3983.Ed
3984.It Fl H
3985Give more parsable tab-separated output, without header lines and without
3986arrows.
3987.It Fl t
0677cb6f 3988Display the path's inode change time as the first column of output.
44f09cdc 3989.El
b5256303
TC
3990.It Xo
3991.Nm
3992.Cm load-key
3993.Op Fl nr
3994.Op Fl L Ar keylocation
3995.Fl a | Ar filesystem
3996.Xc
3997Load the key for
3998.Ar filesystem ,
3999allowing it and all children that inherit the
4000.Sy keylocation
4001property to be accessed. The key will be expected in the format specified by the
4002.Sy keyformat
4003and location specified by the
4004.Sy keylocation
4005property. Note that if the
4006.Sy keylocation
4007is set to
4008.Sy prompt
4009the terminal will interactively wait for the key to be entered. Loading a key
4010will not automatically mount the dataset. If that functionality is desired,
4011.Nm zfs Cm mount Sy -l
4012will ask for the key and mount the dataset. Once the key is loaded the
4013.Sy keystatus
4014property will become
4015.Sy available .
4016.Bl -tag -width "-r"
4017.It Fl r
4018Recursively loads the keys for the specified filesystem and all descendent
4019encryption roots.
4020.It Fl a
4021Loads the keys for all encryption roots in all imported pools.
4022.It Fl n
4023Do a dry-run
4024.Pq Qq No-op
4025load-key. This will cause zfs to simply check that the
4026provided key is correct. This command may be run even if the key is already
4027loaded.
4028.It Fl L Ar keylocation
4029Use
4030.Ar keylocation
4031instead of the
4032.Sy keylocation
4033property. This will not change the value of the property on the dataset. Note
4034that if used with either
4035.Fl r
4036or
4037.Fl a ,
4038.Ar keylocation
4039may only be given as
4040.Sy prompt .
4041.El
4042.It Xo
4043.Nm
4044.Cm unload-key
4045.Op Fl r
4046.Fl a | Ar filesystem
4047.Xc
4048Unloads a key from ZFS, removing the ability to access the dataset and all of
4049its children that inherit the
4050.Sy keylocation
4051property. This requires that the dataset is not currently open or mounted. Once
4052the key is unloaded the
4053.Sy keystatus
4054property will become
4055.Sy unavailable .
4056.Bl -tag -width "-r"
4057.It Fl r
4058Recursively unloads the keys for the specified filesystem and all descendent
4059encryption roots.
4060.It Fl a
4061Unloads the keys for all encryption roots in all imported pools.
4062.El
4063.It Xo
4064.Nm
4065.Cm change-key
4066.Op Fl l
4067.Op Fl o Ar keylocation Ns = Ns Ar value
4068.Op Fl o Ar keyformat Ns = Ns Ar value
4069.Op Fl o Ar pbkdf2iters Ns = Ns Ar value
4070.Ar filesystem
4071.Xc
4072.It Xo
4073.Nm
4074.Cm change-key
4075.Fl i
4076.Op Fl l
4077.Ar filesystem
4078.Xc
4079Allows a user to change the encryption key used to access a dataset. This
4080command requires that the existing key for the dataset is already loaded into
4081ZFS. This command may also be used to change the
4082.Sy keylocation ,
4083.Sy keyformat ,
4084and
4085.Sy pbkdf2iters
4086properties as needed. If the dataset was not previously an encryption root it
4087will become one. Alternatively, the
4088.Fl i
4089flag may be provided to cause an encryption root to inherit the parent's key
4090instead.
4091.Bl -tag -width "-r"
4092.It Fl l
4093Ensures the key is loaded before attempting to change the key. This is
4094effectively equivalent to
4095.Qq Nm zfs Cm load-key Ar filesystem ; Nm zfs Cm change-key Ar filesystem
4096.It Fl o Ar property Ns = Ns Ar value
4097Allows the user to set encryption key properties (
4098.Sy keyformat ,
4099.Sy keylocation ,
4100and
4101.Sy pbkdf2iters
4102) while changing the key. This is the only way to alter
4103.Sy keyformat
4104and
4105.Sy pbkdf2iters
4106after the dataset has been created.
4107.It Fl i
4108Indicates that zfs should make
4109.Ar filesystem
4110inherit the key of its parent. Note that this command can only be run on an
4111encryption root that has an encrypted parent.
4112.El
44f09cdc
BB
4113.El
4114.Sh EXIT STATUS
4115The
4116.Nm
4117utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
4118options were specified.
4119.Sh EXAMPLES
4120.Bl -tag -width ""
4121.It Sy Example 1 No Creating a ZFS File System Hierarchy
4122The following commands create a file system named
4123.Em pool/home
4124and a file system named
4125.Em pool/home/bob .
4126The mount point
4127.Pa /export/home
4128is set for the parent file system, and is automatically inherited by the child
4129file system.
4130.Bd -literal
4131# zfs create pool/home
4132# zfs set mountpoint=/export/home pool/home
4133# zfs create pool/home/bob
4134.Ed
4135.It Sy Example 2 No Creating a ZFS Snapshot
4136The following command creates a snapshot named
4137.Sy yesterday .
4138This snapshot is mounted on demand in the
4139.Pa .zfs/snapshot
4140directory at the root of the
4141.Em pool/home/bob
4142file system.
4143.Bd -literal
4144# zfs snapshot pool/home/bob@yesterday
4145.Ed
4146.It Sy Example 3 No Creating and Destroying Multiple Snapshots
4147The following command creates snapshots named
4148.Sy yesterday
4149of
4150.Em pool/home
4151and all of its descendent file systems.
4152Each snapshot is mounted on demand in the
4153.Pa .zfs/snapshot
4154directory at the root of its file system.
4155The second command destroys the newly created snapshots.
4156.Bd -literal
4157# zfs snapshot -r pool/home@yesterday
4158# zfs destroy -r pool/home@yesterday
4159.Ed
4160.It Sy Example 4 No Disabling and Enabling File System Compression
4161The following command disables the
4162.Sy compression
4163property for all file systems under
4164.Em pool/home .
4165The next command explicitly enables
4166.Sy compression
4167for
4168.Em pool/home/anne .
4169.Bd -literal
4170# zfs set compression=off pool/home
4171# zfs set compression=on pool/home/anne
4172.Ed
4173.It Sy Example 5 No Listing ZFS Datasets
4174The following command lists all active file systems and volumes in the system.
4175Snapshots are displayed if the
4176.Sy listsnaps
4177property is
4178.Sy on .
4179The default is
4180.Sy off .
4181See
4182.Xr zpool 8
4183for more information on pool properties.
4184.Bd -literal
4185# zfs list
4186NAME USED AVAIL REFER MOUNTPOINT
4187pool 450K 457G 18K /pool
4188pool/home 315K 457G 21K /export/home
4189pool/home/anne 18K 457G 18K /export/home/anne
4190pool/home/bob 276K 457G 276K /export/home/bob
4191.Ed
4192.It Sy Example 6 No Setting a Quota on a ZFS File System
4193The following command sets a quota of 50 Gbytes for
4194.Em pool/home/bob .
4195.Bd -literal
4196# zfs set quota=50G pool/home/bob
4197.Ed
4198.It Sy Example 7 No Listing ZFS Properties
4199The following command lists all properties for
4200.Em pool/home/bob .
4201.Bd -literal
4202# zfs get all pool/home/bob
058ac9ba
BB
4203NAME PROPERTY VALUE SOURCE
4204pool/home/bob type filesystem -
4205pool/home/bob creation Tue Jul 21 15:53 2009 -
4206pool/home/bob used 21K -
4207pool/home/bob available 20.0G -
4208pool/home/bob referenced 21K -
4209pool/home/bob compressratio 1.00x -
4210pool/home/bob mounted yes -
4211pool/home/bob quota 20G local
4212pool/home/bob reservation none default
4213pool/home/bob recordsize 128K default
4214pool/home/bob mountpoint /pool/home/bob default
4215pool/home/bob sharenfs off default
4216pool/home/bob checksum on default
4217pool/home/bob compression on local
4218pool/home/bob atime on default
4219pool/home/bob devices on default
4220pool/home/bob exec on default
4221pool/home/bob setuid on default
4222pool/home/bob readonly off default
4223pool/home/bob zoned off default
4224pool/home/bob snapdir hidden default
023699cd 4225pool/home/bob acltype off default
058ac9ba
BB
4226pool/home/bob aclinherit restricted default
4227pool/home/bob canmount on default
058ac9ba
BB
4228pool/home/bob xattr on default
4229pool/home/bob copies 1 default
4230pool/home/bob version 4 -
4231pool/home/bob utf8only off -
4232pool/home/bob normalization none -
4233pool/home/bob casesensitivity sensitive -
4234pool/home/bob vscan off default
4235pool/home/bob nbmand off default
4236pool/home/bob sharesmb off default
4237pool/home/bob refquota none default
4238pool/home/bob refreservation none default
4239pool/home/bob primarycache all default
4240pool/home/bob secondarycache all default
4241pool/home/bob usedbysnapshots 0 -
4242pool/home/bob usedbydataset 21K -
4243pool/home/bob usedbychildren 0 -
4244pool/home/bob usedbyrefreservation 0 -
44f09cdc
BB
4245.Ed
4246.Pp
058ac9ba 4247The following command gets a single property value.
44f09cdc
BB
4248.Bd -literal
4249# zfs get -H -o value compression pool/home/bob
058ac9ba 4250on
44f09cdc
BB
4251.Ed
4252The following command lists all properties with local settings for
4253.Em pool/home/bob .
4254.Bd -literal
4255# zfs get -r -s local -o name,property,value all pool/home/bob
058ac9ba
BB
4256NAME PROPERTY VALUE
4257pool/home/bob quota 20G
4258pool/home/bob compression on
44f09cdc
BB
4259.Ed
4260.It Sy Example 8 No Rolling Back a ZFS File System
4261The following command reverts the contents of
4262.Em pool/home/anne
4263to the snapshot named
4264.Sy yesterday ,
4265deleting all intermediate snapshots.
4266.Bd -literal
4267# zfs rollback -r pool/home/anne@yesterday
4268.Ed
4269.It Sy Example 9 No Creating a ZFS Clone
4270The following command creates a writable file system whose initial contents are
4271the same as
4272.Em pool/home/bob@yesterday .
4273.Bd -literal
4274# zfs clone pool/home/bob@yesterday pool/clone
4275.Ed
4276.It Sy Example 10 No Promoting a ZFS Clone
4277The following commands illustrate how to test out changes to a file system, and
4278then replace the original file system with the changed one, using clones, clone
4279promotion, and renaming:
4280.Bd -literal
4281# zfs create pool/project/production
058ac9ba 4282 populate /pool/project/production with data
44f09cdc
BB
4283# zfs snapshot pool/project/production@today
4284# zfs clone pool/project/production@today pool/project/beta
4285 make changes to /pool/project/beta and test them
4286# zfs promote pool/project/beta
4287# zfs rename pool/project/production pool/project/legacy
4288# zfs rename pool/project/beta pool/project/production
4289 once the legacy version is no longer needed, it can be destroyed
4290# zfs destroy pool/project/legacy
4291.Ed
4292.It Sy Example 11 No Inheriting ZFS Properties
4293The following command causes
4294.Em pool/home/bob
4295and
4296.Em pool/home/anne
4297to inherit the
4298.Sy checksum
4299property from their parent.
4300.Bd -literal
4301# zfs inherit checksum pool/home/bob pool/home/anne
4302.Ed
4303.It Sy Example 12 No Remotely Replicating ZFS Data
4304The following commands send a full stream and then an incremental stream to a
4305remote machine, restoring them into
4306.Em poolB/received/fs@a
4307and
4308.Em poolB/received/fs@b ,
4309respectively.
4310.Em poolB
4311must contain the file system
4312.Em poolB/received ,
4313and must not initially contain
4314.Em poolB/received/fs .
4315.Bd -literal
4316# zfs send pool/fs@a | \e
4317 ssh host zfs receive poolB/received/fs@a
4318# zfs send -i a pool/fs@b | \e
4319 ssh host zfs receive poolB/received/fs
4320.Ed
4321.It Sy Example 13 No Using the zfs receive -d Option
4322The following command sends a full stream of
4323.Em poolA/fsA/fsB@snap
4324to a remote machine, receiving it into
4325.Em poolB/received/fsA/fsB@snap .
4326The
4327.Em fsA/fsB@snap
4328portion of the received snapshot's name is determined from the name of the sent
4329snapshot.
4330.Em poolB
4331must contain the file system
4332.Em poolB/received .
4333If
4334.Em poolB/received/fsA
4335does not exist, it is created as an empty file system.
4336.Bd -literal
4337# zfs send poolA/fsA/fsB@snap | \e
4338 ssh host zfs receive -d poolB/received
4339.Ed
4340.It Sy Example 14 No Setting User Properties
4341The following example sets the user-defined
4342.Sy com.example:department
4343property for a dataset.
4344.Bd -literal
4345# zfs set com.example:department=12345 tank/accounting
4346.Ed
4347.It Sy Example 15 No Performing a Rolling Snapshot
4348The following example shows how to maintain a history of snapshots with a
4349consistent naming scheme.
4350To keep a week's worth of snapshots, the user destroys the oldest snapshot,
4351renames the remaining snapshots, and then creates a new snapshot, as follows:
4352.Bd -literal
4353# zfs destroy -r pool/users@7daysago
4354# zfs rename -r pool/users@6daysago @7daysago
4355# zfs rename -r pool/users@5daysago @6daysago
4356# zfs rename -r pool/users@yesterday @5daysago
4357# zfs rename -r pool/users@yesterday @4daysago
4358# zfs rename -r pool/users@yesterday @3daysago
4359# zfs rename -r pool/users@yesterday @2daysago
4360# zfs rename -r pool/users@today @yesterday
4361# zfs snapshot -r pool/users@today
4362.Ed
4363.It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
4364The following commands show how to set
4365.Sy sharenfs
4366property options to enable
4367.Sy rw
4368access for a set of
4369.Sy IP
4370addresses and to enable root access for system
4371.Sy neo
4372on the
4373.Em tank/home
4374file system.
4375.Bd -literal
4376# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
4377.Ed
4378.Pp
4379If you are using
4380.Sy DNS
4381for host name resolution, specify the fully qualified hostname.
4382.It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
4383The following example shows how to set permissions so that user
4384.Sy cindys
4385can create, destroy, mount, and take snapshots on
4386.Em tank/cindys .
4387The permissions on
4388.Em tank/cindys
4389are also displayed.
4390.Bd -literal
4391# zfs allow cindys create,destroy,mount,snapshot tank/cindys
4392# zfs allow tank/cindys
4393---- Permissions on tank/cindys --------------------------------------
4394Local+Descendent permissions:
4395 user cindys create,destroy,mount,snapshot
4396.Ed
4397.Pp
4398Because the
4399.Em tank/cindys
4400mount point permission is set to 755 by default, user
4401.Sy cindys
4402will be unable to mount file systems under
4403.Em tank/cindys .
4404Add an ACE similar to the following syntax to provide mount point access:
4405.Bd -literal
4406# chmod A+user:cindys:add_subdirectory:allow /tank/cindys
4407.Ed
4408.It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
4409The following example shows how to grant anyone in the group
4410.Sy staff
4411to create file systems in
4412.Em tank/users .
4413This syntax also allows staff members to destroy their own file systems, but not
4414destroy anyone else's file system.
4415The permissions on
4416.Em tank/users
4417are also displayed.
4418.Bd -literal
4419# zfs allow staff create,mount tank/users
4420# zfs allow -c destroy tank/users
4421# zfs allow tank/users
4422---- Permissions on tank/users ---------------------------------------
4423Permission sets:
4424 destroy
4425Local+Descendent permissions:
4426 group staff create,mount
4427.Ed
4428.It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
4429The following example shows how to define and grant a permission set on the
4430.Em tank/users
4431file system.
4432The permissions on
4433.Em tank/users
4434are also displayed.
4435.Bd -literal
4436# zfs allow -s @pset create,destroy,snapshot,mount tank/users
4437# zfs allow staff @pset tank/users
4438# zfs allow tank/users
4439---- Permissions on tank/users ---------------------------------------
4440Permission sets:
058ac9ba 4441 @pset create,destroy,mount,snapshot
44f09cdc
BB
4442Local+Descendent permissions:
4443 group staff @pset
4444.Ed
4445.It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
4446The following example shows to grant the ability to set quotas and reservations
4447on the
4448.Em users/home
4449file system.
4450The permissions on
4451.Em users/home
4452are also displayed.
4453.Bd -literal
4454# zfs allow cindys quota,reservation users/home
4455# zfs allow users/home
4456---- Permissions on users/home ---------------------------------------
4457Local+Descendent permissions:
058ac9ba 4458 user cindys quota,reservation
44f09cdc
BB
4459cindys% zfs set quota=10G users/home/marks
4460cindys% zfs get quota users/home/marks
4461NAME PROPERTY VALUE SOURCE
4462users/home/marks quota 10G local
4463.Ed
4464.It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
4465The following example shows how to remove the snapshot permission from the
4466.Sy staff
4467group on the
4468.Em tank/users
4469file system.
4470The permissions on
4471.Em tank/users
4472are also displayed.
4473.Bd -literal
4474# zfs unallow staff snapshot tank/users
4475# zfs allow tank/users
4476---- Permissions on tank/users ---------------------------------------
4477Permission sets:
058ac9ba 4478 @pset create,destroy,mount,snapshot
44f09cdc
BB
4479Local+Descendent permissions:
4480 group staff @pset
4481.Ed
4482.It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
0677cb6f 4483The following example shows how to see what has changed between a prior
44f09cdc
BB
4484snapshot of a ZFS dataset and its current state.
4485The
4486.Fl F
4487option is used to indicate type information for the files affected.
4488.Bd -literal
0677cb6f
RL
4489# zfs diff -F tank/test@before tank/test
4490M / /tank/test/
4491M F /tank/test/linked (+1)
4492R F /tank/test/oldname -> /tank/test/newname
4493- F /tank/test/deleted
4494+ F /tank/test/created
4495M F /tank/test/modified
44f09cdc
BB
4496.Ed
4497.It Sy Example 23 No Creating a bookmark
4498The following example create a bookmark to a snapshot. This bookmark
4499can then be used instead of snapshot in send streams.
4500.Bd -literal
a215ee16 4501# zfs bookmark rpool@snapshot rpool#bookmark
44f09cdc
BB
4502.Ed
4503.It Sy Example 24 No Setting sharesmb Property Options on a ZFS File System
4504The following example show how to share SMB filesystem through ZFS. Note that
4505that a user and his/her password must be given.
4506.Bd -literal
4507# smbmount //127.0.0.1/share_tmp /mnt/tmp \\
4508 -o user=workgroup/turbo,password=obrut,uid=1000
4509.Ed
4510.Pp
4511Minimal
4512.Em /etc/samba/smb.conf
4513configuration required:
4514.Pp
4515Samba will need to listen to 'localhost' (127.0.0.1) for the ZFS utilities to
4516communicate with Samba. This is the default behavior for most Linux
4517distributions.
4518.Pp
4519Samba must be able to authenticate a user. This can be done in a number of
4520ways, depending on if using the system password file, LDAP or the Samba
4521specific smbpasswd file. How to do this is outside the scope of this manual.
4522Please refer to the
4523.Xr smb.conf 5
4524man page for more information.
4525.Pp
4526See the
4527.Sy USERSHARE section
4528of the
4529.Xr smb.conf 5
4530man page for all configuration options in case you need to modify any options
4531to the share afterwards. Do note that any changes done with the
4532.Xr net 8
4533command will be undone if the share is ever unshared (such as at a reboot etc).
4534.El
4535.Sh INTERFACE STABILITY
4536.Sy Committed .
4537.Sh SEE ALSO
90cdf283 4538.Xr attr 1 ,
44f09cdc
BB
4539.Xr gzip 1 ,
4540.Xr ssh 1 ,
44f09cdc 4541.Xr chmod 2 ,
90cdf283 4542.Xr fsync 2 ,
44f09cdc
BB
4543.Xr stat 2 ,
4544.Xr write 2 ,
44f09cdc 4545.Xr acl 5 ,
90cdf283 4546.Xr attributes 5 ,
44f09cdc
BB
4547.Xr exports 5 ,
4548.Xr exportfs 8 ,
90cdf283 4549.Xr mount 8 ,
44f09cdc 4550.Xr net 8 ,
90cdf283 4551.Xr selinux 8 ,
4552.Xr zpool 8