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