]> git.proxmox.com Git - mirror_zfs.git/blame - man/man8/zfs.8
Disable 'zfs remap' command
[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
faa97c16 198.Op Fl DLPRbcenpvw
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
212.Op Fl Fnsuv
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
219.Op Fl Fnsuv
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
1524blocks into the special allocation class. Valid values are zero or a
1525power of two from 512B up to 128K. The default size is 0 which means no
1526small file blocks will be allocated in the special class.
1527.Pp
1528Before setting this property, a special class vdev must be added to the
1529pool. See
1530.Xr zpool 8
1531for more details on the special allocation class.
44f09cdc
BB
1532.It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
1533Controls the mount point used for this file system.
1534See the
1535.Sx Mount Points
1536section for more information on how this property is used.
1537.Pp
1538When the
1539.Sy mountpoint
1540property is changed for a file system, the file system and any children that
1541inherit the mount point are unmounted.
1542If the new value is
1543.Sy legacy ,
1544then they remain unmounted.
1545Otherwise, they are automatically remounted in the new location if the property
1546was previously
1547.Sy legacy
1548or
1549.Sy none ,
1550or if they were mounted before the property was changed.
1551In addition, any shared file systems are unshared and shared in the new
1552location.
1553.It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
1554Controls whether the file system should be mounted with
1555.Sy nbmand
1556.Pq Non Blocking mandatory locks .
1557This is used for SMB clients.
1558Changes to this property only take effect when the file system is umounted and
1559remounted.
1560See
1561.Xr mount 8
1562for more information on
1563.Sy nbmand
1564mounts. This property is not used on Linux.
1565.It Sy overlay Ns = Ns Sy off Ns | Ns Sy on
1566Allow mounting on a busy directory or a directory which already contains
1567files or directories. This is the default mount behavior for Linux file systems.
1568For consistency with OpenZFS on other platforms overlay mounts are
1569.Sy off
1570by default. Set to
1571.Sy on
1572to enable overlay mounts.
1573.It Sy primarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1574Controls what is cached in the primary cache
1575.Pq ARC .
1576If this property is set to
1577.Sy all ,
1578then both user data and metadata is cached.
1579If this property is set to
1580.Sy none ,
1581then neither user data nor metadata is cached.
1582If this property is set to
1583.Sy metadata ,
1584then only metadata is cached.
1585The default value is
1586.Sy all .
1587.It Sy quota Ns = Ns Em size Ns | Ns Sy none
1588Limits the amount of space a dataset and its descendents can consume.
1589This property enforces a hard limit on the amount of space used.
1590This includes all space consumed by descendents, including file systems and
1591snapshots.
1592Setting a quota on a descendent of a dataset that already has a quota does not
1593override the ancestor's quota, but rather imposes an additional limit.
1594.Pp
1595Quotas cannot be set on volumes, as the
1596.Sy volsize
1597property acts as an implicit quota.
1598.It Sy snapshot_limit Ns = Ns Em count Ns | Ns Sy none
788eb90c 1599Limits the number of snapshots that can be created on a dataset and its
44f09cdc
BB
1600descendents.
1601Setting a
1602.Sy snapshot_limit
1603on a descendent of a dataset that already has a
1604.Sy snapshot_limit
1605does not override the ancestor's
1606.Sy snapshot_limit ,
1607but rather imposes an additional limit.
1608The limit is not enforced if the user is allowed to change the limit.
1609For example, this means that recursive snapshots taken from the global zone are
1610counted against each delegated dataset within a zone.
1611This feature must be enabled to be used
1612.Po see
1613.Xr zpool-features 5
1614.Pc .
1615.It Sy userquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1616Limits the amount of space consumed by the specified user.
1617User space consumption is identified by the
1618.Sy userspace@ Ns Em user
1619property.
1620.Pp
1621Enforcement of user quotas may be delayed by several seconds.
1622This delay means that a user might exceed their quota before the system notices
1623that they are over quota and begins to refuse additional writes with the
1624.Er EDQUOT
1625error message.
1626See the
1627.Nm zfs Cm userspace
1628subcommand for more information.
1629.Pp
1630Unprivileged users can only access their own groups' space usage.
1631The root user, or a user who has been granted the
1632.Sy userquota
1633privilege with
1634.Nm zfs Cm allow ,
1635can get and set everyone's quota.
1636.Pp
1637This property is not available on volumes, on file systems before version 4, or
1638on pools before version 15.
1639The
1640.Sy userquota@ Ns Em ...
1641properties are not displayed by
1642.Nm zfs Cm get Sy all .
1643The user's name must be appended after the
1644.Sy @
1645symbol, using one of the following forms:
1646.Bl -bullet
1647.It
1648.Em POSIX name
1649.Po for example,
1650.Sy joe
1651.Pc
1652.It
1653.Em POSIX numeric ID
1654.Po for example,
1655.Sy 789
1656.Pc
1657.It
1658.Em SID name
1659.Po for example,
1660.Sy joe.smith@mydomain
1661.Pc
1662.It
1663.Em SID numeric ID
1664.Po for example,
1665.Sy S-1-123-456-789
1666.Pc
1667.El
1668.Pp
6a107f41 1669Files created on Linux always have POSIX owners.
44f09cdc
BB
1670.It Sy userobjquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1671The
1672.Sy userobjquota
1673is similar to
1674.Sy userquota
1675but it limits the number of objects a user can create. Please refer to
1676.Sy userobjused
1677for more information about how objects are counted.
1678.It Sy groupquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1679Limits the amount of space consumed by the specified group.
1680Group space consumption is identified by the
1681.Sy groupused@ Ns Em group
1682property.
1683.Pp
1684Unprivileged users can access only their own groups' space usage.
1685The root user, or a user who has been granted the
1686.Sy groupquota
1687privilege with
1688.Nm zfs Cm allow ,
1689can get and set all groups' quotas.
1690.It Sy groupobjquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1691The
1692.Sy groupobjquota
1693is similar to
1694.Sy groupquota
1695but it limits number of objects a group can consume. Please refer to
1696.Sy userobjused
1697for more information about how objects are counted.
9c5167d1
NF
1698.It Sy projectquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1699Limits the amount of space consumed by the specified project. Project
1700space consumption is identified by the
1701.Sy projectused@ Ns Em project
1702property. Please refer to
1703.Sy projectused
1704for more information about how project is identified and set/changed.
1705.Pp
1706The root user, or a user who has been granted the
1707.Sy projectquota
1708privilege with
1709.Nm zfs allow ,
1710can access all projects' quota.
1711.It Sy projectobjquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1712The
1713.Sy projectobjquota
1714is similar to
1715.Sy projectquota
1716but it limits number of objects a project can consume. Please refer to
1717.Sy userobjused
1718for more information about how objects are counted.
44f09cdc
BB
1719.It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
1720Controls whether this dataset can be modified.
1721The default value is
1722.Sy off .
1723The values
1724.Sy on
1725and
1726.Sy off
1727are equivalent to the
1728.Sy ro
1729and
1730.Sy rw
1731mount options.
1732.Pp
1733This property can also be referred to by its shortened column name,
1734.Sy rdonly .
1735.It Sy recordsize Ns = Ns Em size
1736Specifies a suggested block size for files in the file system.
1737This property is designed solely for use with database workloads that access
1738files in fixed-size records.
1739ZFS automatically tunes block sizes according to internal algorithms optimized
1740for typical access patterns.
1741.Pp
1742For databases that create very large files but access them in small random
1743chunks, these algorithms may be suboptimal.
1744Specifying a
1745.Sy recordsize
1746greater than or equal to the record size of the database can result in
1747significant performance gains.
1748Use of this property for general purpose file systems is strongly discouraged,
1749and may adversely affect performance.
1750.Pp
1751The size specified must be a power of two greater than or equal to 512 and less
1752than or equal to 128 Kbytes.
1753If the
1754.Sy large_blocks
1755feature is enabled on the pool, the size may be up to 1 Mbyte.
1756See
1757.Xr zpool-features 5
1758for details on ZFS feature flags.
1759.Pp
1760Changing the file system's
1761.Sy recordsize
1762affects only files created afterward; existing files are unaffected.
1763.Pp
1764This property can also be referred to by its shortened column name,
1765.Sy recsize .
1766.It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1767Controls what types of metadata are stored redundantly.
1768ZFS stores an extra copy of metadata, so that if a single block is corrupted,
1769the amount of user data lost is limited.
1770This extra copy is in addition to any redundancy provided at the pool level
1771.Pq e.g. by mirroring or RAID-Z ,
1772and is in addition to an extra copy specified by the
1773.Sy copies
1774property
1775.Pq up to a total of 3 copies .
1776For example if the pool is mirrored,
1777.Sy copies Ns = Ns 2 ,
1778and
1779.Sy redundant_metadata Ns = Ns Sy most ,
1780then ZFS stores 6 copies of most metadata, and 4 copies of data and some
faf0f58c 1781metadata.
44f09cdc
BB
1782.Pp
1783When set to
1784.Sy all ,
1785ZFS stores an extra copy of all metadata.
1786If a single on-disk block is corrupt, at worst a single block of user data
1787.Po which is
1788.Sy recordsize
1789bytes long
1790.Pc
1791can be lost.
1792.Pp
1793When set to
1794.Sy most ,
1795ZFS stores an extra copy of most types of metadata.
1796This can improve performance of random writes, because less metadata must be
1797written.
1798In practice, at worst about 100 blocks
1799.Po of
1800.Sy recordsize
1801bytes each
1802.Pc
1803of user data can be lost if a single on-disk block is corrupt.
1804The exact behavior of which metadata blocks are stored redundantly may change in
1805future releases.
1806.Pp
1807The default value is
1808.Sy all .
1809.It Sy refquota Ns = Ns Em size Ns | Ns Sy none
1810Limits the amount of space a dataset can consume.
1811This property enforces a hard limit on the amount of space used.
1812This hard limit does not include space used by descendents, including file
1813systems and snapshots.
d22f3a82 1814.It Sy refreservation Ns = Ns Em size Ns | Ns Sy none Ns | Ns Sy auto
44f09cdc
BB
1815The minimum amount of space guaranteed to a dataset, not including its
1816descendents.
1817When the amount of space used is below this value, the dataset is treated as if
1818it were taking up the amount of space specified by
1819.Sy refreservation .
1820The
1821.Sy refreservation
1822reservation is accounted for in the parent datasets' space used, and counts
1823against the parent datasets' quotas and reservations.
1824.Pp
1825If
1826.Sy refreservation
1827is set, a snapshot is only allowed if there is enough free pool space outside of
1828this reservation to accommodate the current number of
1829.Qq referenced
1830bytes in the dataset.
1831.Pp
d22f3a82
MG
1832If
1833.Sy refreservation
1834is set to
1835.Sy auto ,
1836a volume is thick provisioned
1837.Po or
1838.Qq not sparse
1839.Pc .
1840.Sy refreservation Ns = Ns Sy auto
1841is only supported on volumes.
1842See
1843.Sy volsize
1844in the
1845.Sx Native Properties
1846section for more information about sparse volumes.
1847.Pp
44f09cdc
BB
1848This property can also be referred to by its shortened column name,
1849.Sy refreserv .
1850.It Sy relatime Ns = Ns Sy on Ns | Ns Sy off
1851Controls the manner in which the access time is updated when
1852.Sy atime=on
1853is set. Turning this property on causes the access time to be updated relative
1854to the modify or change time. Access time is only updated if the previous
1855access time was earlier than the current modify or change time or if the
1856existing access time hasn't been updated within the past 24 hours. The default
1857value is
1858.Sy off .
1859The values
1860.Sy on
1861and
1862.Sy off
1863are equivalent to the
1864.Sy relatime
1865and
1866.Sy norelatime
1867mount options.
1868.It Sy reservation Ns = Ns Em size Ns | Ns Sy none
1869The minimum amount of space guaranteed to a dataset and its descendants.
1870When the amount of space used is below this value, the dataset is treated as if
1871it were taking up the amount of space specified by its reservation.
1872Reservations are accounted for in the parent datasets' space used, and count
1873against the parent datasets' quotas and reservations.
1874.Pp
1875This property can also be referred to by its shortened column name,
1876.Sy reserv .
1877.It Sy secondarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1878Controls what is cached in the secondary cache
1879.Pq L2ARC .
1880If this property is set to
1881.Sy all ,
1882then both user data and metadata is cached.
1883If this property is set to
1884.Sy none ,
1885then neither user data nor metadata is cached.
1886If this property is set to
1887.Sy metadata ,
1888then only metadata is cached.
1889The default value is
1890.Sy all .
1891.It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
1892Controls whether the setuid bit is respected for the file system.
1893The default value is
1894.Sy on .
1895The values
1896.Sy on
1897and
1898.Sy off
1899are equivalent to the
1900.Sy suid
1901and
1902.Sy nosuid
1903mount options.
1904.It Sy sharesmb Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1905Controls whether the file system is shared by using
1906.Sy Samba USERSHARES
1907and what options are to be used. Otherwise, the file system is automatically
1908shared and unshared with the
1909.Nm zfs Cm share
1910and
1911.Nm zfs Cm unshare
1912commands. If the property is set to on, the
1913.Xr net 8
1914command is invoked to create a
1915.Sy USERSHARE .
1916.Pp
1917Because SMB shares requires a resource name, a unique resource name is
1918constructed from the dataset name. The constructed name is a copy of the
1919dataset name except that the characters in the dataset name, which would be
1920invalid in the resource name, are replaced with underscore (_) characters.
1921Linux does not currently support additional options which might be available
1922on Solaris.
1923.Pp
1924If the
1925.Sy sharesmb
1926property is set to
1927.Sy off ,
1928the file systems are unshared.
1929.Pp
1930The share is created with the ACL (Access Control List) "Everyone:F" ("F"
1931stands for "full permissions", ie. read and write permissions) and no guest
1932access (which means Samba must be able to authenticate a real user, system
1933passwd/shadow, LDAP or smbpasswd based) by default. This means that any
1934additional access control (disallow specific user specific access etc) must
1935be done on the underlying file system.
1936.It Sy sharenfs Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1937Controls whether the file system is shared via NFS, and what options are to be
1938used.
1939A file system with a
1940.Sy sharenfs
1941property of
1942.Sy off
1943is managed with the
1944.Xr exportfs 8
1945command and entries in the
1946.Em /etc/exports
1947file.
1948Otherwise, the file system is automatically shared and unshared with the
1949.Nm zfs Cm share
1950and
1951.Nm zfs Cm unshare
1952commands.
1953If the property is set to
1954.Sy on ,
1955the dataset is shared using the default options:
1956.Pp
1957.Em sec=sys,rw,crossmnt,no_subtree_check,no_root_squash
1958.Pp
1959See
1960.Xr exports 5
1961for the meaning of the default options. Otherwise, the
1962.Xr exportfs 8
1963command is invoked with options equivalent to the contents of this property.
1964.Pp
1965When the
1966.Sy sharenfs
1967property is changed for a dataset, the dataset and any children inheriting the
1968property are re-shared with the new options, only if the property was previously
1969.Sy off ,
1970or if they were shared before the property was changed.
1971If the new property is
1972.Sy off ,
1973the file systems are unshared.
1974.It Sy logbias Ns = Ns Sy latency Ns | Ns Sy throughput
1975Provide a hint to ZFS about handling of synchronous requests in this dataset.
1976If
1977.Sy logbias
1978is set to
1979.Sy latency
1980.Pq the default ,
1981ZFS will use pool log devices
1982.Pq if configured
1983to handle the requests at low latency.
1984If
1985.Sy logbias
1986is set to
1987.Sy throughput ,
1988ZFS will not use configured pool log devices.
1989ZFS will instead optimize synchronous operations for global pool throughput and
1990efficient use of resources.
1991.It Sy snapdev Ns = Ns Sy hidden Ns | Ns Sy visible
1992Controls whether the volume snapshot devices under
1993.Em /dev/zvol/<pool>
1994are hidden or visible. The default value is
1995.Sy hidden .
1996.It Sy snapdir Ns = Ns Sy hidden Ns | Ns Sy visible
1997Controls whether the
1998.Pa .zfs
1999directory is hidden or visible in the root of the file system as discussed in
2000the
2001.Sx Snapshots
2002section.
2003The default value is
2004.Sy hidden .
2005.It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled
2006Controls the behavior of synchronous requests
2007.Pq e.g. fsync, O_DSYNC .
2008.Sy standard
2009is the
2010.Tn POSIX
2011specified behavior of ensuring all synchronous requests are written to stable
2012storage and all devices are flushed to ensure data is not cached by device
2013controllers
2014.Pq this is the default .
2015.Sy always
330d06f9 2016causes every file system transaction to be written and flushed before its
44f09cdc
BB
2017system call returns.
2018This has a large performance penalty.
2019.Sy disabled
2020disables synchronous requests.
2021File system transactions are only committed to stable storage periodically.
2022This option will give the highest performance.
330d06f9 2023However, it is very dangerous as ZFS would be ignoring the synchronous
44f09cdc
BB
2024transaction demands of applications such as databases or NFS.
2025Administrators should only use this option when the risks are understood.
2026.It Sy version Ns = Ns Em N Ns | Ns Sy current
2027The on-disk version of this file system, which is independent of the pool
2028version.
2029This property can only be set to later supported versions.
2030See the
2031.Nm zfs Cm upgrade
2032command.
2033.It Sy volsize Ns = Ns Em size
2034For volumes, specifies the logical size of the volume.
2035By default, creating a volume establishes a reservation of equal size.
2036For storage pools with a version number of 9 or higher, a
2037.Sy refreservation
2038is set instead.
2039Any changes to
2040.Sy volsize
2041are reflected in an equivalent change to the reservation
2042.Po or
2043.Sy refreservation
2044.Pc .
2045The
2046.Sy volsize
2047can only be set to a multiple of
2048.Sy volblocksize ,
2049and cannot be zero.
2050.Pp
2051The reservation is kept equal to the volume's logical size to prevent unexpected
2052behavior for consumers.
2053Without the reservation, the volume could run out of space, resulting in
2054undefined behavior or data corruption, depending on how the volume is used.
2055These effects can also occur when the volume size is changed while it is in use
2056.Pq particularly when shrinking the size .
2057Extreme care should be used when adjusting the volume size.
2058.Pp
2059Though not recommended, a
2060.Qq sparse volume
2061.Po also known as
d22f3a82 2062.Qq thin provisioned
44f09cdc
BB
2063.Pc
2064can be created by specifying the
2065.Fl s
2066option to the
2067.Nm zfs Cm create Fl V
d22f3a82
MG
2068command, or by changing the value of the
2069.Sy refreservation
2070property
2071.Po or
2072.Sy reservation
2073property on pool version 8 or earlier
2074.Pc
2075after the volume has been created.
44f09cdc
BB
2076A
2077.Qq sparse volume
d22f3a82
MG
2078is a volume where the value of
2079.Sy refreservation
2080is less than the size of the volume plus the space required to store its
2081metadata.
44f09cdc
BB
2082Consequently, writes to a sparse volume can fail with
2083.Er ENOSPC
2084when the pool is low on space.
2085For a sparse volume, changes to
2086.Sy volsize
d22f3a82
MG
2087are not reflected in the
2088.Sy refreservation.
2089A volume that is not sparse is said to be
2090.Qq thick provisioned .
2091A sparse volume can become thick provisioned by setting
2092.Sy refreservation
2093to
2094.Sy auto .
cf8738d8 2095.It Sy volmode Ns = Ns Cm default | full | geom | dev | none
2096This property specifies how volumes should be exposed to the OS.
2097Setting it to
2098.Sy full
2099exposes volumes as fully fledged block devices, providing maximal
2100functionality. The value
2101.Sy geom
2102is just an alias for
2103.Sy full
2104and is kept for compatibility.
2105Setting it to
2106.Sy dev
2107hides its partitions.
2108Volumes with property set to
2109.Sy none
2110are not exposed outside ZFS, but can be snapshoted, cloned, replicated, etc,
2111that can be suitable for backup purposes.
2112Value
2113.Sy default
2114means that volumes exposition is controlled by system-wide tunable
2115.Va zvol_volmode ,
2116where
2117.Sy full ,
2118.Sy dev
2119and
2120.Sy none
2121are encoded as 1, 2 and 3 respectively.
2122The default values is
2123.Sy full .
44f09cdc
BB
2124.It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
2125Controls whether regular files should be scanned for viruses when a file is
2126opened and closed.
2127In addition to enabling this property, the virus scan service must also be
2128enabled for virus scanning to occur.
2129The default value is
2130.Sy off .
6a107f41 2131This property is not used on Linux.
44f09cdc
BB
2132.It Sy xattr Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy sa
2133Controls whether extended attributes are enabled for this file system. Two
7c2448a3
BB
2134styles of extended attributes are supported either directory based or system
2135attribute based.
44f09cdc
BB
2136.Pp
2137The default value of
2138.Sy on
2139enables directory based extended attributes. This style of extended attribute
2140imposes no practical limit on either the size or number of attributes which
2141can be set on a file. Although under Linux the
2142.Xr getxattr 2
2143and
2144.Xr setxattr 2
2145system calls limit the maximum size to 64K. This is the most compatible
2146style of extended attribute and is supported by all OpenZFS implementations.
2147.Pp
2148System attribute based xattrs can be enabled by setting the value to
2149.Sy sa .
2150The key advantage of this type of xattr is improved performance. Storing
2151extended attributes as system attributes significantly decreases the amount of
2152disk IO required. Up to 64K of data may be stored per-file in the space
2153reserved for system attributes. If there is not enough space available for
2154an extended attribute then it will be automatically written as a directory
2155based xattr. System attribute based extended attributes are not accessible
2156on platforms which do not support the
2157.Sy xattr=sa
2158feature.
2159.Pp
7c2448a3 2160The use of system attribute based xattrs is strongly encouraged for users of
06f3fc2a 2161SELinux or POSIX ACLs. Both of these features heavily rely of extended
44f09cdc
BB
2162attributes and benefit significantly from the reduced access time.
2163.Pp
2164The values
2165.Sy on
2166and
2167.Sy off
2168are equivalent to the
2169.Sy xattr
2170and
2171.Sy noxattr
2172mount options.
2173.It Sy zoned Ns = Ns Sy on Ns | Ns Sy off
2174Controls whether the dataset is managed from a non-global zone. Zones are a
2175Solaris feature and are not relevant on Linux. The default value is
2176.Sy off .
2177.El
2178.Pp
2179The following three properties cannot be changed after the file system is
2180created, and therefore, should be set when the file system is created.
2181If the properties are not set with the
2182.Nm zfs Cm create
2183or
2184.Nm zpool Cm create
2185commands, these properties are inherited from the parent dataset.
2186If the parent dataset lacks these properties due to having been created prior to
2187these features being supported, the new file system will have the default values
2188for these properties.
2189.Bl -tag -width ""
2190.It Xo
2191.Sy casesensitivity Ns = Ns Sy sensitive Ns | Ns
2192.Sy insensitive Ns | Ns Sy mixed
2193.Xc
2194Indicates whether the file name matching algorithm used by the file system
2195should be case-sensitive, case-insensitive, or allow a combination of both
2196styles of matching.
2197The default value for the
2198.Sy casesensitivity
2199property is
2200.Sy sensitive .
2201Traditionally,
2202.Ux
2203and
2204.Tn POSIX
2205file systems have case-sensitive file names.
2206.Pp
2207The
2208.Sy mixed
2209value for the
2210.Sy casesensitivity
2211property indicates that the file system can support requests for both
2212case-sensitive and case-insensitive matching behavior.
2213Currently, case-insensitive matching behavior on a file system that supports
2214mixed behavior is limited to the SMB server product.
2215For more information about the
2216.Sy mixed
2217value behavior, see the "ZFS Administration Guide".
2218.It Xo
2219.Sy normalization Ns = Ns Sy none Ns | Ns Sy formC Ns | Ns
2220.Sy formD Ns | Ns Sy formKC Ns | Ns Sy formKD
2221.Xc
2222Indicates whether the file system should perform a
2223.Sy unicode
2224normalization of file names whenever two file names are compared, and which
2225normalization algorithm should be used.
2226File names are always stored unmodified, names are normalized as part of any
2227comparison process.
2228If this property is set to a legal value other than
2229.Sy none ,
2230and the
2231.Sy utf8only
2232property was left unspecified, the
2233.Sy utf8only
2234property is automatically set to
2235.Sy on .
2236The default value of the
2237.Sy normalization
2238property is
2239.Sy none .
8fd888ba 2240This property cannot be changed after the file system is created.
44f09cdc
BB
2241.It Sy utf8only Ns = Ns Sy on Ns | Ns Sy off
2242Indicates whether the file system should reject file names that include
2243characters that are not present in the
2244.Sy UTF-8
2245character code set.
2246If this property is explicitly set to
2247.Sy off ,
2248the normalization property must either not be explicitly set or be set to
2249.Sy none .
2250The default value for the
2251.Sy utf8only
2252property is
2253.Sy off .
8fd888ba 2254This property cannot be changed after the file system is created.
44f09cdc
BB
2255.El
2256.Pp
2257The
2258.Sy casesensitivity ,
2259.Sy normalization ,
2260and
2261.Sy utf8only
2262properties are also new permissions that can be assigned to non-privileged users
2263by using the ZFS delegated administration feature.
2264.Ss "Temporary Mount Point Properties"
2265When a file system is mounted, either through
2266.Xr mount 8
2267for legacy mounts or the
2268.Nm zfs Cm mount
2269command for normal file systems, its mount options are set according to its
2270properties.
2271The correlation between properties and mount options is as follows:
2272.Bd -literal
058ac9ba 2273 PROPERTY MOUNT OPTION
44f09cdc
BB
2274 atime atime/noatime
2275 canmount auto/noauto
2276 devices dev/nodev
2277 exec exec/noexec
2278 readonly ro/rw
2279 relatime relatime/norelatime
2280 setuid suid/nosuid
2281 xattr xattr/noxattr
2282.Ed
2283.Pp
2284In addition, these options can be set on a per-mount basis using the
2285.Fl o
2286option, without affecting the property that is stored on disk.
2287The values specified on the command line override the values stored in the
2288dataset.
2289The
2290.Sy nosuid
2291option is an alias for
d7323e79 2292.Sy nodevices Ns \&, Ns Sy nosetuid .
44f09cdc
BB
2293These properties are reported as
2294.Qq temporary
2295by the
2296.Nm zfs Cm get
2297command.
2298If the properties are changed while the dataset is mounted, the new setting
2299overrides any temporary settings.
2300.Ss "User Properties"
2301In addition to the standard native properties, ZFS supports arbitrary user
2302properties.
2303User properties have no effect on ZFS behavior, but applications or
2304administrators can use them to annotate datasets
2305.Pq file systems, volumes, and snapshots .
2306.Pp
2307User property names must contain a colon
2308.Pq Qq Sy \&:
2309character to distinguish them from native properties.
2310They may contain lowercase letters, numbers, and the following punctuation
2311characters: colon
2312.Pq Qq Sy \&: ,
2313dash
2314.Pq Qq Sy - ,
2315period
2316.Pq Qq Sy \&. ,
2317and underscore
2318.Pq Qq Sy _ .
2319The expected convention is that the property name is divided into two portions
2320such as
d7323e79 2321.Em module Ns \&: Ns Em property ,
44f09cdc
BB
2322but this namespace is not enforced by ZFS.
2323User property names can be at most 256 characters, and cannot begin with a dash
2324.Pq Qq Sy - .
2325.Pp
2326When making programmatic use of user properties, it is strongly suggested to use
2327a reversed
2328.Sy DNS
2329domain name for the
2330.Em module
2331component of property names to reduce the chance that two
2332independently-developed packages use the same property name for different
2333purposes.
2334.Pp
2335The values of user properties are arbitrary strings, are always inherited, and
2336are never validated.
2337All of the commands that operate on properties
2338.Po Nm zfs Cm list ,
2339.Nm zfs Cm get ,
2340.Nm zfs Cm set ,
2341and so forth
2342.Pc
2343can be used to manipulate both native properties and user properties.
2344Use the
2345.Nm zfs Cm inherit
2346command to clear a user property.
2347If the property is not defined in any parent dataset, it is removed entirely.
2348Property values are limited to 8192 bytes.
2349.Ss ZFS Volumes as Swap
2350ZFS volumes may be used as swap devices. After creating the volume with the
2351.Nm zfs Cm create Fl V
2352command set up and enable the swap area using the
2353.Xr mkswap 8
2354and
2355.Xr swapon 8
2356commands. Do not swap to a file on a ZFS file system. A ZFS swap file
2357configuration is not supported.
b5256303
TC
2358.Ss Encryption
2359Enabling the
2360.Sy encryption
2361feature allows for the creation of encrypted filesystems and volumes.
2362.Nm
2363will encrypt all user data including file and zvol data, file attributes,
2364ACLs, permission bits, directory listings, FUID mappings, and userused /
2365groupused data.
2366.Nm
2367will not encrypt metadata related to the pool structure, including dataset
2368names, dataset hierarchy, file size, file holes, and dedup tables. Key rotation
2369is managed internally by the kernel module and changing the user's key does not
2370require re-encrypting the entire dataset. Datasets can be scrubbed, resilvered,
2371renamed, and deleted without the encryption keys being loaded (see the
2372.Nm zfs Cm load-key
2373subcommand for more info on key loading).
2374.Pp
2375Creating an encrypted dataset requires specifying the
2376.Sy encryption
2377and
2378.Sy keyformat
2379properties at creation time, along with an optional
90cdf283 2380.Sy keylocation
b5256303
TC
2381and
2382.Sy pbkdf2iters .
2383After entering an encryption key, the
2384created dataset will become an encryption root. Any descendant datasets will
4807c0ba
TC
2385inherit their encryption key from the encryption root by default, meaning that
2386loading, unloading, or changing the key for the encryption root will implicitly
2387do the same for all inheriting datasets. If this inheritance is not desired,
2388simply supply a
b5256303
TC
2389.Sy keyformat
2390when creating the child dataset or use
2391.Nm zfs Cm change-key
4807c0ba
TC
2392to break an existing relationship, creating a new encryption root on the child.
2393Note that the child's
2394.Sy keyformat
2395may match that of the parent while still creating a new encryption root, and
2396that changing the
2397.Sy encryption
2398property alone does not create a new encryption root; this would simply use a
2399different cipher suite with the same key as its encryption root. The one
2400exception is that clones will always use their origin's encryption key.
2401As a result of this exception, some encryption-related properties (namely
2402.Sy keystatus ,
2403.Sy keyformat ,
2404.Sy keylocation ,
2405and
2406.Sy pbkdf2iters )
2407do not inherit like other ZFS properties and instead use the value determined
2408by their encryption root. Encryption root inheritance can be tracked via the
2409read-only
b5256303
TC
2410.Sy encryptionroot
2411property.
2412.Pp
2413Encryption changes the behavior of a few
2414.Nm
2415operations. Encryption is applied after compression so compression ratios are
2416preserved. Normally checksums in ZFS are 256 bits long, but for encrypted data
2417the checksum is 128 bits of the user-chosen checksum and 128 bits of MAC from
2418the encryption suite, which provides additional protection against maliciously
2419altered data. Deduplication is still possible with encryption enabled but for
2420security, datasets will only dedup against themselves, their snapshots, and
2421their clones.
2422.Pp
2423There are a few limitations on encrypted datasets. Encrypted data cannot be
2424embedded via the
2425.Sy embedded_data
2426feature. Encrypted datasets may not have
2427.Sy copies Ns = Ns Em 3
2428since the implementation stores some encryption metadata where the third copy
2429would normally be. Since compression is applied before encryption datasets may
2430be vulnerable to a CRIME-like attack if applications accessing the data allow
2431for it. Deduplication with encryption will leak information about which blocks
2432are equivalent in a dataset and will incur an extra CPU cost per block written.
44f09cdc
BB
2433.Sh SUBCOMMANDS
2434All subcommands that modify state are logged persistently to the pool in their
2435original form.
2436.Bl -tag -width ""
2437.It Nm Fl ?
058ac9ba 2438Displays a help message.
44f09cdc
BB
2439.It Xo
2440.Nm
2441.Cm create
2442.Op Fl p
2443.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2444.Ar filesystem
2445.Xc
2446Creates a new ZFS file system.
2447The file system is automatically mounted according to the
2448.Sy mountpoint
2449property inherited from the parent.
2450.Bl -tag -width "-o"
2451.It Fl o Ar property Ns = Ns Ar value
2452Sets the specified property as if the command
2453.Nm zfs Cm set Ar property Ns = Ns Ar value
2454was invoked at the same time the dataset was created.
2455Any editable ZFS property can also be set at creation time.
2456Multiple
2457.Fl o
2458options can be specified.
2459An error results if the same property is specified in multiple
2460.Fl o
2461options.
2462.It Fl p
2463Creates all the non-existing parent datasets.
2464Datasets created in this manner are automatically mounted according to the
2465.Sy mountpoint
2466property inherited from their parent.
2467Any property specified on the command line using the
2468.Fl o
2469option is ignored.
2470If the target filesystem already exists, the operation completes successfully.
2471.El
2472.It Xo
2473.Nm
2474.Cm create
2475.Op Fl ps
2476.Op Fl b Ar blocksize
2477.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2478.Fl V Ar size Ar volume
2479.Xc
2480Creates a volume of the given size.
2481The volume is exported as a block device in
2482.Pa /dev/zvol/path ,
2483where
2484.Em path
2485is the name of the volume in the ZFS namespace.
2486The size represents the logical size as exported by the device.
2487By default, a reservation of equal size is created.
2488.Pp
2489.Ar size
2490is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
2491has an integral number of blocks regardless of
2492.Sy blocksize .
2493.Bl -tag -width "-b"
2494.It Fl b Ar blocksize
2495Equivalent to
2496.Fl o Sy volblocksize Ns = Ns Ar blocksize .
2497If this option is specified in conjunction with
2498.Fl o Sy volblocksize ,
2499the resulting behavior is undefined.
2500.It Fl o Ar property Ns = Ns Ar value
2501Sets the specified property as if the
2502.Nm zfs Cm set Ar property Ns = Ns Ar value
2503command was invoked at the same time the dataset was created.
2504Any editable ZFS property can also be set at creation time.
2505Multiple
2506.Fl o
2507options can be specified.
2508An error results if the same property is specified in multiple
2509.Fl o
2510options.
2511.It Fl p
2512Creates all the non-existing parent datasets.
2513Datasets created in this manner are automatically mounted according to the
2514.Sy mountpoint
2515property inherited from their parent.
2516Any property specified on the command line using the
2517.Fl o
2518option is ignored.
2519If the target filesystem already exists, the operation completes successfully.
2520.It Fl s
2521Creates a sparse volume with no reservation.
2522See
2523.Sy volsize
2524in the
2525.Sx Native Properties
2526section for more information about sparse volumes.
2527.El
2528.It Xo
2529.Nm
2530.Cm destroy
2531.Op Fl Rfnprv
2532.Ar filesystem Ns | Ns Ar volume
2533.Xc
2534Destroys the given dataset.
2535By default, the command unshares any file systems that are currently shared,
2536unmounts any file systems that are currently mounted, and refuses to destroy a
2537dataset that has active dependents
2538.Pq children or clones .
2539.Bl -tag -width "-R"
2540.It Fl R
2541Recursively destroy all dependents, including cloned file systems outside the
2542target hierarchy.
2543.It Fl f
2544Force an unmount of any file systems using the
2545.Nm unmount Fl f
2546command.
2547This option has no effect on non-file systems or unmounted file systems.
2548.It Fl n
2549Do a dry-run
2550.Pq Qq No-op
2551deletion.
2552No data will be deleted.
2553This is useful in conjunction with the
2554.Fl v
2555or
2556.Fl p
2557flags to determine what data would be deleted.
2558.It Fl p
330d06f9 2559Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2560.It Fl r
2561Recursively destroy all children.
2562.It Fl v
330d06f9 2563Print verbose information about the deleted data.
44f09cdc
BB
2564.El
2565.Pp
2566Extreme care should be taken when applying either the
2567.Fl r
2568or the
2569.Fl R
2570options, as they can destroy large portions of a pool and cause unexpected
2571behavior for mounted file systems in use.
2572.It Xo
2573.Nm
2574.Cm destroy
2575.Op Fl Rdnprv
2576.Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
2577.Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
2578.Xc
2579The given snapshots are destroyed immediately if and only if the
2580.Nm zfs Cm destroy
2581command without the
2582.Fl d
2583option would have destroyed it.
2584Such immediate destruction would occur, for example, if the snapshot had no
2585clones and the user-initiated reference count were zero.
2586.Pp
2587If a snapshot does not qualify for immediate destruction, it is marked for
2588deferred deletion.
2589In this state, it exists as a usable, visible snapshot until both of the
2590preconditions listed above are met, at which point it is destroyed.
2591.Pp
2592An inclusive range of snapshots may be specified by separating the first and
2593last snapshots with a percent sign.
330d06f9
MA
2594The first and/or last snapshots may be left blank, in which case the
2595filesystem's oldest or newest snapshot will be implied.
44f09cdc 2596.Pp
330d06f9 2597Multiple snapshots
44f09cdc
BB
2598.Pq or ranges of snapshots
2599of the same filesystem or volume may be specified in a comma-separated list of
2600snapshots.
2601Only the snapshot's short name
2602.Po the part after the
2603.Sy @
2604.Pc
2605should be specified when using a range or comma-separated list to identify
2606multiple snapshots.
2607.Bl -tag -width "-R"
2608.It Fl R
13fe0198 2609Recursively destroy all clones of these snapshots, including the clones,
44f09cdc
BB
2610snapshots, and children.
2611If this flag is specified, the
2612.Fl d
2613flag will have no effect.
2614.It Fl d
83362e8e
PZ
2615Destroy immediately. If a snapshot cannot be destroyed now, mark it for
2616deferred destruction.
44f09cdc
BB
2617.It Fl n
2618Do a dry-run
2619.Pq Qq No-op
2620deletion.
2621No data will be deleted.
2622This is useful in conjunction with the
2623.Fl p
2624or
2625.Fl v
2626flags to determine what data would be deleted.
2627.It Fl p
330d06f9 2628Print machine-parsable verbose information about the deleted data.
44f09cdc
BB
2629.It Fl r
2630Destroy
2631.Pq or mark for deferred deletion
2632all snapshots with this name in descendent file systems.
2633.It Fl v
330d06f9 2634Print verbose information about the deleted data.
44f09cdc
BB
2635.Pp
2636Extreme care should be taken when applying either the
2637.Fl r
2638or the
2639.Fl R
330d06f9
MA
2640options, as they can destroy large portions of a pool and cause unexpected
2641behavior for mounted file systems in use.
44f09cdc
BB
2642.El
2643.It Xo
2644.Nm
2645.Cm destroy
2646.Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2647.Xc
da536844 2648The given bookmark is destroyed.
44f09cdc
BB
2649.It Xo
2650.Nm
2651.Cm snapshot
2652.Op Fl r
63f88c12 2653.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
44f09cdc
BB
2654.Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2655.Xc
2656Creates snapshots with the given names.
2657All previous modifications by successful system calls to the file system are
2658part of the snapshots.
2659Snapshots are taken atomically, so that all snapshots correspond to the same
2660moment in time.
63f88c12 2661.Nm zfs Cm snap
2662can be used as an alias for
2663.Nm zfs Cm snapshot.
44f09cdc
BB
2664See the
2665.Sx Snapshots
2666section for details.
2667.Bl -tag -width "-o"
2668.It Fl o Ar property Ns = Ns Ar value
2669Sets the specified property; see
2670.Nm zfs Cm create
2671for details.
2672.It Fl r
2673Recursively create snapshots of all descendent datasets
2674.El
2675.It Xo
2676.Nm
2677.Cm rollback
2678.Op Fl Rfr
2679.Ar snapshot
2680.Xc
2681Roll back the given dataset to a previous snapshot.
2682When a dataset is rolled back, all data that has changed since the snapshot is
2683discarded, and the dataset reverts to the state at the time of the snapshot.
2684By default, the command refuses to roll back to a snapshot other than the most
2685recent one.
2686In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2687specifying the
2688.Fl r
2689option.
2690.Pp
2691The
2692.Fl rR
2693options do not recursively destroy the child snapshots of a recursive snapshot.
2694Only direct snapshots of the specified filesystem are destroyed by either of
2695these options.
2696To completely roll back a recursive snapshot, you must rollback the individual
2697child snapshots.
2698.Bl -tag -width "-R"
2699.It Fl R
2700Destroy any more recent snapshots and bookmarks, as well as any clones of those
2701snapshots.
2702.It Fl f
2703Used with the
2704.Fl R
2705option to force an unmount of any clone file systems that are to be destroyed.
2706.It Fl r
da536844 2707Destroy any snapshots and bookmarks more recent than the one specified.
44f09cdc
BB
2708.El
2709.It Xo
2710.Nm
2711.Cm clone
2712.Op Fl p
2713.Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2714.Ar snapshot Ar filesystem Ns | Ns Ar volume
2715.Xc
2716Creates a clone of the given snapshot.
2717See the
2718.Sx Clones
2719section for details.
2720The target dataset can be located anywhere in the ZFS hierarchy, and is created
2721as the same type as the original.
2722.Bl -tag -width "-o"
2723.It Fl o Ar property Ns = Ns Ar value
2724Sets the specified property; see
2725.Nm zfs Cm create
2726for details.
2727.It Fl p
2728Creates all the non-existing parent datasets.
2729Datasets created in this manner are automatically mounted according to the
2730.Sy mountpoint
2731property inherited from their parent.
2732If the target filesystem or volume already exists, the operation completes
2733successfully.
2734.El
2735.It Xo
2736.Nm
2737.Cm promote
2738.Ar clone-filesystem
2739.Xc
2740Promotes a clone file system to no longer be dependent on its
2741.Qq origin
2742snapshot.
2743This makes it possible to destroy the file system that the clone was created
2744from.
2745The clone parent-child dependency relationship is reversed, so that the origin
2746file system becomes a clone of the specified file system.
2747.Pp
2748The snapshot that was cloned, and any snapshots previous to this snapshot, are
2749now owned by the promoted clone.
2750The space they use moves from the origin file system to the promoted clone, so
2751enough space must be available to accommodate these snapshots.
2752No new space is consumed by this operation, but the space accounting is
2753adjusted.
2754The promoted clone must not have any conflicting snapshot names of its own.
2755The
2756.Cm rename
2757subcommand can be used to rename any conflicting snapshots.
2758.It Xo
2759.Nm
2760.Cm rename
2761.Op Fl f
2762.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2763.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2764.Xc
2765.It Xo
2766.Nm
2767.Cm rename
2768.Op Fl fp
2769.Ar filesystem Ns | Ns Ar volume
2770.Ar filesystem Ns | Ns Ar volume
2771.Xc
2772Renames the given dataset.
2773The new target can be located anywhere in the ZFS hierarchy, with the exception
2774of snapshots.
2775Snapshots can only be renamed within the parent file system or volume.
2776When renaming a snapshot, the parent file system of the snapshot does not need
2777to be specified as part of the second argument.
2778Renamed file systems can inherit new mount points, in which case they are
2779unmounted and remounted at the new mount point.
2780.Bl -tag -width "-a"
2781.It Fl f
db49968e 2782Force unmount any filesystems that need to be unmounted in the process.
44f09cdc
BB
2783.It Fl p
2784Creates all the nonexistent parent datasets.
2785Datasets created in this manner are automatically mounted according to the
2786.Sy mountpoint
2787property inherited from their parent.
2788.El
2789.It Xo
2790.Nm
2791.Cm rename
2792.Fl r
2793.Ar snapshot Ar snapshot
2794.Xc
2795Recursively rename the snapshots of all descendent datasets.
2796Snapshots are the only dataset that can be renamed recursively.
2797.It Xo
2798.Nm
2799.Cm list
2800.Op Fl r Ns | Ns Fl d Ar depth
2801.Op Fl Hp
2802.Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2803.Oo Fl s Ar property Oc Ns ...
2804.Oo Fl S Ar property Oc Ns ...
2805.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2806.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2807.Xc
2808Lists the property information for the given datasets in tabular form.
2809If specified, you can list property information by the absolute pathname or the
2810relative pathname.
2811By default, all file systems and volumes are displayed.
2812Snapshots are displayed if the
2813.Sy listsnaps
2814property is
2815.Sy on
2816.Po the default is
2817.Sy off
2818.Pc .
7106b236
AR
2819The following fields are displayed:
2820.Sy name Ns \&, Sy used Ns \&, Sy available Ns \&, Sy referenced Ns \&, Sy mountpoint Ns .
44f09cdc
BB
2821.Bl -tag -width "-H"
2822.It Fl H
2823Used for scripting mode.
2824Do not print headers and separate fields by a single tab instead of arbitrary
2825white space.
2826.It Fl S Ar property
2827Same as the
2828.Fl s
2829option, but sorts by property in descending order.
2830.It Fl d Ar depth
2831Recursively display any children of the dataset, limiting the recursion to
2832.Ar depth .
2833A
2834.Ar depth
2835of
2836.Sy 1
2837will display only the dataset and its direct children.
2838.It Fl o Ar property
2839A comma-separated list of properties to display.
2840The property must be:
2841.Bl -bullet
2842.It
2843One of the properties described in the
2844.Sx Native Properties
2845section
2846.It
058ac9ba 2847A user property
44f09cdc
BB
2848.It
2849The value
2850.Sy name
2851to display the dataset name
2852.It
2853The value
2854.Sy space
2855to display space usage properties on file systems and volumes.
2856This is a shortcut for specifying
d7323e79
GDN
2857.Fl o Sy name Ns \&, Ns Sy avail Ns \&, Ns Sy used Ns \&, Ns Sy usedsnap Ns \&, Ns
2858.Sy usedds Ns \&, Ns Sy usedrefreserv Ns \&, Ns Sy usedchild Fl t
2859.Sy filesystem Ns \&, Ns Sy volume
44f09cdc
BB
2860syntax.
2861.El
2862.It Fl p
2863Display numbers in parsable
2864.Pq exact
2865values.
2866.It Fl r
2867Recursively display any children of the dataset on the command line.
2868.It Fl s Ar property
2869A property for sorting the output by column in ascending order based on the
2870value of the property.
2871The property must be one of the properties described in the
2872.Sx Properties
2873section, or the special value
2874.Sy name
2875to sort by the dataset name.
2876Multiple properties can be specified at one time using multiple
2877.Fl s
2878property options.
2879Multiple
2880.Fl s
2881options are evaluated from left to right in decreasing order of importance.
058ac9ba 2882The following is a list of sorting criteria:
44f09cdc
BB
2883.Bl -bullet
2884.It
058ac9ba 2885Numeric types sort in numeric order.
44f09cdc 2886.It
058ac9ba 2887String types sort in alphabetical order.
44f09cdc
BB
2888.It
2889Types inappropriate for a row sort that row to the literal bottom, regardless of
2890the specified ordering.
2891.El
2892.Pp
2893If no sorting options are specified the existing behavior of
2894.Nm zfs Cm list
2895is preserved.
2896.It Fl t Ar type
2897A comma-separated list of types to display, where
2898.Ar type
2899is one of
2900.Sy filesystem ,
2901.Sy snapshot ,
2902.Sy volume ,
2903.Sy bookmark ,
2904or
2905.Sy all .
2906For example, specifying
2907.Fl t Sy snapshot
2908displays only snapshots.
2909.El
2910.It Xo
2911.Nm
2912.Cm set
2913.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2914.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2915.Xc
23de906c 2916Sets the property or list of properties to the given value(s) for each dataset.
44f09cdc
BB
2917Only some properties can be edited.
2918See the
2919.Sx Properties
2920section for more information on what properties can be set and acceptable
2921values.
2922Numeric values can be specified as exact values, or in a human-readable form
2923with a suffix of
2924.Sy B , K , M , G , T , P , E , Z
2925.Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2926or zettabytes, respectively
2927.Pc .
2928User properties can be set on snapshots.
2929For more information, see the
2930.Sx User Properties
2931section.
2932.It Xo
2933.Nm
2934.Cm get
2935.Op Fl r Ns | Ns Fl d Ar depth
2936.Op Fl Hp
2937.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2938.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2939.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2940.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
48b0b649 2941.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns ...
44f09cdc
BB
2942.Xc
2943Displays properties for the given datasets.
2944If no datasets are specified, then the command displays properties for all
2945datasets on the system.
2946For each property, the following columns are displayed:
2947.Bd -literal
058ac9ba 2948 name Dataset name
44f09cdc
BB
2949 property Property name
2950 value Property value
bd9c1958
CS
2951 source Property source \fBlocal\fP, \fBdefault\fP, \fBinherited\fP,
2952 \fBtemporary\fP, \fBreceived\fP or none (\fB-\fP).
44f09cdc
BB
2953.Ed
2954.Pp
2955All columns are displayed by default, though this can be controlled by using the
2956.Fl o
2957option.
2958This command takes a comma-separated list of properties as described in the
2959.Sx Native Properties
2960and
2961.Sx User Properties
2962sections.
2963.Pp
2964The special value
2965.Sy all
2966can be used to display all properties that apply to the given dataset's type
2967.Pq filesystem, volume, snapshot, or bookmark .
2968.Bl -tag -width "-H"
2969.It Fl H
2970Display output in a form more easily parsed by scripts.
2971Any headers are omitted, and fields are explicitly separated by a single tab
2972instead of an arbitrary amount of space.
2973.It Fl d Ar depth
2974Recursively display any children of the dataset, limiting the recursion to
2975.Ar depth .
2976A depth of
2977.Sy 1
2978will display only the dataset and its direct children.
2979.It Fl o Ar field
2980A comma-separated list of columns to display.
d7323e79 2981.Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
44f09cdc
BB
2982is the default value.
2983.It Fl p
2984Display numbers in parsable
2985.Pq exact
2986values.
2987.It Fl r
058ac9ba 2988Recursively display properties for any children.
44f09cdc
BB
2989.It Fl s Ar source
2990A comma-separated list of sources to display.
2991Those properties coming from a source other than those in this list are ignored.
2992Each source must be one of the following:
2993.Sy local ,
2994.Sy default ,
2995.Sy inherited ,
2996.Sy temporary ,
bd9c1958 2997.Sy received ,
44f09cdc
BB
2998and
2999.Sy none .
3000The default value is all sources.
3001.It Fl t Ar type
3002A comma-separated list of types to display, where
3003.Ar type
3004is one of
3005.Sy filesystem ,
3006.Sy snapshot ,
3007.Sy volume ,
3008.Sy bookmark ,
3009or
3010.Sy all .
3011.El
3012.It Xo
3013.Nm
3014.Cm inherit
3015.Op Fl rS
3016.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
3017.Xc
3018Clears the specified property, causing it to be inherited from an ancestor,
3019restored to default if no ancestor has the property set, or with the
3020.Fl S
3021option reverted to the received value if one exists.
3022See the
3023.Sx Properties
3024section for a listing of default values, and details on which properties can be
3025inherited.
3026.Bl -tag -width "-r"
3027.It Fl r
058ac9ba 3028Recursively inherit the given property for all children.
44f09cdc 3029.It Fl S
0bf8501a 3030Revert the property to the received value if one exists; otherwise operate as
44f09cdc
BB
3031if the
3032.Fl S
3033option was not specified.
3034.El
3035.It Xo
3036.Nm
3037.Cm upgrade
3038.Xc
058ac9ba 3039Displays a list of file systems that are not the most recent version.
44f09cdc
BB
3040.It Xo
3041.Nm
3042.Cm upgrade
3043.Fl v
3044.Xc
3045Displays a list of currently supported file system versions.
3046.It Xo
3047.Nm
3048.Cm upgrade
3049.Op Fl r
3050.Op Fl V Ar version
3051.Fl a | Ar filesystem
3052.Xc
3053Upgrades file systems to a new on-disk version.
3054Once this is done, the file systems will no longer be accessible on systems
3055running older versions of the software.
3056.Nm zfs Cm send
3057streams generated from new snapshots of these file systems cannot be accessed on
3058systems running older versions of the software.
3059.Pp
3060In general, the file system version is independent of the pool version.
3061See
3062.Xr zpool 8
3063for information on the
3064.Nm zpool Cm upgrade
3065command.
3066.Pp
3067In some cases, the file system version and the pool version are interrelated and
3068the pool version must be upgraded before the file system version can be
3069upgraded.
3070.Bl -tag -width "-V"
3071.It Fl V Ar version
3072Upgrade to the specified
3073.Ar version .
3074If the
3075.Fl V
3076flag is not specified, this command upgrades to the most recent version.
3077This
3078option can only be used to increase the version number, and only up to the most
3079recent version supported by this software.
3080.It Fl a
3081Upgrade all file systems on all imported pools.
3082.It Ar filesystem
3083Upgrade the specified file system.
3084.It Fl r
3085Upgrade the specified file system and all descendent file systems.
3086.El
3087.It Xo
3088.Nm
3089.Cm userspace
3090.Op Fl Hinp
3091.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3092.Oo Fl s Ar field Oc Ns ...
3093.Oo Fl S Ar field Oc Ns ...
3094.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3095.Ar filesystem Ns | Ns Ar snapshot
3096.Xc
3097Displays space consumed by, and quotas on, each user in the specified filesystem
3098or snapshot.
3099This corresponds to the
3100.Sy userused@ Ns Em user ,
3101.Sy userobjused@ Ns Em user ,
3102.Sy userquota@ Ns Em user,
3103and
3104.Sy userobjquota@ Ns Em user
3105properties.
3106.Bl -tag -width "-H"
3107.It Fl H
3108Do not print headers, use tab-delimited output.
3109.It Fl S Ar field
3110Sort by this field in reverse order.
3111See
3112.Fl s .
3113.It Fl i
3114Translate SID to POSIX ID.
3115The POSIX ID may be ephemeral if no mapping exists.
3116Normal POSIX interfaces
3117.Po for example,
3118.Xr stat 2 ,
3119.Nm ls Fl l
3120.Pc
3121perform this translation, so the
3122.Fl i
3123option allows the output from
3124.Nm zfs Cm userspace
3125to be compared directly with those utilities.
3126However,
3127.Fl i
5990da81 3128may lead to confusion if some files were created by an SMB user before a
44f09cdc
BB
3129SMB-to-POSIX name mapping was established.
3130In such a case, some files will be owned by the SMB entity and some by the POSIX
3131entity.
3132However, the
3133.Fl i
3134option will report that the POSIX entity has the total usage and quota for both.
3135.It Fl n
3136Print numeric ID instead of user/group name.
3137.It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
3138Display only the specified fields from the following set:
3139.Sy type ,
3140.Sy name ,
3141.Sy used ,
3142.Sy quota .
3143The default is to display all fields.
3144.It Fl p
3145Use exact
3146.Pq parsable
3147numeric output.
3148.It Fl s Ar field
3149Sort output by this field.
3150The
3151.Fl s
3152and
3153.Fl S
3154flags may be specified multiple times to sort first by one field, then by
3155another.
3156The default is
3157.Fl s Sy type Fl s Sy name .
3158.It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
3159Print only the specified types from the following set:
3160.Sy all ,
3161.Sy posixuser ,
3162.Sy smbuser ,
3163.Sy posixgroup ,
3164.Sy smbgroup .
3165The default is
d7323e79 3166.Fl t Sy posixuser Ns \&, Ns Sy smbuser .
44f09cdc
BB
3167The default can be changed to include group types.
3168.El
3169.It Xo
3170.Nm
3171.Cm groupspace
3172.Op Fl Hinp
3173.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3174.Oo Fl s Ar field Oc Ns ...
3175.Oo Fl S Ar field Oc Ns ...
3176.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3177.Ar filesystem Ns | Ns Ar snapshot
3178.Xc
5990da81 3179Displays space consumed by, and quotas on, each group in the specified
44f09cdc
BB
3180filesystem or snapshot.
3181This subcommand is identical to
3182.Nm zfs Cm userspace ,
3183except that the default types to display are
d7323e79 3184.Fl t Sy posixgroup Ns \&, Ns Sy smbgroup .
44f09cdc
BB
3185.It Xo
3186.Nm
9c5167d1
NF
3187.Cm projectspace
3188.Op Fl Hp
3189.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3190.Oo Fl s Ar field Oc Ns ...
3191.Oo Fl S Ar field Oc Ns ...
3192.Ar filesystem Ns | Ns Ar snapshot
3193.Xc
3194Displays space consumed by, and quotas on, each project in the specified
3195filesystem or snapshot. This subcommand is identical to
3196.Nm zfs Cm userspace ,
3197except that the project identifier is numeral, not name. So need neither
3198the option
3199.Sy -i
3200for SID to POSIX ID nor
3201.Sy -n
3202for numeric ID, nor
3203.Sy -t
3204for types.
3205.It Xo
3206.Nm
3207.Cm project
3208.Oo Fl d Ns | Ns Fl r Ns Oc
3209.Ar file Ns | Ns Ar directory Ns ...
3210.Xc
3211List project identifier (ID) and inherit flag of file(s) or directories.
3212.Bl -tag -width "-d"
3213.It Fl d
3214Show the directory project ID and inherit flag, not its childrens. It will
3215overwrite the former specified
3216.Fl r
3217option.
3218.It Fl r
3219Show on subdirectories recursively. It will overwrite the former specified
3220.Fl d
3221option.
3222.El
3223.It Xo
3224.Nm
3225.Cm project
3226.Fl C
3227.Oo Fl kr Ns Oc
3228.Ar file Ns | Ns Ar directory Ns ...
3229.Xc
3230Clear project inherit flag and/or ID on the file(s) or directories.
3231.Bl -tag -width "-k"
3232.It Fl k
3233Keep the project ID unchanged. If not specified, the project ID will be reset
3234as zero.
3235.It Fl r
3236Clear on subdirectories recursively.
3237.El
3238.It Xo
3239.Nm
3240.Cm project
3241.Fl c
3242.Oo Fl 0 Ns Oc
3243.Oo Fl d Ns | Ns Fl r Ns Oc
3244.Op Fl p Ar id
3245.Ar file Ns | Ns Ar directory Ns ...
3246.Xc
3247Check project ID and inherit flag on the file(s) or directories, report the
3248entries without project inherit flag or with different project IDs from the
3249specified (via
3250.Fl p
3251option) value or the target directory's project ID.
3252.Bl -tag -width "-0"
3253.It Fl 0
3254Print file name with a trailing NUL instead of newline (by default), like
3255"find -print0".
3256.It Fl d
3257Check the directory project ID and inherit flag, not its childrens. It will
3258overwrite the former specified
3259.Fl r
3260option.
3261.It Fl p
3262Specify the referenced ID for comparing with the target file(s) or directories'
3263project IDs. If not specified, the target (top) directory's project ID will be
3264used as the referenced one.
3265.It Fl r
3266Check on subdirectories recursively. It will overwrite the former specified
3267.Fl d
3268option.
3269.El
3270.It Xo
3271.Nm
3272.Cm project
3273.Op Fl p Ar id
3274.Oo Fl rs Ns Oc
3275.Ar file Ns | Ns Ar directory Ns ...
3276.Xc
3277.Bl -tag -width "-p"
3278Set project ID and/or inherit flag on the file(s) or directories.
3279.It Fl p
3280Set the file(s)' or directories' project ID with the given value.
3281.It Fl r
3282Set on subdirectories recursively.
3283.It Fl s
3284Set project inherit flag on the given file(s) or directories. It is usually used
3285for setup tree quota on the directory target with
3286.Fl r
3287option specified together. When setup tree quota, by default the directory's
3288project ID will be set to all its descendants unless you specify the project
3289ID via
3290.Fl p
3291option explicitly.
3292.El
3293.It Xo
3294.Nm
44f09cdc
BB
3295.Cm mount
3296.Xc
3297Displays all ZFS file systems currently mounted.
3298.It Xo
3299.Nm
3300.Cm mount
b5256303 3301.Op Fl Olv
44f09cdc
BB
3302.Op Fl o Ar options
3303.Fl a | Ar filesystem
3304.Xc
3305Mounts ZFS file systems.
3306.Bl -tag -width "-O"
3307.It Fl O
3308Perform an overlay mount.
3309See
3310.Xr mount 8
3311for more information.
3312.It Fl a
3313Mount all available ZFS file systems.
3314Invoked automatically as part of the boot process.
3315.It Ar filesystem
058ac9ba 3316Mount the specified filesystem.
44f09cdc
BB
3317.It Fl o Ar options
3318An optional, comma-separated list of mount options to use temporarily for the
3319duration of the mount.
3320See the
3321.Sx Temporary Mount Point Properties
3322section for details.
b5256303
TC
3323.It Fl l
3324Load keys for encrypted filesystems as they are being mounted. This is
3325equivalent to executing
3326.Nm zfs Cm load-key
3327on each encryption root before mounting it. Note that if a filesystem has a
3328.Sy keylocation
3329of
3330.Sy prompt
3331this will cause the terminal to interactively block after asking for the key.
44f09cdc
BB
3332.It Fl v
3333Report mount progress.
3334.El
3335.It Xo
3336.Nm
3337.Cm unmount
3338.Op Fl f
3339.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3340.Xc
3341Unmounts currently mounted ZFS file systems.
3342.Bl -tag -width "-a"
3343.It Fl a
3344Unmount all available ZFS file systems.
3345Invoked automatically as part of the shutdown process.
3346.It Ar filesystem Ns | Ns Ar mountpoint
3347Unmount the specified filesystem.
3348The command can also be given a path to a ZFS file system mount point on the
3349system.
3350.It Fl f
058ac9ba 3351Forcefully unmount the file system, even if it is currently in use.
44f09cdc
BB
3352.El
3353.It Xo
3354.Nm
3355.Cm share
3356.Fl a | Ar filesystem
3357.Xc
3358Shares available ZFS file systems.
3359.Bl -tag -width "-a"
3360.It Fl a
3361Share all available ZFS file systems.
3362Invoked automatically as part of the boot process.
3363.It Ar filesystem
3364Share the specified filesystem according to the
3365.Sy sharenfs
3366and
3367.Sy sharesmb
3368properties.
3369File systems are shared when the
3370.Sy sharenfs
3371or
3372.Sy sharesmb
3373property is set.
3374.El
3375.It Xo
3376.Nm
3377.Cm unshare
3378.Fl a | Ar filesystem Ns | Ns Ar mountpoint
3379.Xc
3380Unshares currently shared ZFS file systems.
3381.Bl -tag -width "-a"
3382.It Fl a
3383Unshare all available ZFS file systems.
3384Invoked automatically as part of the shutdown process.
3385.It Ar filesystem Ns | Ns Ar mountpoint
3386Unshare the specified filesystem.
3387The command can also be given a path to a ZFS file system shared on the system.
3388.El
3389.It Xo
3390.Nm
3391.Cm bookmark
3392.Ar snapshot bookmark
3393.Xc
3394Creates a bookmark of the given snapshot.
3395Bookmarks mark the point in time when the snapshot was created, and can be used
3396as the incremental source for a
3397.Nm zfs Cm send
3398command.
3399.Pp
da536844 3400This feature must be enabled to be used.
44f09cdc
BB
3401See
3402.Xr zpool-features 5
3403for details on ZFS feature flags and the
3404.Sy bookmarks
3405feature.
3406.It Xo
3407.Nm
3408.Cm send
faa97c16 3409.Op Fl DLPRbcenpvw
44f09cdc
BB
3410.Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
3411.Ar snapshot
3412.Xc
3413Creates a stream representation of the second
3414.Ar snapshot ,
3415which is written to standard output.
3416The output can be redirected to a file or to a different system
3417.Po for example, using
3418.Xr ssh 1
3419.Pc .
3420By default, a full stream is generated.
3421.Bl -tag -width "-D"
3422.It Fl D, -dedup
3423Generate a deduplicated stream.
3424Blocks which would have been sent multiple times in the send stream will only be
3425sent once.
3426The receiving system must also support this feature to receive a deduplicated
3427stream.
3428This flag can be used regardless of the dataset's
3429.Sy dedup
3430property, but performance will be much better if the filesystem uses a
3431dedup-capable checksum
3432.Po for example,
3433.Sy sha256
3434.Pc .
3435.It Fl I Ar snapshot
3436Generate a stream package that sends all intermediary snapshots from the first
3437snapshot to the second snapshot.
3438For example,
3439.Fl I Em @a Em fs@d
3440is similar to
d7323e79 3441.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
3442The incremental source may be specified as with the
3443.Fl i
3444option.
3445.It Fl L, -large-block
3446Generate a stream which may contain blocks larger than 128KB.
3447This flag has no effect if the
3448.Sy large_blocks
3449pool feature is disabled, or if the
3450.Sy recordsize
3451property of this filesystem has never been set above 128KB.
3452The receiving system must have the
3453.Sy large_blocks
3454pool feature enabled as well.
3455See
3456.Xr zpool-features 5
3457for details on ZFS feature flags and the
3458.Sy large_blocks
3459feature.
3460.It Fl P, -parsable
9566fb1a 3461Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3462.It Fl R, -replicate
3463Generate a replication stream package, which will replicate the specified
3464file system, and all descendent file systems, up to the named snapshot.
3465When received, all properties, snapshots, descendent file systems, and clones
3466are preserved.
3467.Pp
3468If the
3469.Fl i
3470or
3471.Fl I
3472flags are used in conjunction with the
3473.Fl R
3474flag, an incremental replication stream is generated.
3475The current values of properties, and current snapshot and file system names are
3476set when the stream is received.
3477If the
3478.Fl F
3479flag is specified when this stream is received, snapshots and file systems that
3480do not exist on the sending side are destroyed.
3481.It Fl e, -embed
3482Generate a more compact stream by using
3483.Sy WRITE_EMBEDDED
3484records for blocks which are stored more compactly on disk by the
3485.Sy embedded_data
3486pool feature.
3487This flag has no effect if the
3488.Sy embedded_data
3489feature is disabled.
3490The receiving system must have the
3491.Sy embedded_data
3492feature enabled.
3493If the
3494.Sy lz4_compress
3495feature is active on the sending system, then the receiving system must have
4807c0ba
TC
3496that feature enabled as well. Datasets that are sent with this flag may not be
3497received as an encrypted dataset, since encrypted datasets cannot use the
3498.Sy embedded_data
3499feature.
44f09cdc
BB
3500See
3501.Xr zpool-features 5
3502for details on ZFS feature flags and the
3503.Sy embedded_data
3504feature.
faa97c16 3505.It Fl b, -backup
3506Sends only received property values whether or not they are overridden by local
3507settings, but only if the dataset has ever been received. Use this option when
3508you want
3509.Nm zfs Cm receive
3510to restore received properties backed up on the sent dataset and to avoid
3511sending local settings that may have nothing to do with the source dataset,
3512but only with how the data is backed up.
44f09cdc 3513.It Fl c, -compressed
2aa34383 3514Generate a more compact stream by using compressed WRITE records for blocks
44f09cdc
BB
3515which are compressed on disk and in memory
3516.Po see the
3517.Sy compression
3518property for details
3519.Pc .
3520If the
3521.Sy lz4_compress
3522feature is active on the sending system, then the receiving system must have
3523that feature enabled as well.
3524If the
3525.Sy large_blocks
3526feature is enabled on the sending system but the
3527.Fl L
3528option is not supplied in conjunction with
3529.Fl c ,
3530then the data will be decompressed before sending so it can be split into
3531smaller block sizes.
b5256303
TC
3532.It Fl w, -raw
3533For encrypted datasets, send data exactly as it exists on disk. This allows
3534backups to be taken even if encryption keys are not currently loaded. The
3535backup may then be received on an untrusted machine since that machine will
3536not have the encryption keys to read the protected data or alter it without
3537being detected. Upon being received, the dataset will have the same encryption
3538keys as it did on the send side, although the
3539.Sy keylocation
3540property will be defaulted to
3541.Sy prompt
3542if not otherwise provided. For unencrypted datasets, this flag will be
3543equivalent to
3544.Fl Lec .
3545Note that if you do not use this flag for sending encrypted datasets, data will
3546be sent unencrypted and may be re-encrypted with a different encryption key on
3547the receiving system, which will disable the ability to do a raw send to that
3548system for incrementals.
44f09cdc
BB
3549.It Fl i Ar snapshot
3550Generate an incremental stream from the first
3551.Ar snapshot
3552.Pq the incremental source
3553to the second
3554.Ar snapshot
3555.Pq the incremental target .
3556The incremental source can be specified as the last component of the snapshot
3557name
3558.Po the
3559.Sy @
3560character and following
3561.Pc
3562and it is assumed to be from the same file system as the incremental target.
3563.Pp
3564If the destination is a clone, the source may be the origin snapshot, which must
3565be fully specified
3566.Po for example,
3567.Em pool/fs@origin ,
3568not just
3569.Em @origin
3570.Pc .
3571.It Fl n, -dryrun
3572Do a dry-run
3573.Pq Qq No-op
3574send.
3575Do not generate any actual send data.
3576This is useful in conjunction with the
3577.Fl v
3578or
3579.Fl P
3580flags to determine what data will be sent.
3581In this case, the verbose output will be written to standard output
3582.Po contrast with a non-dry-run, where the stream is written to standard output
3583and the verbose output goes to standard error
3584.Pc .
3585.It Fl p, -props
3586Include the dataset's properties in the stream.
3587This flag is implicit when
3588.Fl R
3589is specified.
4807c0ba
TC
3590The receiving system must also support this feature. Sends of encrypted datasets
3591must use
3592.Fl w
3593when using this flag.
44f09cdc
BB
3594.It Fl v, -verbose
3595Print verbose information about the stream package generated.
3596This information includes a per-second report of how much data has been sent.
3597.Pp
3598The format of the stream is committed.
29179568 3599You will be able to receive your streams on future versions of ZFS.
835db585 3600.El
44f09cdc
BB
3601.It Xo
3602.Nm
3603.Cm send
835db585 3604.Op Fl LPcenvw
44f09cdc
BB
3605.Op Fl i Ar snapshot Ns | Ns Ar bookmark
3606.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3607.Xc
3608Generate a send stream, which may be of a filesystem, and may be incremental
3609from a bookmark.
3610If the destination is a filesystem or volume, the pool must be read-only, or the
3611filesystem must not be mounted.
3612When the stream generated from a filesystem or volume is received, the default
3613snapshot name will be
3614.Qq --head-- .
3615.Bl -tag -width "-L"
3616.It Fl L, -large-block
3617Generate a stream which may contain blocks larger than 128KB.
3618This flag has no effect if the
3619.Sy large_blocks
3620pool feature is disabled, or if the
3621.Sy recordsize
3622property of this filesystem has never been set above 128KB.
3623The receiving system must have the
3624.Sy large_blocks
3625pool feature enabled as well.
3626See
3627.Xr zpool-features 5
3628for details on ZFS feature flags and the
3629.Sy large_blocks
3630feature.
835db585 3631.It Fl P, -parsable
3632Print machine-parsable verbose information about the stream package generated.
44f09cdc
BB
3633.It Fl c, -compressed
3634Generate a more compact stream by using compressed WRITE records for blocks
3635which are compressed on disk and in memory
3636.Po see the
3637.Sy compression
3638property for details
3639.Pc .
3640If the
3641.Sy lz4_compress
3642feature is active on the sending system, then the receiving system must have
3643that feature enabled as well.
3644If the
3645.Sy large_blocks
3646feature is enabled on the sending system but the
3647.Fl L
3648option is not supplied in conjunction with
3649.Fl c ,
3650then the data will be decompressed before sending so it can be split into
3651smaller block sizes.
b5256303
TC
3652.It Fl w, -raw
3653For encrypted datasets, send data exactly as it exists on disk. This allows
3654backups to be taken even if encryption keys are not currently loaded. The
3655backup may then be received on an untrusted machine since that machine will
3656not have the encryption keys to read the protected data or alter it without
3657being detected. Upon being received, the dataset will have the same encryption
3658keys as it did on the send side, although the
3659.Sy keylocation
3660property will be defaulted to
3661.Sy prompt
3662if not otherwise provided. For unencrypted datasets, this flag will be
3663equivalent to
3664.Fl Lec .
3665Note that if you do not use this flag for sending encrypted datasets, data will
3666be sent unencrypted and may be re-encrypted with a different encryption key on
3667the receiving system, which will disable the ability to do a raw send to that
3668system for incrementals.
44f09cdc
BB
3669.It Fl e, -embed
3670Generate a more compact stream by using
3671.Sy WRITE_EMBEDDED
3672records for blocks which are stored more compactly on disk by the
3673.Sy embedded_data
3674pool feature.
3675This flag has no effect if the
3676.Sy embedded_data
3677feature is disabled.
3678The receiving system must have the
3679.Sy embedded_data
3680feature enabled.
3681If the
3682.Sy lz4_compress
3683feature is active on the sending system, then the receiving system must have
4807c0ba
TC
3684that feature enabled as well. Datasets that are sent with this flag may not be
3685received as an encrypted dataset, since encrypted datasets cannot use the
3686.Sy embedded_data
3687feature.
44f09cdc
BB
3688See
3689.Xr zpool-features 5
3690for details on ZFS feature flags and the
3691.Sy embedded_data
3692feature.
3693.It Fl i Ar snapshot Ns | Ns Ar bookmark
3694Generate an incremental send stream.
3695The incremental source must be an earlier snapshot in the destination's history.
3696It will commonly be an earlier snapshot in the destination's file system, in
3697which case it can be specified as the last component of the name
3698.Po the
3699.Sy #
3700or
3701.Sy @
3702character and following
3703.Pc .
3704.Pp
3705If the incremental target is a clone, the incremental source can be the origin
3706snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
3707origin, etc.
835db585 3708.It Fl n, -dryrun
3709Do a dry-run
3710.Pq Qq No-op
3711send.
3712Do not generate any actual send data.
3713This is useful in conjunction with the
3714.Fl v
3715or
3716.Fl P
3717flags to determine what data will be sent.
3718In this case, the verbose output will be written to standard output
3719.Po contrast with a non-dry-run, where the stream is written to standard output
3720and the verbose output goes to standard error
3721.Pc .
3722.It Fl v, -verbose
3723Print verbose information about the stream package generated.
3724This information includes a per-second report of how much data has been sent.
44f09cdc
BB
3725.El
3726.It Xo
3727.Nm
3728.Cm send
3729.Op Fl Penv
3730.Fl t
3731.Ar receive_resume_token
3732.Xc
3733Creates a send stream which resumes an interrupted receive.
3734The
3735.Ar receive_resume_token
3736is the value of this property on the filesystem or volume that was being
3737received into.
3738See the documentation for
3739.Sy zfs receive -s
3740for more details.
3741.It Xo
3742.Nm
3743.Cm receive
3744.Op Fl Fnsuv
3745.Op Fl o Sy origin Ns = Ns Ar snapshot
3746.Op Fl o Ar property Ns = Ns Ar value
3747.Op Fl x Ar property
3748.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3749.Xc
3750.It Xo
3751.Nm
3752.Cm receive
3753.Op Fl Fnsuv
3754.Op Fl d Ns | Ns Fl e
3755.Op Fl o Sy origin Ns = Ns Ar snapshot
3756.Op Fl o Ar property Ns = Ns Ar value
3757.Op Fl x Ar property
3758.Ar filesystem
3759.Xc
3760Creates a snapshot whose contents are as specified in the stream provided on
3761standard input.
3762If a full stream is received, then a new file system is created as well.
3763Streams are created using the
3764.Nm zfs Cm send
3765subcommand, which by default creates a full stream.
3766.Nm zfs Cm recv
3767can be used as an alias for
3768.Nm zfs Cm receive.
3769.Pp
3770If an incremental stream is received, then the destination file system must
3771already exist, and its most recent snapshot must match the incremental stream's
3772source.
3773For
3774.Sy zvols ,
3775the destination device link is destroyed and recreated, which means the
3776.Sy zvol
3777cannot be accessed during the
3778.Cm receive
3779operation.
3780.Pp
3781When a snapshot replication package stream that is generated by using the
3782.Nm zfs Cm send Fl R
3783command is received, any snapshots that do not exist on the sending location are
3784destroyed by using the
3785.Nm zfs Cm destroy Fl d
3786command.
3787.Pp
3788If
90cdf283 3789.Fl o Em property Ns = Ns Ar value
44f09cdc 3790or
90cdf283 3791.Fl x Em property
44f09cdc
BB
3792is specified, it applies to the effective value of the property throughout
3793the entire subtree of replicated datasets. Effective property values will be
3794set (
3795.Fl o
3796) or inherited (
3797.Fl x
3798) on the topmost in the replicated subtree. In descendant datasets, if the
3799property is set by the send stream, it will be overridden by forcing the
3800property to be inherited from the top‐most file system. Received properties
3801are retained in spite of being overridden and may be restored with
3802.Nm zfs Cm inherit Fl S .
3803Specifying
90cdf283 3804.Fl o Sy origin Ns = Ns Em snapshot
44f09cdc
BB
3805is a special case because, even if
3806.Sy origin
3807is a read-only property and cannot be set, it's allowed to receive the send
3808stream as a clone of the given snapshot.
3809.Pp
4807c0ba
TC
3810Raw encrypted send streams (created with
3811.Nm zfs Cm send Fl w
3812) may only be received as is, and cannot be re-encrypted, decrypted, or
3813recompressed by the receive process. Unencrypted streams can be received as
3814encrypted datasets, either through inheritance or by specifying encryption
3815parameters with the
3816.Fl o
3817options.
3818.Pp
44f09cdc
BB
3819The name of the snapshot
3820.Pq and file system, if a full stream is received
3821that this subcommand creates depends on the argument type and the use of the
3822.Fl d
3823or
3824.Fl e
3825options.
3826.Pp
3827If the argument is a snapshot name, the specified
3828.Ar snapshot
3829is created.
3830If the argument is a file system or volume name, a snapshot with the same name
3831as the sent snapshot is created within the specified
3832.Ar filesystem
3833or
3834.Ar volume .
3835If neither of the
3836.Fl d
3837or
3838.Fl e
3839options are specified, the provided target snapshot name is used exactly as
3840provided.
3841.Pp
3842The
3843.Fl d
3844and
3845.Fl e
3846options cause the file system name of the target snapshot to be determined by
3847appending a portion of the sent snapshot's name to the specified target
3848.Ar filesystem .
3849If the
3850.Fl d
3851option is specified, all but the first element of the sent snapshot's file
3852system path
3853.Pq usually the pool name
3854is used and any required intermediate file systems within the specified one are
3855created.
3856If the
3857.Fl e
3858option is specified, then only the last element of the sent snapshot's file
3859system name
3860.Pq i.e. the name of the source file system itself
3861is used as the target file system name.
3862.Bl -tag -width "-F"
3863.It Fl F
3864Force a rollback of the file system to the most recent snapshot before
3865performing the receive operation.
3866If receiving an incremental replication stream
3867.Po for example, one generated by
3868.Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3869.Pc ,
3870destroy snapshots and file systems that do not exist on the sending side.
3871.It Fl d
3872Discard the first element of the sent snapshot's file system name, using the
3873remaining elements to determine the name of the target file system for the new
3874snapshot as described in the paragraph above.
3875.It Fl e
3876Discard all but the last element of the sent snapshot's file system name, using
3877that element to determine the name of the target file system for the new
3878snapshot as described in the paragraph above.
3879.It Fl n
3880Do not actually receive the stream.
3881This can be useful in conjunction with the
3882.Fl v
3883option to verify the name the receive operation would use.
3884.It Fl o Sy origin Ns = Ns Ar snapshot
e6d3a843
PD
3885Forces the stream to be received as a clone of the given snapshot.
3886If the stream is a full send stream, this will create the filesystem
44f09cdc
BB
3887described by the stream as a clone of the specified snapshot.
3888Which snapshot was specified will not affect the success or failure of the
3889receive, as long as the snapshot does exist.
3890If the stream is an incremental send stream, all the normal verification will be
3891performed.
90cdf283 3892.It Fl o Em property Ns = Ns Ar value
44f09cdc 3893Sets the specified property as if the command
90cdf283 3894.Nm zfs Cm set Em property Ns = Ns Ar value
44f09cdc
BB
3895was invoked immediately before the receive. When receiving a stream from
3896.Nm zfs Cm send Fl R ,
3897causes the property to be inherited by all descendant datasets, as through
3898.Nm zfs Cm inherit Em property
3899was run on any descendant datasets that have this property set on the
3900sending system.
3901.Pp
3902Any editable property can be set at receive time. Set-once properties bound
3903to the received data, such as
3904.Sy normalization
3905and
3906.Sy casesensitivity ,
3907cannot be set at receive time even when the datasets are newly created by
3908.Nm zfs Cm receive .
3909Additionally both settable properties
3910.Sy version
3911and
3912.Sy volsize
3913cannot be set at receive time.
3914.Pp
3915The
3916.Fl o
3917option may be specified multiple times, for different properties. An error
3918results if the same property is specified in multiple
3919.Fl o
3920or
3921.Fl x
3922options.
d9c460a0
TC
3923.Pp
3924The
3925.Fl o
3926option may also be used to override encryption properties upon initial
3927receive. This allows unencrypted streams to be received as encrypted datasets.
3928To cause the received dataset (or root dataset of a recursive stream) to be
3929received as an encryption root, specify encryption properties in the same
3930manner as is required for
3931.Nm
3932.Cm create .
3933For instance:
3934.Bd -literal
3935# zfs send tank/test@snap1 | zfs recv -o encryption=on -o keyformat=passphrase -o keylocation=file:///path/to/keyfile
3936.Ed
3937.Pp
3938Note that
3939.Op Fl o Ar keylocation Ns = Ns Ar prompt
3940may not be specified here, since stdin is already being utilized for the send
3941stream. Once the receive has completed, you can use
3942.Nm
3943.Cm set
3944to change this setting after the fact. Similarly, you can receive a dataset as
3945an encrypted child by specifying
3946.Op Fl x Ar encryption
3947to force the property to be inherited. Overriding encryption properties (except
3948for
3949.Sy keylocation Ns )
3950is not possible with raw send streams.
44f09cdc
BB
3951.It Fl s
3952If the receive is interrupted, save the partially received state, rather
3953than deleting it.
3954Interruption may be due to premature termination of the stream
3955.Po e.g. due to network failure or failure of the remote system
3956if the stream is being read over a network connection
3957.Pc ,
3958a checksum error in the stream, termination of the
3959.Nm zfs Cm receive
3960process, or unclean shutdown of the system.
3961.Pp
3962The receive can be resumed with a stream generated by
3963.Nm zfs Cm send Fl t Ar token ,
3964where the
3965.Ar token
3966is the value of the
3967.Sy receive_resume_token
3968property of the filesystem or volume which is received into.
3969.Pp
3970To use this flag, the storage pool must have the
3971.Sy extensible_dataset
3972feature enabled.
3973See
3974.Xr zpool-features 5
3975for details on ZFS feature flags.
3976.It Fl u
3977File system that is associated with the received stream is not mounted.
3978.It Fl v
3979Print verbose information about the stream and the time required to perform the
3980receive operation.
3981.It Fl x Em property
3982Ensures that the effective value of the specified property after the
3983receive is unaffected by the value of that property in the send stream (if any),
3984as if the property had been excluded from the send stream.
3985.Pp
3986If the specified property is not present in the send stream, this option does
3987nothing.
3988.Pp
3989If a received property needs to be overridden, the effective value will be
3990set or inherited, depending on whether the property is inheritable or not.
3991.Pp
3992In the case of an incremental update,
3993.Fl x
3994leaves any existing local setting or explicit inheritance unchanged.
3995.Pp
3996All
3997.Fl o
3998restrictions on set-once and special properties apply equally to
3999.Fl x .
4000.El
4001.It Xo
4002.Nm
4003.Cm receive
4004.Fl A
4005.Ar filesystem Ns | Ns Ar volume
4006.Xc
4007Abort an interrupted
4008.Nm zfs Cm receive Fl s ,
4009deleting its saved partially received state.
4010.It Xo
4011.Nm
4012.Cm allow
4013.Ar filesystem Ns | Ns Ar volume
4014.Xc
4015Displays permissions that have been delegated on the specified filesystem or
4016volume.
4017See the other forms of
4018.Nm zfs Cm allow
4019for more information.
4020.Pp
4021Delegations are supported under Linux with the exception of
4022.Sy mount ,
4023.Sy unmount ,
4024.Sy mountpoint ,
4025.Sy canmount ,
4026.Sy rename ,
4027and
4028.Sy share .
4029These permissions cannot be delegated because the Linux
4030.Xr mount 8
4031command restricts modifications of the global namespace to the root user.
4032.It Xo
4033.Nm
4034.Cm allow
4035.Op Fl dglu
4036.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4037.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4038.Ar setname Oc Ns ...
4039.Ar filesystem Ns | Ns Ar volume
0238a975 4040.Xc
4041.It Xo
44f09cdc
BB
4042.Nm
4043.Cm allow
4044.Op Fl dl
4045.Fl e Ns | Ns Sy everyone
4046.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4047.Ar setname Oc Ns ...
4048.Ar filesystem Ns | Ns Ar volume
4049.Xc
4050Delegates ZFS administration permission for the file systems to non-privileged
4051users.
4052.Bl -tag -width "-d"
4053.It Fl d
4054Allow only for the descendent file systems.
4055.It Fl e Ns | Ns Sy everyone
4056Specifies that the permissions be delegated to everyone.
4057.It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
4058Explicitly specify that permissions are delegated to the group.
4059.It Fl l
4060Allow
4061.Qq locally
4062only for the specified file system.
4063.It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
4064Explicitly specify that permissions are delegated to the user.
4065.It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4066Specifies to whom the permissions are delegated.
4067Multiple entities can be specified as a comma-separated list.
4068If neither of the
4069.Fl gu
4070options are specified, then the argument is interpreted preferentially as the
4071keyword
4072.Sy everyone ,
4073then as a user name, and lastly as a group name.
4074To specify a user or group named
4075.Qq everyone ,
4076use the
4077.Fl g
4078or
4079.Fl u
4080options.
4081To specify a group with the same name as a user, use the
4082.Fl g
4083options.
4084.It Xo
4085.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4086.Ar setname Oc Ns ...
4087.Xc
4088The permissions to delegate.
4089Multiple permissions may be specified as a comma-separated list.
4090Permission names are the same as ZFS subcommand and property names.
4091See the property list below.
4092Property set names, which begin with
4093.Sy @ ,
4094may be specified.
4095See the
4096.Fl s
4097form below for details.
4098.El
4099.Pp
4100If neither of the
4101.Fl dl
4102options are specified, or both are, then the permissions are allowed for the
4103file system or volume, and all of its descendents.
4104.Pp
4105Permissions are generally the ability to use a ZFS subcommand or change a ZFS
4106property.
4107The following permissions are available:
4108.Bd -literal
058ac9ba 4109NAME TYPE NOTES
44f09cdc
BB
4110allow subcommand Must also have the permission that is
4111 being allowed
4112clone subcommand Must also have the 'create' ability and
4113 'mount' ability in the origin file system
058ac9ba
BB
4114create subcommand Must also have the 'mount' ability
4115destroy subcommand Must also have the 'mount' ability
0677cb6f 4116diff subcommand Allows lookup of paths within a dataset
44f09cdc
BB
4117 given an object number, and the ability
4118 to create snapshots necessary to
4119 'zfs diff'.
b5256303
TC
4120load-key subcommand Allows loading and unloading of encryption key
4121 (see 'zfs load-key' and 'zfs unload-key').
4122change-key subcommand Allows changing an encryption key via
4123 'zfs change-key'.
058ac9ba 4124mount subcommand Allows mount/umount of ZFS datasets
44f09cdc
BB
4125promote subcommand Must also have the 'mount' and 'promote'
4126 ability in the origin file system
4127receive subcommand Must also have the 'mount' and 'create'
4128 ability
058ac9ba
BB
4129rename subcommand Must also have the 'mount' and 'create'
4130 ability in the new parent
4131rollback subcommand Must also have the 'mount' ability
6b4e21c6 4132send subcommand
44f09cdc
BB
4133share subcommand Allows sharing file systems over NFS
4134 or SMB protocols
058ac9ba 4135snapshot subcommand Must also have the 'mount' ability
44f09cdc
BB
4136
4137groupquota other Allows accessing any groupquota@...
4138 property
058ac9ba
BB
4139groupused other Allows reading any groupused@... property
4140userprop other Allows changing any user property
44f09cdc
BB
4141userquota other Allows accessing any userquota@...
4142 property
058ac9ba 4143userused other Allows reading any userused@... property
9c5167d1
NF
4144projectobjquota other Allows accessing any projectobjquota@...
4145 property
4146projectquota other Allows accessing any projectquota@... property
4147projectobjused other Allows reading any projectobjused@... property
4148projectused other Allows reading any projectused@... property
058ac9ba 4149
6b4e21c6 4150aclinherit property
44f09cdc 4151acltype property
6b4e21c6
NB
4152atime property
4153canmount property
4154casesensitivity property
4155checksum property
4156compression property
4157copies property
6b4e21c6
NB
4158devices property
4159exec property
788eb90c 4160filesystem_limit property
6b4e21c6
NB
4161mountpoint property
4162nbmand property
4163normalization property
4164primarycache property
4165quota property
4166readonly property
4167recordsize property
4168refquota property
4169refreservation property
4170reservation property
4171secondarycache property
4172setuid property
4173sharenfs property
4174sharesmb property
4175snapdir property
788eb90c 4176snapshot_limit property
6b4e21c6
NB
4177utf8only property
4178version property
4179volblocksize property
4180volsize property
4181vscan property
4182xattr property
4183zoned property
44f09cdc
BB
4184.Ed
4185.It Xo
4186.Nm
4187.Cm allow
4188.Fl c
4189.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4190.Ar setname Oc Ns ...
4191.Ar filesystem Ns | Ns Ar volume
4192.Xc
4193Sets
4194.Qq create time
4195permissions.
4196These permissions are granted
4197.Pq locally
4198to the creator of any newly-created descendent file system.
4199.It Xo
4200.Nm
4201.Cm allow
4202.Fl s No @ Ns Ar setname
4203.Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4204.Ar setname Oc Ns ...
4205.Ar filesystem Ns | Ns Ar volume
4206.Xc
4207Defines or adds permissions to a permission set.
4208The set can be used by other
4209.Nm zfs Cm allow
4210commands for the specified file system and its descendents.
4211Sets are evaluated dynamically, so changes to a set are immediately reflected.
4212Permission sets follow the same naming restrictions as ZFS file systems, but the
4213name must begin with
4214.Sy @ ,
4215and can be no more than 64 characters long.
4216.It Xo
4217.Nm
4218.Cm unallow
4219.Op Fl dglru
4220.Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4221.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4222.Ar setname Oc Ns ... Oc
4223.Ar filesystem Ns | Ns Ar volume
0238a975 4224.Xc
4225.It Xo
44f09cdc
BB
4226.Nm
4227.Cm unallow
4228.Op Fl dlr
4229.Fl e Ns | Ns Sy everyone
4230.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4231.Ar setname Oc Ns ... Oc
4232.Ar filesystem Ns | Ns Ar volume
cb110f25
YP
4233.Xc
4234.It Xo
44f09cdc
BB
4235.Nm
4236.Cm unallow
4237.Op Fl r
4238.Fl c
4239.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4240.Ar setname Oc Ns ... Oc
4241.Ar filesystem Ns | Ns Ar volume
4242.Xc
4243Removes permissions that were granted with the
4244.Nm zfs Cm allow
4245command.
4246No permissions are explicitly denied, so other permissions granted are still in
4247effect.
4248For example, if the permission is granted by an ancestor.
4249If no permissions are specified, then all permissions for the specified
4250.Ar user ,
4251.Ar group ,
4252or
4253.Sy everyone
4254are removed.
4255Specifying
4256.Sy everyone
4257.Po or using the
4258.Fl e
4259option
4260.Pc
4261only removes the permissions that were granted to everyone, not all permissions
4262for every user and group.
4263See the
4264.Nm zfs Cm allow
4265command for a description of the
4266.Fl ldugec
4267options.
4268.Bl -tag -width "-r"
4269.It Fl r
058ac9ba 4270Recursively remove the permissions from this file system and all descendents.
44f09cdc
BB
4271.El
4272.It Xo
4273.Nm
4274.Cm unallow
4275.Op Fl r
4276.Fl s No @ Ns Ar setname
4277.Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4278.Ar setname Oc Ns ... Oc
4279.Ar filesystem Ns | Ns Ar volume
4280.Xc
4281Removes permissions from a permission set.
4282If no permissions are specified, then all permissions are removed, thus removing
4283the set entirely.
4284.It Xo
4285.Nm
4286.Cm hold
4287.Op Fl r
4288.Ar tag Ar snapshot Ns ...
4289.Xc
4290Adds a single reference, named with the
4291.Ar tag
4292argument, to the specified snapshot or snapshots.
4293Each snapshot has its own tag namespace, and tags must be unique within that
4294space.
4295.Pp
4296If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4297.Nm zfs Cm destroy
4298command return
4299.Er EBUSY .
4300.Bl -tag -width "-r"
4301.It Fl r
4302Specifies that a hold with the given tag is applied recursively to the snapshots
4303of all descendent file systems.
4304.El
4305.It Xo
4306.Nm
4307.Cm holds
a9d6270a 4308.Op Fl rH
44f09cdc
BB
4309.Ar snapshot Ns ...
4310.Xc
058ac9ba 4311Lists all existing user references for the given snapshot or snapshots.
44f09cdc
BB
4312.Bl -tag -width "-r"
4313.It Fl r
4314Lists the holds that are set on the named descendent snapshots, in addition to
4315listing the holds on the named snapshot.
a9d6270a 4316.It Fl H
4317Do not print headers, use tab-delimited output.
44f09cdc
BB
4318.El
4319.It Xo
4320.Nm
4321.Cm release
4322.Op Fl r
4323.Ar tag Ar snapshot Ns ...
4324.Xc
4325Removes a single reference, named with the
4326.Ar tag
4327argument, from the specified snapshot or snapshots.
4328The tag must already exist for each snapshot.
4329If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4330.Nm zfs Cm destroy
4331command return
4332.Er EBUSY .
4333.Bl -tag -width "-r"
4334.It Fl r
4335Recursively releases a hold with the given tag on the snapshots of all
4336descendent file systems.
4337.El
4338.It Xo
4339.Nm
4340.Cm diff
4341.Op Fl FHt
4342.Ar snapshot Ar snapshot Ns | Ns Ar filesystem
4343.Xc
0677cb6f
RL
4344Display the difference between a snapshot of a given filesystem and another
4345snapshot of that filesystem from a later time or the current contents of the
44f09cdc
BB
4346filesystem.
4347The first column is a character indicating the type of change, the other columns
4348indicate pathname, new pathname
4349.Pq in case of rename ,
4350change in link count, and optionally file type and/or change time.
0677cb6f 4351The types of change are:
44f09cdc 4352.Bd -literal
0677cb6f
RL
4353- The path has been removed
4354+ The path has been created
4355M The path has been modified
4356R The path has been renamed
44f09cdc
BB
4357.Ed
4358.Bl -tag -width "-F"
4359.It Fl F
4360Display an indication of the type of file, in a manner similar to the
4361.Fl
4362option of
4363.Xr ls 1 .
4364.Bd -literal
0677cb6f
RL
4365B Block device
4366C Character device
4367/ Directory
4368> Door
4369| Named pipe
4370@ Symbolic link
4371P Event port
4372= Socket
4373F Regular file
44f09cdc
BB
4374.Ed
4375.It Fl H
4376Give more parsable tab-separated output, without header lines and without
4377arrows.
4378.It Fl t
0677cb6f 4379Display the path's inode change time as the first column of output.
44f09cdc 4380.El
b5256303
TC
4381.It Xo
4382.Nm
d99a0153 4383.Cm program
272b5d73 4384.Op Fl jn
d99a0153
CW
4385.Op Fl t Ar timeout
4386.Op Fl m Ar memory_limit
4387.Ar pool script
4388.Op Ar arg1 No ...
4389.Xc
4390Executes
4391.Ar script
4392as a ZFS channel program on
4393.Ar pool .
4394The ZFS channel
4395program interface allows ZFS administrative operations to be run
4396programmatically via a Lua script.
4397The entire script is executed atomically, with no other administrative
4398operations taking effect concurrently.
4399A library of ZFS calls is made available to channel program scripts.
4400Channel programs may only be run with root privileges.
4401.sp
4402For full documentation of the ZFS channel program interface, see the manual
4403page for
4404.Xr zfs-program 8 .
4405.Bl -tag -width ""
272b5d73
AP
4406.It Fl j
4407Display channel program output in JSON format. When this flag is specified and
4408standard output is empty - channel program encountered an error. The details of
4409such an error will be printed to standard error in plain text.
5b72a38d
SD
4410.It Fl n
4411Executes a read-only channel program, which runs faster.
4412The program cannot change on-disk state by calling functions from
4413the zfs.sync submodule.
4414The program can be used to gather information such as properties and
4415determining if changes would succeed (zfs.check.*).
4416Without this flag, all pending changes must be synced to disk before
4417a channel program can complete.
d99a0153
CW
4418.It Fl t Ar timeout
4419Execution time limit, in milliseconds.
4420If a channel program executes for longer than the provided timeout, it will
4421be stopped and an error will be returned.
4422The default timeout is 1000 ms, and can be set to a maximum of 10000 ms.
4423.It Fl m Ar memory-limit
4424Memory limit, in bytes.
4425If a channel program attempts to allocate more memory than the given limit,
4426it will be stopped and an error returned.
4427The default memory limit is 10 MB, and can be set to a maximum of 100 MB.
4428.sp
4429All remaining argument strings are passed directly to the channel program as
4430arguments.
4431See
4432.Xr zfs-program 8
4433for more information.
4434.El
4435.It Xo
4436.Nm
b5256303
TC
4437.Cm load-key
4438.Op Fl nr
4439.Op Fl L Ar keylocation
4440.Fl a | Ar filesystem
4441.Xc
4442Load the key for
4443.Ar filesystem ,
4444allowing it and all children that inherit the
4445.Sy keylocation
4446property to be accessed. The key will be expected in the format specified by the
4447.Sy keyformat
4448and location specified by the
4449.Sy keylocation
4450property. Note that if the
4451.Sy keylocation
4452is set to
4453.Sy prompt
4454the terminal will interactively wait for the key to be entered. Loading a key
4455will not automatically mount the dataset. If that functionality is desired,
4456.Nm zfs Cm mount Sy -l
4457will ask for the key and mount the dataset. Once the key is loaded the
4458.Sy keystatus
4459property will become
4460.Sy available .
4461.Bl -tag -width "-r"
4462.It Fl r
4463Recursively loads the keys for the specified filesystem and all descendent
4464encryption roots.
4465.It Fl a
4466Loads the keys for all encryption roots in all imported pools.
4467.It Fl n
4468Do a dry-run
4469.Pq Qq No-op
4470load-key. This will cause zfs to simply check that the
4471provided key is correct. This command may be run even if the key is already
4472loaded.
4473.It Fl L Ar keylocation
4474Use
4475.Ar keylocation
4476instead of the
4477.Sy keylocation
4478property. This will not change the value of the property on the dataset. Note
4479that if used with either
4480.Fl r
4481or
4482.Fl a ,
4483.Ar keylocation
4484may only be given as
4485.Sy prompt .
4486.El
4487.It Xo
4488.Nm
4489.Cm unload-key
4490.Op Fl r
4491.Fl a | Ar filesystem
4492.Xc
4493Unloads a key from ZFS, removing the ability to access the dataset and all of
4494its children that inherit the
4495.Sy keylocation
4496property. This requires that the dataset is not currently open or mounted. Once
4497the key is unloaded the
4498.Sy keystatus
4499property will become
4500.Sy unavailable .
4501.Bl -tag -width "-r"
4502.It Fl r
4503Recursively unloads the keys for the specified filesystem and all descendent
4504encryption roots.
4505.It Fl a
4506Unloads the keys for all encryption roots in all imported pools.
4507.El
4508.It Xo
4509.Nm
4510.Cm change-key
4511.Op Fl l
4512.Op Fl o Ar keylocation Ns = Ns Ar value
4513.Op Fl o Ar keyformat Ns = Ns Ar value
4514.Op Fl o Ar pbkdf2iters Ns = Ns Ar value
4515.Ar filesystem
4516.Xc
4517.It Xo
4518.Nm
4519.Cm change-key
4520.Fl i
4521.Op Fl l
4522.Ar filesystem
4523.Xc
4524Allows a user to change the encryption key used to access a dataset. This
4525command requires that the existing key for the dataset is already loaded into
4526ZFS. This command may also be used to change the
4527.Sy keylocation ,
4528.Sy keyformat ,
4529and
4530.Sy pbkdf2iters
4531properties as needed. If the dataset was not previously an encryption root it
4532will become one. Alternatively, the
4533.Fl i
4534flag may be provided to cause an encryption root to inherit the parent's key
4535instead.
4536.Bl -tag -width "-r"
4537.It Fl l
4538Ensures the key is loaded before attempting to change the key. This is
4539effectively equivalent to
4540.Qq Nm zfs Cm load-key Ar filesystem ; Nm zfs Cm change-key Ar filesystem
4541.It Fl o Ar property Ns = Ns Ar value
4542Allows the user to set encryption key properties (
4543.Sy keyformat ,
4544.Sy keylocation ,
4545and
4546.Sy pbkdf2iters
4547) while changing the key. This is the only way to alter
4548.Sy keyformat
4549and
4550.Sy pbkdf2iters
4551after the dataset has been created.
4552.It Fl i
4553Indicates that zfs should make
4554.Ar filesystem
4555inherit the key of its parent. Note that this command can only be run on an
4556encryption root that has an encrypted parent.
4557.El
44f09cdc
BB
4558.El
4559.Sh EXIT STATUS
4560The
4561.Nm
4562utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
4563options were specified.
4564.Sh EXAMPLES
4565.Bl -tag -width ""
4566.It Sy Example 1 No Creating a ZFS File System Hierarchy
4567The following commands create a file system named
4568.Em pool/home
4569and a file system named
4570.Em pool/home/bob .
4571The mount point
4572.Pa /export/home
4573is set for the parent file system, and is automatically inherited by the child
4574file system.
4575.Bd -literal
4576# zfs create pool/home
4577# zfs set mountpoint=/export/home pool/home
4578# zfs create pool/home/bob
4579.Ed
4580.It Sy Example 2 No Creating a ZFS Snapshot
4581The following command creates a snapshot named
4582.Sy yesterday .
4583This snapshot is mounted on demand in the
4584.Pa .zfs/snapshot
4585directory at the root of the
4586.Em pool/home/bob
4587file system.
4588.Bd -literal
4589# zfs snapshot pool/home/bob@yesterday
4590.Ed
4591.It Sy Example 3 No Creating and Destroying Multiple Snapshots
4592The following command creates snapshots named
4593.Sy yesterday
4594of
4595.Em pool/home
4596and all of its descendent file systems.
4597Each snapshot is mounted on demand in the
4598.Pa .zfs/snapshot
4599directory at the root of its file system.
4600The second command destroys the newly created snapshots.
4601.Bd -literal
4602# zfs snapshot -r pool/home@yesterday
4603# zfs destroy -r pool/home@yesterday
4604.Ed
4605.It Sy Example 4 No Disabling and Enabling File System Compression
4606The following command disables the
4607.Sy compression
4608property for all file systems under
4609.Em pool/home .
4610The next command explicitly enables
4611.Sy compression
4612for
4613.Em pool/home/anne .
4614.Bd -literal
4615# zfs set compression=off pool/home
4616# zfs set compression=on pool/home/anne
4617.Ed
4618.It Sy Example 5 No Listing ZFS Datasets
4619The following command lists all active file systems and volumes in the system.
4620Snapshots are displayed if the
4621.Sy listsnaps
4622property is
4623.Sy on .
4624The default is
4625.Sy off .
4626See
4627.Xr zpool 8
4628for more information on pool properties.
4629.Bd -literal
4630# zfs list
4631NAME USED AVAIL REFER MOUNTPOINT
4632pool 450K 457G 18K /pool
4633pool/home 315K 457G 21K /export/home
4634pool/home/anne 18K 457G 18K /export/home/anne
4635pool/home/bob 276K 457G 276K /export/home/bob
4636.Ed
4637.It Sy Example 6 No Setting a Quota on a ZFS File System
4638The following command sets a quota of 50 Gbytes for
4639.Em pool/home/bob .
4640.Bd -literal
4641# zfs set quota=50G pool/home/bob
4642.Ed
4643.It Sy Example 7 No Listing ZFS Properties
4644The following command lists all properties for
4645.Em pool/home/bob .
4646.Bd -literal
4647# zfs get all pool/home/bob
058ac9ba
BB
4648NAME PROPERTY VALUE SOURCE
4649pool/home/bob type filesystem -
4650pool/home/bob creation Tue Jul 21 15:53 2009 -
4651pool/home/bob used 21K -
4652pool/home/bob available 20.0G -
4653pool/home/bob referenced 21K -
4654pool/home/bob compressratio 1.00x -
4655pool/home/bob mounted yes -
4656pool/home/bob quota 20G local
4657pool/home/bob reservation none default
4658pool/home/bob recordsize 128K default
4659pool/home/bob mountpoint /pool/home/bob default
4660pool/home/bob sharenfs off default
4661pool/home/bob checksum on default
4662pool/home/bob compression on local
4663pool/home/bob atime on default
4664pool/home/bob devices on default
4665pool/home/bob exec on default
4666pool/home/bob setuid on default
4667pool/home/bob readonly off default
4668pool/home/bob zoned off default
4669pool/home/bob snapdir hidden default
023699cd 4670pool/home/bob acltype off default
058ac9ba
BB
4671pool/home/bob aclinherit restricted default
4672pool/home/bob canmount on default
058ac9ba
BB
4673pool/home/bob xattr on default
4674pool/home/bob copies 1 default
4675pool/home/bob version 4 -
4676pool/home/bob utf8only off -
4677pool/home/bob normalization none -
4678pool/home/bob casesensitivity sensitive -
4679pool/home/bob vscan off default
4680pool/home/bob nbmand off default
4681pool/home/bob sharesmb off default
4682pool/home/bob refquota none default
4683pool/home/bob refreservation none default
4684pool/home/bob primarycache all default
4685pool/home/bob secondarycache all default
4686pool/home/bob usedbysnapshots 0 -
4687pool/home/bob usedbydataset 21K -
4688pool/home/bob usedbychildren 0 -
4689pool/home/bob usedbyrefreservation 0 -
44f09cdc
BB
4690.Ed
4691.Pp
058ac9ba 4692The following command gets a single property value.
44f09cdc
BB
4693.Bd -literal
4694# zfs get -H -o value compression pool/home/bob
058ac9ba 4695on
44f09cdc
BB
4696.Ed
4697The following command lists all properties with local settings for
4698.Em pool/home/bob .
4699.Bd -literal
4700# zfs get -r -s local -o name,property,value all pool/home/bob
058ac9ba
BB
4701NAME PROPERTY VALUE
4702pool/home/bob quota 20G
4703pool/home/bob compression on
44f09cdc
BB
4704.Ed
4705.It Sy Example 8 No Rolling Back a ZFS File System
4706The following command reverts the contents of
4707.Em pool/home/anne
4708to the snapshot named
4709.Sy yesterday ,
4710deleting all intermediate snapshots.
4711.Bd -literal
4712# zfs rollback -r pool/home/anne@yesterday
4713.Ed
4714.It Sy Example 9 No Creating a ZFS Clone
4715The following command creates a writable file system whose initial contents are
4716the same as
4717.Em pool/home/bob@yesterday .
4718.Bd -literal
4719# zfs clone pool/home/bob@yesterday pool/clone
4720.Ed
4721.It Sy Example 10 No Promoting a ZFS Clone
4722The following commands illustrate how to test out changes to a file system, and
4723then replace the original file system with the changed one, using clones, clone
4724promotion, and renaming:
4725.Bd -literal
4726# zfs create pool/project/production
058ac9ba 4727 populate /pool/project/production with data
44f09cdc
BB
4728# zfs snapshot pool/project/production@today
4729# zfs clone pool/project/production@today pool/project/beta
4730 make changes to /pool/project/beta and test them
4731# zfs promote pool/project/beta
4732# zfs rename pool/project/production pool/project/legacy
4733# zfs rename pool/project/beta pool/project/production
4734 once the legacy version is no longer needed, it can be destroyed
4735# zfs destroy pool/project/legacy
4736.Ed
4737.It Sy Example 11 No Inheriting ZFS Properties
4738The following command causes
4739.Em pool/home/bob
4740and
4741.Em pool/home/anne
4742to inherit the
4743.Sy checksum
4744property from their parent.
4745.Bd -literal
4746# zfs inherit checksum pool/home/bob pool/home/anne
4747.Ed
4748.It Sy Example 12 No Remotely Replicating ZFS Data
4749The following commands send a full stream and then an incremental stream to a
4750remote machine, restoring them into
4751.Em poolB/received/fs@a
4752and
4753.Em poolB/received/fs@b ,
4754respectively.
4755.Em poolB
4756must contain the file system
4757.Em poolB/received ,
4758and must not initially contain
4759.Em poolB/received/fs .
4760.Bd -literal
4761# zfs send pool/fs@a | \e
4762 ssh host zfs receive poolB/received/fs@a
4763# zfs send -i a pool/fs@b | \e
4764 ssh host zfs receive poolB/received/fs
4765.Ed
4766.It Sy Example 13 No Using the zfs receive -d Option
4767The following command sends a full stream of
4768.Em poolA/fsA/fsB@snap
4769to a remote machine, receiving it into
4770.Em poolB/received/fsA/fsB@snap .
4771The
4772.Em fsA/fsB@snap
4773portion of the received snapshot's name is determined from the name of the sent
4774snapshot.
4775.Em poolB
4776must contain the file system
4777.Em poolB/received .
4778If
4779.Em poolB/received/fsA
4780does not exist, it is created as an empty file system.
4781.Bd -literal
4782# zfs send poolA/fsA/fsB@snap | \e
4783 ssh host zfs receive -d poolB/received
4784.Ed
4785.It Sy Example 14 No Setting User Properties
4786The following example sets the user-defined
4787.Sy com.example:department
4788property for a dataset.
4789.Bd -literal
4790# zfs set com.example:department=12345 tank/accounting
4791.Ed
4792.It Sy Example 15 No Performing a Rolling Snapshot
4793The following example shows how to maintain a history of snapshots with a
4794consistent naming scheme.
4795To keep a week's worth of snapshots, the user destroys the oldest snapshot,
4796renames the remaining snapshots, and then creates a new snapshot, as follows:
4797.Bd -literal
4798# zfs destroy -r pool/users@7daysago
4799# zfs rename -r pool/users@6daysago @7daysago
4800# zfs rename -r pool/users@5daysago @6daysago
22448f08
BG
4801# zfs rename -r pool/users@4daysago @5daysago
4802# zfs rename -r pool/users@3daysago @4daysago
4803# zfs rename -r pool/users@2daysago @3daysago
44f09cdc
BB
4804# zfs rename -r pool/users@yesterday @2daysago
4805# zfs rename -r pool/users@today @yesterday
4806# zfs snapshot -r pool/users@today
4807.Ed
4808.It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
4809The following commands show how to set
4810.Sy sharenfs
4811property options to enable
4812.Sy rw
4813access for a set of
4814.Sy IP
4815addresses and to enable root access for system
4816.Sy neo
4817on the
4818.Em tank/home
4819file system.
4820.Bd -literal
4821# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
4822.Ed
4823.Pp
4824If you are using
4825.Sy DNS
4826for host name resolution, specify the fully qualified hostname.
4827.It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
4828The following example shows how to set permissions so that user
4829.Sy cindys
4830can create, destroy, mount, and take snapshots on
4831.Em tank/cindys .
4832The permissions on
4833.Em tank/cindys
4834are also displayed.
4835.Bd -literal
4836# zfs allow cindys create,destroy,mount,snapshot tank/cindys
4837# zfs allow tank/cindys
4838---- Permissions on tank/cindys --------------------------------------
4839Local+Descendent permissions:
4840 user cindys create,destroy,mount,snapshot
4841.Ed
4842.Pp
4843Because the
4844.Em tank/cindys
4845mount point permission is set to 755 by default, user
4846.Sy cindys
4847will be unable to mount file systems under
4848.Em tank/cindys .
4849Add an ACE similar to the following syntax to provide mount point access:
4850.Bd -literal
4851# chmod A+user:cindys:add_subdirectory:allow /tank/cindys
4852.Ed
4853.It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
4854The following example shows how to grant anyone in the group
4855.Sy staff
4856to create file systems in
4857.Em tank/users .
4858This syntax also allows staff members to destroy their own file systems, but not
4859destroy anyone else's file system.
4860The permissions on
4861.Em tank/users
4862are also displayed.
4863.Bd -literal
4864# zfs allow staff create,mount tank/users
4865# zfs allow -c destroy tank/users
4866# zfs allow tank/users
4867---- Permissions on tank/users ---------------------------------------
4868Permission sets:
4869 destroy
4870Local+Descendent permissions:
4871 group staff create,mount
4872.Ed
4873.It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
4874The following example shows how to define and grant a permission set on the
4875.Em tank/users
4876file system.
4877The permissions on
4878.Em tank/users
4879are also displayed.
4880.Bd -literal
4881# zfs allow -s @pset create,destroy,snapshot,mount tank/users
4882# zfs allow staff @pset tank/users
4883# zfs allow tank/users
4884---- Permissions on tank/users ---------------------------------------
4885Permission sets:
058ac9ba 4886 @pset create,destroy,mount,snapshot
44f09cdc
BB
4887Local+Descendent permissions:
4888 group staff @pset
4889.Ed
4890.It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
4891The following example shows to grant the ability to set quotas and reservations
4892on the
4893.Em users/home
4894file system.
4895The permissions on
4896.Em users/home
4897are also displayed.
4898.Bd -literal
4899# zfs allow cindys quota,reservation users/home
4900# zfs allow users/home
4901---- Permissions on users/home ---------------------------------------
4902Local+Descendent permissions:
058ac9ba 4903 user cindys quota,reservation
44f09cdc
BB
4904cindys% zfs set quota=10G users/home/marks
4905cindys% zfs get quota users/home/marks
4906NAME PROPERTY VALUE SOURCE
4907users/home/marks quota 10G local
4908.Ed
4909.It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
4910The following example shows how to remove the snapshot permission from the
4911.Sy staff
4912group on the
4913.Em tank/users
4914file system.
4915The permissions on
4916.Em tank/users
4917are also displayed.
4918.Bd -literal
4919# zfs unallow staff snapshot tank/users
4920# zfs allow tank/users
4921---- Permissions on tank/users ---------------------------------------
4922Permission sets:
058ac9ba 4923 @pset create,destroy,mount,snapshot
44f09cdc
BB
4924Local+Descendent permissions:
4925 group staff @pset
4926.Ed
4927.It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
0677cb6f 4928The following example shows how to see what has changed between a prior
44f09cdc
BB
4929snapshot of a ZFS dataset and its current state.
4930The
4931.Fl F
4932option is used to indicate type information for the files affected.
4933.Bd -literal
0677cb6f
RL
4934# zfs diff -F tank/test@before tank/test
4935M / /tank/test/
4936M F /tank/test/linked (+1)
4937R F /tank/test/oldname -> /tank/test/newname
4938- F /tank/test/deleted
4939+ F /tank/test/created
4940M F /tank/test/modified
44f09cdc
BB
4941.Ed
4942.It Sy Example 23 No Creating a bookmark
4943The following example create a bookmark to a snapshot. This bookmark
4944can then be used instead of snapshot in send streams.
4945.Bd -literal
a215ee16 4946# zfs bookmark rpool@snapshot rpool#bookmark
44f09cdc
BB
4947.Ed
4948.It Sy Example 24 No Setting sharesmb Property Options on a ZFS File System
4949The following example show how to share SMB filesystem through ZFS. Note that
4950that a user and his/her password must be given.
4951.Bd -literal
4952# smbmount //127.0.0.1/share_tmp /mnt/tmp \\
4953 -o user=workgroup/turbo,password=obrut,uid=1000
4954.Ed
4955.Pp
4956Minimal
4957.Em /etc/samba/smb.conf
4958configuration required:
4959.Pp
4960Samba will need to listen to 'localhost' (127.0.0.1) for the ZFS utilities to
4961communicate with Samba. This is the default behavior for most Linux
4962distributions.
4963.Pp
4964Samba must be able to authenticate a user. This can be done in a number of
4965ways, depending on if using the system password file, LDAP or the Samba
4966specific smbpasswd file. How to do this is outside the scope of this manual.
4967Please refer to the
4968.Xr smb.conf 5
4969man page for more information.
4970.Pp
4971See the
4972.Sy USERSHARE section
4973of the
4974.Xr smb.conf 5
4975man page for all configuration options in case you need to modify any options
4976to the share afterwards. Do note that any changes done with the
4977.Xr net 8
4978command will be undone if the share is ever unshared (such as at a reboot etc).
4979.El
4980.Sh INTERFACE STABILITY
4981.Sy Committed .
4982.Sh SEE ALSO
90cdf283 4983.Xr attr 1 ,
44f09cdc
BB
4984.Xr gzip 1 ,
4985.Xr ssh 1 ,
44f09cdc 4986.Xr chmod 2 ,
90cdf283 4987.Xr fsync 2 ,
44f09cdc
BB
4988.Xr stat 2 ,
4989.Xr write 2 ,
44f09cdc 4990.Xr acl 5 ,
90cdf283 4991.Xr attributes 5 ,
44f09cdc
BB
4992.Xr exports 5 ,
4993.Xr exportfs 8 ,
90cdf283 4994.Xr mount 8 ,
44f09cdc 4995.Xr net 8 ,
90cdf283 4996.Xr selinux 8 ,
4997.Xr zpool 8