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