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