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