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