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