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