]> git.proxmox.com Git - mirror_zfs-debian.git/blame - man/man8/zfs.8
Illumos #2635: 'zfs rename -f' to perform force unmount
[mirror_zfs-debian.git] / man / man8 / zfs.8
CommitLineData
058ac9ba
BB
1'\" te
2.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
db49968e 3.\" Copyright (c) 2012 by Delphix. All rights reserved.
e346ec25 4.\" Copyright (c) 2012 Nexenta Systems, Inc. All Rights Reserved.
bb8b81ec 5.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
058ac9ba
BB
6.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
7.\" See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
8.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
330d06f9 9.TH zfs 8 "10 Jul 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
058ac9ba
BB
10.SH NAME
11zfs \- configures ZFS file systems
12.SH SYNOPSIS
13.LP
14.nf
15\fBzfs\fR [\fB-?\fR]
16.fi
17
18.LP
19.nf
20\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR
21.fi
22
23.LP
24.nf
25\fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR
26.fi
27
28.LP
29.nf
330d06f9 30\fBzfs\fR \fBdestroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
31.fi
32
33.LP
34.nf
330d06f9 35\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
058ac9ba
BB
36.fi
37
38.LP
39.nf
10b75496 40\fBzfs\fR \fBsnapshot | snap\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]...
058ac9ba
BB
41 \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
42.fi
43
44.LP
45.nf
46\fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
47.fi
48
49.LP
50.nf
51\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
52.fi
53
54.LP
55.nf
56\fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR
57.fi
58
59.LP
60.nf
db49968e 61\fBzfs\fR \fBrename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
058ac9ba
BB
62 \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
63.fi
64
65.LP
66.nf
db49968e 67\fBzfs\fR \fBrename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
68.fi
69
70.LP
71.nf
72\fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR
73.fi
74
75.LP
76.nf
77\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-H\fR][\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
cf81b00a 78 [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fIsnap\fR] ...
058ac9ba
BB
79.fi
80
81.LP
82.nf
83\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
84.fi
85
86.LP
87.nf
e346ec25
AS
88\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
89 [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
058ac9ba
BB
90.fi
91
92.LP
93.nf
94\fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
95.fi
96
97.LP
98.nf
99\fBzfs\fR \fBupgrade\fR [\fB-v\fR]
100.fi
101
102.LP
103.nf
104\fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR
105.fi
106
107.LP
108.nf
109\fBzfs\fR \fBuserspace\fR [\fB-niHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-sS\fR \fIfield\fR] ...
330d06f9 110 [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
111.fi
112
113.LP
114.nf
115\fBzfs\fR \fBgroupspace\fR [\fB-niHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-sS\fR \fIfield\fR] ...
330d06f9 116 [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
058ac9ba
BB
117.fi
118
119.LP
120.nf
121\fBzfs\fR \fBmount\fR
122.fi
123
124.LP
125.nf
126\fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR
127.fi
128
129.LP
130.nf
10b75496 131\fBzfs\fR \fBunmount | umount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
058ac9ba
BB
132.fi
133
134.LP
135.nf
136\fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR
137.fi
138
139.LP
140.nf
141\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
142.fi
143
144.LP
145.nf
330d06f9 146\fBzfs\fR \fBsend\fR [\fB-DnPpRrv\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
058ac9ba
BB
147.fi
148
149.LP
150.nf
10b75496 151\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
058ac9ba
BB
152.fi
153
154.LP
155.nf
bb8b81ec 156\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR
058ac9ba
BB
157.fi
158
159.LP
160.nf
161\fBzfs\fR \fBallow\fR \fIfilesystem\fR|\fIvolume\fR
162.fi
163
164.LP
165.nf
166\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...]
167 \fIfilesystem\fR|\fIvolume\fR
168.fi
169
170.LP
171.nf
172\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
173.fi
174
175.LP
176.nf
177\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
178.fi
179
180.LP
181.nf
182\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
183.fi
184
185.LP
186.nf
187\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]]
188 \fIfilesystem\fR|\fIvolume\fR
189.fi
190
191.LP
192.nf
193\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
194.fi
195
196.LP
197.nf
198\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR
199.fi
200
201.LP
202.nf
203\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
204.fi
205
206.LP
207.nf
208\fBzfs\fR \fBhold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
209.fi
210
211.LP
212.nf
213\fBzfs\fR \fBholds\fR [\fB-r\fR] \fIsnapshot\fR...
214.fi
215
216.LP
217.nf
218\fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
219.fi
220
221.SH DESCRIPTION
222.sp
223.LP
2d1b7b0b 224The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(8). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
058ac9ba
BB
225.sp
226.in +2
227.nf
228pool/{filesystem,volume,snapshot}
229.fi
230.in -2
231.sp
232
233.sp
234.LP
235where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
236.sp
237.LP
238A dataset can be one of the following:
239.sp
240.ne 2
241.mk
242.na
243\fB\fIfile system\fR\fR
244.ad
245.sp .6
246.RS 4n
247A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space.
248.RE
249
250.sp
251.ne 2
252.mk
253.na
254\fB\fIvolume\fR\fR
255.ad
256.sp .6
257.RS 4n
258A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments.
259.RE
260
261.sp
262.ne 2
263.mk
264.na
265\fB\fIsnapshot\fR\fR
266.ad
267.sp .6
268.RS 4n
269A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
270.RE
271
272.SS "ZFS File System Hierarchy"
273.sp
274.LP
275A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system hierarchy.
276.sp
277.LP
2d1b7b0b 278The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage characteristics, however, are managed by the \fBzpool\fR(8) command.
058ac9ba
BB
279.sp
280.LP
2d1b7b0b 281See \fBzpool\fR(8) for more information on creating and administering pools.
058ac9ba
BB
282.SS "Snapshots"
283.sp
284.LP
285A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset.
286.sp
287.LP
288Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
289.sp
290.LP
291File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR directory can be controlled by the \fBsnapdir\fR property.
292.SS "Clones"
293.sp
294.LP
295A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
296.sp
297.LP
298Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The \fBorigin\fR property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
299.sp
300.LP
301The clone parent-child dependency relationship can be reversed by using the \fBpromote\fR subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from.
302.SS "Mount Points"
303.sp
304.LP
9a616b5d 305Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system is likely to be numerous. To cope with this, \fBZFS\fR automatically manages mounting and unmounting file systems without the need to edit the \fB/etc/fstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time.
058ac9ba
BB
306.sp
307.LP
308By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR is the name of the file system in the \fBZFS\fR namespace. Directories are created and destroyed as needed.
309.sp
310.LP
9a616b5d 311A file system can also have a mount point set in the \fBmountpoint\fR property. This directory is created as needed, and \fBZFS\fR automatically mounts the file system when the \fBzfs mount -a\fR command is invoked (without editing \fB/etc/fstab\fR). The \fBmountpoint\fR property can be inherited, so if \fBpool/home\fR has a mount point of \fB/export/stuff\fR, then \fBpool/home/user\fR automatically inherits a mount point of \fB/export/stuff/user\fR.
058ac9ba
BB
312.sp
313.LP
314A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system from being mounted.
315.sp
316.LP
9a616b5d 317If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/fstab\fR). If a file system's mount point is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
058ac9ba
BB
318.SS "Native Properties"
319.sp
320.LP
321Properties are divided into two types, native properties and user-defined (or "user") properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section, below.
322.sp
323.LP
324Every dataset has a set of properties that export statistics about the dataset as well as control various behaviors. Properties are inherited from the parent unless overridden by the child. Some properties apply only to certain types of datasets (file systems, volumes, or snapshots).
325.sp
326.LP
327The values of numeric properties can be specified using human-readable suffixes (for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR for zettabyte). The following are all valid (and equal) specifications:
328.sp
329.in +2
330.nf
3311536M, 1.5g, 1.50GB
332.fi
333.in -2
334.sp
335
336.sp
337.LP
338The values of non-numeric properties are case sensitive and must be lowercase, except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR.
339.sp
340.LP
341The following native properties consist of read-only statistics about the dataset. These properties can be neither set, nor inherited. Native properties apply to all dataset types unless otherwise noted.
342.sp
343.ne 2
344.mk
345.na
346\fB\fBavailable\fR\fR
347.ad
348.sp .6
349.RS 4n
350The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool.
351.sp
352This property can also be referred to by its shortened column name, \fBavail\fR.
353.RE
354
355.sp
356.ne 2
357.mk
358.na
359\fB\fBcompressratio\fR\fR
360.ad
361.sp .6
362.RS 4n
f5fc4aca 363For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier. The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot. For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property. Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR.
058ac9ba
BB
364.RE
365
366.sp
367.ne 2
368.mk
369.na
370\fB\fBcreation\fR\fR
371.ad
372.sp .6
373.RS 4n
374The time this dataset was created.
375.RE
376
377.sp
378.ne 2
379.mk
380.na
330d06f9
MA
381\fB\fBclones\fR\fR
382.ad
383.sp .6
384.RS 4n
385For snapshots, this property is a comma-separated list of filesystems or
386volumes which are clones of this snapshot. The clones' \fBorigin\fR property
387is this snapshot. If the \fBclones\fR property is not empty, then this
388snapshot can not be destroyed (even with the \fB-r\fR or \fB-f\fR options).
389.RE
390
391.sp
392.ne 2
393.na
058ac9ba
BB
394\fB\fBdefer_destroy\fR\fR
395.ad
396.sp .6
397.RS 4n
3b204150 398This property is \fBon\fR if the snapshot has been marked for deferred destruction by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is \fBoff\fR.
058ac9ba
BB
399.RE
400
401.sp
402.ne 2
403.mk
404.na
405\fB\fBmounted\fR\fR
406.ad
407.sp .6
408.RS 4n
409For file systems, indicates whether the file system is currently mounted. This property can be either \fByes\fR or \fBno\fR.
410.RE
411
412.sp
413.ne 2
414.mk
415.na
416\fB\fBorigin\fR\fR
417.ad
418.sp .6
419.RS 4n
330d06f9 420For cloned file systems or volumes, the snapshot from which the clone was created. See also the \fBclones\fR property.
058ac9ba
BB
421.RE
422
423.sp
424.ne 2
425.mk
426.na
427\fB\fBreferenced\fR\fR
428.ad
429.sp .6
430.RS 4n
431The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
432.sp
433This property can also be referred to by its shortened column name, \fBrefer\fR.
434.RE
435
f5fc4aca
MA
436.sp
437.ne 2
438.mk
439.na
440\fB\fBrefcompressratio\fR\fR
441.ad
442.sp .6
443.RS 4n
444The compression ratio achieved for the \fBreferenced\fR space of this
445dataset, expressed as a multiplier. See also the \fBcompressratio\fR
446property.
447.RE
448
058ac9ba
BB
449.sp
450.ne 2
451.mk
452.na
453\fB\fBtype\fR\fR
454.ad
455.sp .6
456.RS 4n
457The type of dataset: \fBfilesystem\fR, \fBvolume\fR, or \fBsnapshot\fR.
458.RE
459
460.sp
461.ne 2
462.mk
463.na
464\fB\fBused\fR\fR
465.ad
466.sp .6
467.RS 4n
468The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
469.sp
470When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
471.sp
2d1b7b0b 472The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(2) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
058ac9ba
BB
473.RE
474
475.sp
476.ne 2
477.mk
478.na
479\fB\fBusedby*\fR\fR
480.ad
481.sp .6
482.RS 4n
483The \fBusedby*\fR properties decompose the \fBused\fR properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on \fBzpool\fR "version 13" pools.
484.RE
485
486.sp
487.ne 2
488.mk
489.na
490\fB\fBusedbychildren\fR\fR
491.ad
492.sp .6
493.RS 4n
494The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
495.RE
496
497.sp
498.ne 2
499.mk
500.na
501\fB\fBusedbydataset\fR\fR
502.ad
503.sp .6
504.RS 4n
505The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents).
506.RE
507
508.sp
509.ne 2
510.mk
511.na
512\fB\fBusedbyrefreservation\fR\fR
513.ad
514.sp .6
515.RS 4n
516The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
517.RE
518
519.sp
520.ne 2
521.mk
522.na
523\fB\fBusedbysnapshots\fR\fR
524.ad
525.sp .6
526.RS 4n
527The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' \fBused\fR properties because space can be shared by multiple snapshots.
528.RE
529
530.sp
531.ne 2
532.mk
533.na
534\fB\fBuserused@\fR\fIuser\fR\fR
535.ad
536.sp .6
537.RS 4n
538The amount of space consumed by the specified user in this dataset. Space is charged to the owner of each file, as displayed by \fBls\fR \fB-l\fR. The amount of space charged is displayed by \fBdu\fR and \fBls\fR \fB-s\fR. See the \fBzfs userspace\fR subcommand for more information.
539.sp
540Unprivileged users can access only their own space usage. The root user, or a user who has been granted the \fBuserused\fR privilege with \fBzfs allow\fR, can access everyone's usage.
541.sp
542The \fBuserused@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
543.RS +4
544.TP
545.ie t \(bu
546.el o
547\fIPOSIX name\fR (for example, \fBjoe\fR)
548.RE
549.RS +4
550.TP
551.ie t \(bu
552.el o
553\fIPOSIX numeric ID\fR (for example, \fB789\fR)
554.RE
555.RS +4
556.TP
557.ie t \(bu
558.el o
559\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
560.RE
561.RS +4
562.TP
563.ie t \(bu
564.el o
565\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
566.RE
567.RE
568
569.sp
570.ne 2
571.mk
572.na
573\fB\fBuserrefs\fR\fR
574.ad
575.sp .6
576.RS 4n
577This property is set to the number of user holds on this snapshot. User holds are set by using the \fBzfs hold\fR command.
578.RE
579
580.sp
581.ne 2
582.mk
583.na
584\fB\fBgroupused@\fR\fIgroup\fR\fR
585.ad
586.sp .6
587.RS 4n
588The amount of space consumed by the specified group in this dataset. Space is charged to the group of each file, as displayed by \fBls\fR \fB-l\fR. See the \fBuserused@\fR\fIuser\fR property for more information.
589.sp
590Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBgroupused\fR privilege with \fBzfs allow\fR, can access all groups' usage.
591.RE
592
593.sp
594.ne 2
595.mk
596.na
597\fB\fBvolblocksize\fR=\fIblocksize\fR\fR
598.ad
599.sp .6
600.RS 4n
601For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
602.sp
603This property can also be referred to by its shortened column name, \fBvolblock\fR.
604.RE
605
330d06f9
MA
606.sp
607.ne 2
608.na
609\fB\fBwritten\fR\fR
610.ad
611.sp .6
612.RS 4n
613The amount of \fBreferenced\fR space written to this dataset since the
614previous snapshot.
615.RE
616
617.sp
618.ne 2
619.na
620\fB\fBwritten@\fR\fIsnapshot\fR\fR
621.ad
622.sp .6
623.RS 4n
624The amount of \fBreferenced\fR space written to this dataset since the
625specified snapshot. This is the space that is referenced by this dataset
626but was not referenced by the specified snapshot.
627.sp
628The \fIsnapshot\fR may be specified as a short snapshot name (just the part
629after the \fB@\fR), in which case it will be interpreted as a snapshot in
630the same filesystem as this dataset.
631The \fIsnapshot\fR be a full snapshot name (\fIfilesystem\fR@\fIsnapshot\fR),
632which for clones may be a snapshot in the origin's filesystem (or the origin
633of the origin's filesystem, etc).
634.RE
635
058ac9ba
BB
636.sp
637.LP
638The following native properties can be used to change the behavior of a \fBZFS\fR dataset.
639.sp
640.ne 2
641.mk
642.na
643\fB\fBaclinherit\fR=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
644.ad
645.sp .6
646.RS 4n
647Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an \fBaclinherit\fR property of \fBdiscard\fR does not inherit any \fBACL\fR entries. A file system with an \fBaclinherit\fR property value of \fBnoallow\fR only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value \fBrestricted\fR (the default) removes the \fBwrite_acl\fR and \fBwrite_owner\fR permissions when the \fBACL\fR entry is inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough\fR inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough-x\fR has the same meaning as \fBpassthrough\fR, except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit.
648.sp
649When the property value is set to \fBpassthrough\fR, files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode from the application.
650.RE
651
652.sp
653.ne 2
654.mk
655.na
656\fB\fBaclmode\fR=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR
657.ad
658.sp .6
659.RS 4n
660Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an \fBaclmode\fR property of \fBdiscard\fR deletes all \fBACL\fR entries that do not represent the mode of the file. An \fBaclmode\fR property of \fBgroupmask\fR (the default) reduces user or group permissions. The permissions are reduced, such that they are no greater than the group permission bits, unless it is a user entry that has the same \fBUID\fR as the owner of the file or directory. In this case, the \fBACL\fR permissions are reduced so that they are no greater than owner permission bits. A file system with an \fBaclmode\fR property of \fBpassthrough\fR indicates that no changes are made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
661.RE
662
663.sp
664.ne 2
665.mk
666.na
667\fB\fBatime\fR=\fBon\fR | \fBoff\fR\fR
668.ad
669.sp .6
670.RS 4n
671Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is \fBon\fR.
672.RE
673
674.sp
675.ne 2
676.mk
677.na
678\fB\fBcanmount\fR=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR
679.ad
680.sp .6
681.RS 4n
682If this property is set to \fBoff\fR, the file system cannot be mounted, and is ignored by \fBzfs mount -a\fR. Setting this property to \fBoff\fR is similar to setting the \fBmountpoint\fR property to \fBnone\fR, except that the dataset still has a normal \fBmountpoint\fR property, which can be inherited. Setting this property to \fBoff\fR allows datasets to be used solely as a mechanism to inherit properties. One example of setting \fBcanmount=\fR\fBoff\fR is to have two datasets with the same \fBmountpoint\fR, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
683.sp
684When the \fBnoauto\fR option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the \fBzfs mount -a\fR command or unmounted by the \fBzfs unmount -a\fR command.
685.sp
686This property is not inherited.
687.RE
688
689.sp
690.ne 2
691.mk
692.na
693\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2,\fR| \fBfletcher4\fR | \fBsha256\fR\fR
694.ad
695.sp .6
696.RS 4n
697Controls the checksum used to verify data integrity. The default value is \fBon\fR, which automatically selects an appropriate algorithm (currently, \fBfletcher2\fR, but this may change in future releases). The value \fBoff\fR disables integrity checking on user data. Disabling checksums is \fBNOT\fR a recommended practice.
698.sp
699Changing this property affects only newly-written data.
700.RE
701
702.sp
703.ne 2
704.mk
705.na
f4605f07 706\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBgzip\fR | \fBgzip-\fR\fIN\fR | \fBzle\fR
058ac9ba
BB
707.ad
708.sp .6
709.RS 4n
f4605f07
RL
710Controls the compression algorithm used for this dataset. The \fBlzjb\fR compression algorithm is optimized for performance while providing decent data compression. Setting compression to \fBon\fR uses the \fBlzjb\fR compression algorithm.
711.sp
712The \fBgzip\fR compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR (which is also the default for \fBgzip\fR(1)).
713.sp
714The \fBzle\fR (zero-length encoding) compression algorithm is a fast and simple algorithm to eliminate runs of zeroes.
058ac9ba
BB
715.sp
716This property can also be referred to by its shortened column name \fBcompress\fR. Changing this property affects only newly-written data.
717.RE
718
719.sp
720.ne 2
721.mk
722.na
723\fB\fBcopies\fR=\fB1\fR | \fB2\fR | \fB3\fR\fR
724.ad
725.sp .6
726.RS 4n
727Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or RAID-Z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the \fBused\fR property and counting against quotas and reservations.
728.sp
729Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the \fB-o\fR \fBcopies=\fR\fIN\fR option.
730.RE
731
732.sp
733.ne 2
734.mk
735.na
736\fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR
737.ad
738.sp .6
739.RS 4n
740Controls whether device nodes can be opened on this file system. The default value is \fBon\fR.
741.RE
742
743.sp
744.ne 2
745.mk
746.na
747\fB\fBexec\fR=\fBon\fR | \fBoff\fR\fR
748.ad
749.sp .6
750.RS 4n
751Controls whether processes can be executed from within this file system. The default value is \fBon\fR.
752.RE
753
754.sp
755.ne 2
756.mk
757.na
758\fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR
759.ad
760.sp .6
761.RS 4n
762Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used.
763.sp
764When the \fBmountpoint\fR property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is \fBlegacy\fR, then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously \fBlegacy\fR or \fBnone\fR, or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
765.RE
766
767.sp
768.ne 2
769.mk
770.na
771\fB\fBnbmand\fR=\fBon\fR | \fBoff\fR\fR
772.ad
773.sp .6
774.RS 4n
2d1b7b0b 775Controls whether the file system should be mounted with \fBnbmand\fR (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(8) for more information on \fBnbmand\fR mounts.
058ac9ba
BB
776.RE
777
778.sp
779.ne 2
780.mk
781.na
782\fB\fBprimarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
783.ad
784.sp .6
785.RS 4n
786Controls what is cached in the primary cache (ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
787.RE
788
789.sp
790.ne 2
791.mk
792.na
793\fB\fBquota\fR=\fIsize\fR | \fBnone\fR\fR
794.ad
795.sp .6
796.RS 4n
797Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit.
798.sp
799Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an implicit quota.
800.RE
801
802.sp
803.ne 2
804.mk
805.na
806\fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR
807.ad
808.sp .6
809.RS 4n
810Limits the amount of space consumed by the specified user. User space consumption is identified by the \fBuserspace@\fR\fIuser\fR property.
811.sp
812Enforcement of user quotas may be delayed by several seconds. This delay means that a user might exceed their quota before the system notices that they are over quota and begins to refuse additional writes with the \fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more information.
813.sp
814Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs allow\fR, can get and set everyone's quota.
815.sp
816This property is not available on volumes, on file systems before version 4, or on pools before version 15. The \fBuserquota@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
817.RS +4
818.TP
819.ie t \(bu
820.el o
821\fIPOSIX name\fR (for example, \fBjoe\fR)
822.RE
823.RS +4
824.TP
825.ie t \(bu
826.el o
827\fIPOSIX numeric ID\fR (for example, \fB789\fR)
828.RE
829.RS +4
830.TP
831.ie t \(bu
832.el o
833\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
834.RE
835.RS +4
836.TP
837.ie t \(bu
838.el o
839\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
840.RE
841.RE
842
843.sp
844.ne 2
845.mk
846.na
847\fB\fBgroupquota@\fR\fIgroup\fR=\fIsize\fR | \fBnone\fR\fR
848.ad
849.sp .6
850.RS 4n
851Limits the amount of space consumed by the specified group. Group space consumption is identified by the \fBuserquota@\fR\fIuser\fR property.
852.sp
853Unprivileged users can access only their own groups' space usage. The root user, or a user who has been granted the \fBgroupquota\fR privilege with \fBzfs allow\fR, can get and set all groups' quotas.
854.RE
855
856.sp
857.ne 2
858.mk
859.na
860\fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
861.ad
862.sp .6
863.RS 4n
864Controls whether this dataset can be modified. The default value is \fBoff\fR.
865.sp
866This property can also be referred to by its shortened column name, \fBrdonly\fR.
867.RE
868
869.sp
870.ne 2
871.mk
872.na
873\fB\fBrecordsize\fR=\fIsize\fR\fR
874.ad
875.sp .6
876.RS 4n
877Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical access patterns.
878.sp
879For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a \fBrecordsize\fR greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance.
880.sp
881The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
882.sp
883Changing the file system's \fBrecordsize\fR affects only files created afterward; existing files are unaffected.
884.sp
885This property can also be referred to by its shortened column name, \fBrecsize\fR.
886.RE
887
888.sp
889.ne 2
890.mk
891.na
892\fB\fBrefquota\fR=\fIsize\fR | \fBnone\fR\fR
893.ad
894.sp .6
895.RS 4n
896Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used by descendents, including file systems and snapshots.
897.RE
898
899.sp
900.ne 2
901.mk
902.na
903\fB\fBrefreservation\fR=\fIsize\fR | \fBnone\fR\fR
904.ad
905.sp .6
906.RS 4n
907The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
908.sp
909If \fBrefreservation\fR is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
910.sp
911This property can also be referred to by its shortened column name, \fBrefreserv\fR.
912.RE
913
914.sp
915.ne 2
916.mk
917.na
918\fB\fBreservation\fR=\fIsize\fR | \fBnone\fR\fR
919.ad
920.sp .6
921.RS 4n
922The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
923.sp
924This property can also be referred to by its shortened column name, \fBreserv\fR.
925.RE
926
927.sp
928.ne 2
929.mk
930.na
931\fB\fBsecondarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
932.ad
933.sp .6
934.RS 4n
935Controls what is cached in the secondary cache (L2ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
936.RE
937
938.sp
939.ne 2
940.mk
941.na
942\fB\fBsetuid\fR=\fBon\fR | \fBoff\fR\fR
943.ad
944.sp .6
945.RS 4n
946Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is \fBon\fR.
947.RE
948
949.sp
950.ne 2
951.mk
952.na
953\fB\fBshareiscsi\fR=\fBon\fR | \fBoff\fR\fR
954.ad
955.sp .6
956.RS 4n
957Like the \fBsharenfs\fR property, \fBshareiscsi\fR indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are \fBon\fR, \fBoff\fR, and \fBtype=disk\fR. The default value is \fBoff\fR. In the future, other target types might be supported. For example, \fBtape\fR.
958.sp
959You might want to set \fBshareiscsi=on\fR for a file system so that all \fBZFS\fR volumes within the file system are shared by default. However, setting this property on a file system has no direct effect.
960.RE
961
962.sp
963.ne 2
964.mk
965.na
966\fB\fBsharesmb\fR=\fBon\fR | \fBoff\fR | \fIopts\fR\fR
967.ad
968.sp .6
969.RS 4n
970Controls whether the file system is shared by using the Solaris \fBCIFS\fR service, and what options are to be used. A file system with the \fBsharesmb\fR property set to \fBoff\fR is managed through traditional tools such as \fBsharemgr\fR(1M). Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the \fBsharemgr\fR(1M) command is invoked with no options. Otherwise, the \fBsharemgr\fR(1M) command is invoked with options equivalent to the contents of this property.
971.sp
972Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore (\fB_\fR) characters. A pseudo property "name" is also supported that allows you to replace the data set name with a specified name. The specified name is then used to replace the prefix dataset in the case of inheritance. For example, if the dataset \fBdata/home/john\fR is set to \fBname=john\fR, then \fBdata/home/john\fR has a resource name of \fBjohn\fR. If a child dataset of \fBdata/home/john/backups\fR, it has a resource name of \fBjohn_backups\fR.
973.sp
974When SMB shares are created, the SMB share name appears as an entry in the \fB\&.zfs/shares\fR directory. You can use the \fBls\fR or \fBchmod\fR command to display the share-level ACLs on the entries in this directory.
975.sp
976When the \fBsharesmb\fR property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously set to \fBoff\fR, or if they were shared before the property was changed. If the new property is set to \fBoff\fR, the file systems are unshared.
977.RE
978
979.sp
980.ne 2
981.mk
982.na
983\fB\fBsharenfs\fR=\fBon\fR | \fBoff\fR | \fIopts\fR\fR
984.ad
985.sp .6
986.RS 4n
987Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a \fBsharenfs\fR property of \fBoff\fR is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
988.sp
989When the \fBsharenfs\fR property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously \fBoff\fR, or if they were shared before the property was changed. If the new property is \fBoff\fR, the file systems are unshared.
990.RE
991
992.sp
993.ne 2
994.mk
995.na
996\fB\fBlogbias\fR = \fBlatency\fR | \fBthroughput\fR\fR
997.ad
998.sp .6
999.RS 4n
1000Provide a hint to ZFS about handling of synchronous requests in this dataset. If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS will use pool log devices (if configured) to handle the requests at low latency. If \fBlogbias\fR is set to \fBthroughput\fR, ZFS will not use configured pool log devices. ZFS will instead optimize synchronous operations for global pool throughput and efficient use of resources.
1001.RE
1002
1003.sp
1004.ne 2
1005.mk
1006.na
1007\fB\fBsnapdir\fR=\fBhidden\fR | \fBvisible\fR\fR
1008.ad
1009.sp .6
1010.RS 4n
1011Controls whether the \fB\&.zfs\fR directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is \fBhidden\fR.
1012.RE
1013
1014.sp
1015.ne 2
1016.mk
1017.na
330d06f9
MA
1018\fB\fBsync\fR=\fBdefault\fR | \fBalways\fR | \fBdisabled\fR\fR
1019.ad
1020.sp .6
1021.RS 4n
1022Controls the behavior of synchronous requests (e.g. fsync, O_DSYNC).
1023\fBdefault\fR is the POSIX specified behavior of ensuring all synchronous
1024requests are written to stable storage and all devices are flushed to ensure
1025data is not cached by device controllers (this is the default). \fBalways\fR
1026causes every file system transaction to be written and flushed before its
1027system call returns. This has a large performance penalty. \fBdisabled\fR
1028disables synchronous requests. File system transactions are only committed to
1029stable storage periodically. This option will give the highest performance.
1030However, it is very dangerous as ZFS would be ignoring the synchronous
1031transaction demands of applications such as databases or NFS. Administrators
1032should only use this option when the risks are understood.
1033.RE
1034
1035.sp
1036.ne 2
1037.na
058ac9ba
BB
1038\fB\fBversion\fR=\fB1\fR | \fB2\fR | \fBcurrent\fR\fR
1039.ad
1040.sp .6
1041.RS 4n
1042The on-disk version of this file system, which is independent of the pool version. This property can only be set to later supported versions. See the \fBzfs upgrade\fR command.
1043.RE
1044
1045.sp
1046.ne 2
1047.mk
1048.na
1049\fB\fBvolsize\fR=\fIsize\fR\fR
1050.ad
1051.sp .6
1052.RS 4n
1053For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
1054.sp
1055The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
1056.sp
1057Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the \fBzfs create -V\fR command, or by changing the reservation after the volume has been created. A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
1058.RE
1059
1060.sp
1061.ne 2
1062.mk
1063.na
1064\fB\fBvscan\fR=\fBon\fR | \fBoff\fR\fR
1065.ad
1066.sp .6
1067.RS 4n
1068Controls whether regular files should be scanned for viruses when a file is opened and closed. In addition to enabling this property, the virus scan service must also be enabled for virus scanning to occur. The default value is \fBoff\fR.
1069.RE
1070
1071.sp
1072.ne 2
1073.mk
1074.na
1075\fB\fBxattr\fR=\fBon\fR | \fBoff\fR\fR
1076.ad
1077.sp .6
1078.RS 4n
1079Controls whether extended attributes are enabled for this file system. The default value is \fBon\fR.
1080.RE
1081
1082.sp
1083.ne 2
1084.mk
1085.na
1086\fB\fBzoned\fR=\fBon\fR | \fBoff\fR\fR
1087.ad
1088.sp .6
1089.RS 4n
4da4a9e1 1090Controls whether the dataset is managed from a non-global zone. Zones are a Solaris feature and are not relevant on Linux. The default value is \fBoff\fR.
058ac9ba
BB
1091.RE
1092
1093.sp
1094.LP
1095The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the \fBzfs create\fR or \fBzpool create\fR commands, these properties are inherited from the parent dataset. If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
1096.sp
1097.ne 2
1098.mk
1099.na
1100\fB\fBcasesensitivity\fR=\fBsensitive\fR | \fBinsensitive\fR | \fBmixed\fR\fR
1101.ad
1102.sp .6
1103.RS 4n
1104Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the \fBcasesensitivity\fR property is \fBsensitive\fR. Traditionally, UNIX and POSIX file systems have case-sensitive file names.
1105.sp
1106The \fBmixed\fR value for the \fBcasesensitivity\fR property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the \fBmixed\fR value behavior, see the \fISolaris ZFS Administration Guide\fR.
1107.RE
1108
1109.sp
1110.ne 2
1111.mk
1112.na
1113\fB\fBnormalization\fR = \fBnone\fR | \fBformC\fR | \fBformD\fR | \fBformKC\fR | \fBformKD\fR\fR
1114.ad
1115.sp .6
1116.RS 4n
1117Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison process. If this property is set to a legal value other than \fBnone\fR, and the \fButf8only\fR property was left unspecified, the \fButf8only\fR property is automatically set to \fBon\fR. The default value of the \fBnormalization\fR property is \fBnone\fR. This property cannot be changed after the file system is created.
1118.RE
1119
1120.sp
1121.ne 2
1122.mk
1123.na
1124\fB\fButf8only\fR=\fBon\fR | \fBoff\fR\fR
1125.ad
1126.sp .6
1127.RS 4n
1128Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to \fBoff\fR, the normalization property must either not be explicitly set or be set to \fBnone\fR. The default value for the \fButf8only\fR property is \fBoff\fR. This property cannot be changed after the file system is created.
1129.RE
1130
1131.sp
1132.LP
1133The \fBcasesensitivity\fR, \fBnormalization\fR, and \fButf8only\fR properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration feature.
1134.SS "Temporary Mount Point Properties"
1135.sp
1136.LP
2d1b7b0b 1137When a file system is mounted, either through \fBmount\fR(8) for legacy mounts or the \fBzfs mount\fR command for normal file systems, its mount options are set according to its properties. The correlation between properties and mount options is as follows:
058ac9ba
BB
1138.sp
1139.in +2
1140.nf
1141 PROPERTY MOUNT OPTION
1142 devices devices/nodevices
1143 exec exec/noexec
1144 readonly ro/rw
1145 setuid setuid/nosetuid
1146 xattr xattr/noxattr
1147.fi
1148.in -2
1149.sp
1150
1151.sp
1152.LP
1153In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for \fBnodevices,nosetuid\fR. These properties are reported as "temporary" by the \fBzfs get\fR command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
1154.SS "User Properties"
1155.sp
1156.LP
1157In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets (file systems, volumes, and snapshots).
1158.sp
1159.LP
1160User property names must contain a colon (\fB:\fR) character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (\fB:\fR), dash (\fB-\fR), period (\fB\&.\fR), and underscore (\fB_\fR). The expected convention is that the property name is divided into two portions such as \fImodule\fR\fB:\fR\fIproperty\fR, but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters, and cannot begin with a dash (\fB-\fR).
1161.sp
1162.LP
4da4a9e1 1163When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for different purposes. For example, property names beginning with \fBcom.sun\fR. are reserved for use by Oracle Corporation (which acquired Sun Microsystems).
058ac9ba
BB
1164.sp
1165.LP
1166The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties (\fBzfs list\fR, \fBzfs get\fR, \fBzfs set\fR, and so forth) can be used to manipulate both native properties and user properties. Use the \fBzfs inherit\fR command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
4da4a9e1 1167.SS "ZFS Volumes as Swap"
058ac9ba
BB
1168.sp
1169.LP
4da4a9e1 1170Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
058ac9ba
BB
1171.SH SUBCOMMANDS
1172.sp
1173.LP
1174All subcommands that modify state are logged persistently to the pool in their original form.
1175.sp
1176.ne 2
1177.mk
1178.na
1179\fB\fBzfs ?\fR\fR
1180.ad
1181.sp .6
1182.RS 4n
1183Displays a help message.
1184.RE
1185
1186.sp
1187.ne 2
1188.mk
1189.na
1190\fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR\fR
1191.ad
1192.sp .6
1193.RS 4n
1194Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the \fBmountpoint\fR property inherited from the parent.
1195.sp
1196.ne 2
1197.mk
1198.na
1199\fB\fB-p\fR\fR
1200.ad
1201.sp .6
1202.RS 4n
1203Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
1204.RE
1205
1206.sp
1207.ne 2
1208.mk
1209.na
1210\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1211.ad
1212.sp .6
1213.RS 4n
1214Sets the specified property as if the command \fBzfs set\fR \fIproperty\fR=\fIvalue\fR was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
1215.RE
1216
1217.RE
1218
1219.sp
1220.ne 2
1221.mk
1222.na
1223\fB\fBzfs create\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR\fR
1224.ad
1225.sp .6
1226.RS 4n
1fe2e237 1227Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/\fR\fIpath\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
058ac9ba
BB
1228.sp
1229\fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
1230.sp
1231.ne 2
1232.mk
1233.na
1234\fB\fB-p\fR\fR
1235.ad
1236.sp .6
1237.RS 4n
1238Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
1239.RE
1240
1241.sp
1242.ne 2
1243.mk
1244.na
1245\fB\fB-s\fR\fR
1246.ad
1247.sp .6
1248.RS 4n
1249Creates a sparse volume with no reservation. See \fBvolsize\fR in the Native Properties section for more information about sparse volumes.
1250.RE
1251
1252.sp
1253.ne 2
1254.mk
1255.na
1256\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1257.ad
1258.sp .6
1259.RS 4n
1260Sets the specified property as if the \fBzfs set\fR \fIproperty\fR=\fIvalue\fR command was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
1261.RE
1262
1263.sp
1264.ne 2
1265.mk
1266.na
1267\fB\fB-b\fR \fIblocksize\fR\fR
1268.ad
1269.sp .6
1270.RS 4n
1271Equivalent to \fB-o\fR \fBvolblocksize\fR=\fIblocksize\fR. If this option is specified in conjunction with \fB-o\fR \fBvolblocksize\fR, the resulting behavior is undefined.
1272.RE
1273
1274.RE
1275
1276.sp
1277.ne 2
1278.mk
1279.na
330d06f9 1280\fBzfs destroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
058ac9ba
BB
1281.ad
1282.sp .6
1283.RS 4n
1284Destroys the given dataset. By default, the command unshares any file systems that are currently shared, unmounts any file systems that are currently mounted, and refuses to destroy a dataset that has active dependents (children or clones).
1285.sp
1286.ne 2
1287.mk
1288.na
1289\fB\fB-r\fR\fR
1290.ad
1291.sp .6
1292.RS 4n
1293Recursively destroy all children.
1294.RE
1295
1296.sp
1297.ne 2
1298.mk
1299.na
1300\fB\fB-R\fR\fR
1301.ad
1302.sp .6
1303.RS 4n
1304Recursively destroy all dependents, including cloned file systems outside the target hierarchy.
1305.RE
1306
1307.sp
1308.ne 2
1309.mk
1310.na
1311\fB\fB-f\fR\fR
1312.ad
1313.sp .6
1314.RS 4n
1315Force an unmount of any file systems using the \fBunmount -f\fR command. This option has no effect on non-file systems or unmounted file systems.
1316.RE
1317
330d06f9
MA
1318.sp
1319.ne 2
1320.na
1321\fB\fB-n\fR\fR
1322.ad
1323.sp .6
1324.RS 4n
1325Do a dry-run ("No-op") deletion. No data will be deleted. This is
1326useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
1327data would be deleted.
1328.RE
1329
1330.sp
1331.ne 2
1332.na
1333\fB\fB-p\fR\fR
1334.ad
1335.sp .6
1336.RS 4n
1337Print machine-parsable verbose information about the deleted data.
1338.RE
1339
1340.sp
1341.ne 2
1342.na
1343\fB\fB-v\fR\fR
1344.ad
1345.sp .6
1346.RS 4n
1347Print verbose information about the deleted data.
1348.RE
1349.sp
1350
f5fc4aca 1351Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use.
058ac9ba
BB
1352.RE
1353
1354.sp
1355.ne 2
1356.mk
1357.na
330d06f9 1358\fBzfs destroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
058ac9ba
BB
1359.ad
1360.sp .6
1361.RS 4n
330d06f9
MA
1362The given snapshots are destroyed immediately if and only if the \fBzfs destroy\fR command without the \fB-d\fR option would have destroyed it. Such immediate destruction would occur, for example, if the snapshot had no clones and the user-initiated reference count were zero.
1363.sp
1364If a snapshot does not qualify for immediate destruction, it is marked for deferred destruction. In this state, it exists as a usable, visible snapshot until both of the preconditions listed above are met, at which point it is destroyed.
1365.sp
1366An inclusive range of snapshots may be specified by separating the
1367first and last snapshots with a percent sign.
1368The first and/or last snapshots may be left blank, in which case the
1369filesystem's oldest or newest snapshot will be implied.
058ac9ba 1370.sp
330d06f9
MA
1371Multiple snapshots
1372(or ranges of snapshots) of the same filesystem or volume may be specified
1373in a comma-separated list of snapshots.
1374Only the snapshot's short name (the
1375part after the \fB@\fR) should be specified when using a range or
1376comma-separated list to identify multiple snapshots.
058ac9ba
BB
1377.sp
1378.ne 2
1379.mk
1380.na
1381\fB\fB-d\fR\fR
1382.ad
1383.sp .6
1384.RS 4n
1385Defer snapshot deletion.
1386.RE
1387
1388.sp
1389.ne 2
1390.mk
1391.na
1392\fB\fB-r\fR\fR
1393.ad
1394.sp .6
1395.RS 4n
3b204150 1396Destroy (or mark for deferred destruction) all snapshots with this name in descendent file systems.
058ac9ba
BB
1397.RE
1398
1399.sp
1400.ne 2
1401.mk
1402.na
1403\fB\fB-R\fR\fR
1404.ad
1405.sp .6
1406.RS 4n
1407Recursively destroy all dependents.
1408.RE
1409
330d06f9
MA
1410.sp
1411.ne 2
1412.na
1413\fB\fB-n\fR\fR
1414.ad
1415.sp .6
1416.RS 4n
1417Do a dry-run ("No-op") deletion. No data will be deleted. This is
1418useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
1419data would be deleted.
1420.RE
1421
1422.sp
1423.ne 2
1424.na
1425\fB\fB-p\fR\fR
1426.ad
1427.sp .6
1428.RS 4n
1429Print machine-parsable verbose information about the deleted data.
1430.RE
1431
1432.sp
1433.ne 2
1434.na
1435\fB\fB-v\fR\fR
1436.ad
1437.sp .6
1438.RS 4n
1439Print verbose information about the deleted data.
1440.RE
1441
1442.sp
1443Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR
1444options, as they can destroy large portions of a pool and cause unexpected
1445behavior for mounted file systems in use.
1446.RE
1447
058ac9ba
BB
1448.RE
1449
1450.sp
1451.ne 2
1452.mk
1453.na
1454\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
1455.ad
1456.sp .6
1457.RS 4n
1458Creates a snapshot with the given name. All previous modifications by successful system calls to the file system are part of the snapshot. See the "Snapshots" section for details.
1459.sp
1460.ne 2
1461.mk
1462.na
1463\fB\fB-r\fR\fR
1464.ad
1465.sp .6
1466.RS 4n
1467Recursively create snapshots of all descendent datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
1468.RE
1469
1470.sp
1471.ne 2
1472.mk
1473.na
1474\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1475.ad
1476.sp .6
1477.RS 4n
1478Sets the specified property; see \fBzfs create\fR for details.
1479.RE
1480
1481.RE
1482
1483.sp
1484.ne 2
1485.mk
1486.na
1487\fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
1488.ad
1489.sp .6
1490.RS 4n
1491Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option.
1492.sp
1493The \fB-rR\fR options do not recursively destroy the child snapshots of a recursive snapshot. Only the top-level recursive snapshot is destroyed by either of these options. To completely roll back a recursive snapshot, you must rollback the individual child snapshots.
1494.sp
1495.ne 2
1496.mk
1497.na
1498\fB\fB-r\fR\fR
1499.ad
1500.sp .6
1501.RS 4n
1502Recursively destroy any snapshots more recent than the one specified.
1503.RE
1504
1505.sp
1506.ne 2
1507.mk
1508.na
1509\fB\fB-R\fR\fR
1510.ad
1511.sp .6
1512.RS 4n
1513Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
1514.RE
1515
1516.sp
1517.ne 2
1518.mk
1519.na
1520\fB\fB-f\fR\fR
1521.ad
1522.sp .6
1523.RS 4n
1524Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
1525.RE
1526
1527.RE
1528
1529.sp
1530.ne 2
1531.mk
1532.na
1533\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
1534.ad
1535.sp .6
1536.RS 4n
1537Creates a clone of the given snapshot. See the "Clones" section for details. The target dataset can be located anywhere in the \fBZFS\fR hierarchy, and is created as the same type as the original.
1538.sp
1539.ne 2
1540.mk
1541.na
1542\fB\fB-p\fR\fR
1543.ad
1544.sp .6
1545.RS 4n
1546Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
1547.RE
1548
1549.sp
1550.ne 2
1551.mk
1552.na
1553\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1554.ad
1555.sp .6
1556.RS 4n
1557Sets the specified property; see \fBzfs create\fR for details.
1558.RE
1559
1560.RE
1561
1562.sp
1563.ne 2
1564.mk
1565.na
1566\fB\fBzfs promote\fR \fIclone-filesystem\fR\fR
1567.ad
1568.sp .6
1569.RS 4n
1570Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the origin file system becomes a clone of the specified file system.
1571.sp
1572The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the origin file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The \fBrename\fR subcommand can be used to rename any conflicting snapshots.
1573.RE
1574
1575.sp
1576.ne 2
1577.mk
1578.na
db49968e 1579\fB\fBzfs rename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
058ac9ba
BB
1580.ad
1581.br
1582.na
1583\fB\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1584.ad
1585.br
1586.na
db49968e 1587\fB\fBzfs rename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
058ac9ba
BB
1588.ad
1589.sp .6
1590.RS 4n
1591Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
1592.sp
1593.ne 2
1594.mk
1595.na
1596\fB\fB-p\fR\fR
1597.ad
1598.sp .6
1599.RS 4n
1600Creates all the nonexistent parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent.
1601.RE
1602
db49968e
ES
1603.sp
1604.ne 2
1605.na
1606\fB\fB-f\fR\fR
1607.ad
1608.sp .6
1609.RS 4n
1610Force unmount any filesystems that need to be unmounted in the process.
1611.RE
1612
058ac9ba
BB
1613.RE
1614
1615.sp
1616.ne 2
1617.mk
1618.na
1619\fB\fBzfs rename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR\fR
1620.ad
1621.sp .6
1622.RS 4n
1623Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively.
1624.RE
1625
1626.sp
1627.ne 2
1628.mk
1629.na
cf81b00a 1630\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-H\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fIsnap\fR] ...\fR
058ac9ba
BB
1631.ad
1632.sp .6
1633.RS 4n
1634Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all file systems and volumes are displayed. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR (the default is \fBoff\fR) . The following fields are displayed, \fBname,used,available,referenced,mountpoint\fR.
1635.sp
1636.ne 2
1637.mk
1638.na
1639\fB\fB-H\fR\fR
1640.ad
1641.sp .6
1642.RS 4n
1643Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space.
1644.RE
1645
1646.sp
1647.ne 2
1648.mk
1649.na
1650\fB\fB-r\fR\fR
1651.ad
1652.sp .6
1653.RS 4n
1654Recursively display any children of the dataset on the command line.
1655.RE
1656
1657.sp
1658.ne 2
1659.mk
1660.na
1661\fB\fB-d\fR \fIdepth\fR\fR
1662.ad
1663.sp .6
1664.RS 4n
1665Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
1666.RE
1667
1668.sp
1669.ne 2
1670.mk
1671.na
1672\fB\fB-o\fR \fIproperty\fR\fR
1673.ad
1674.sp .6
1675.RS 4n
1676A comma-separated list of properties to display. The property must be:
1677.RS +4
1678.TP
1679.ie t \(bu
1680.el o
1681One of the properties described in the "Native Properties" section
1682.RE
1683.RS +4
1684.TP
1685.ie t \(bu
1686.el o
1687A user property
1688.RE
1689.RS +4
1690.TP
1691.ie t \(bu
1692.el o
1693The value \fBname\fR to display the dataset name
1694.RE
1695.RS +4
1696.TP
1697.ie t \(bu
1698.el o
1699The value \fBspace\fR to display space usage properties on file systems and volumes. This is a shortcut for specifying \fB-o name,avail,used,usedsnap,usedds,usedrefreserv,usedchild\fR \fB-t filesystem,volume\fR syntax.
1700.RE
1701.RE
1702
1703.sp
1704.ne 2
1705.mk
1706.na
1707\fB\fB-s\fR \fIproperty\fR\fR
1708.ad
1709.sp .6
1710.RS 4n
1711A property for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in the "Properties" section, or the special value \fBname\fR to sort by the dataset name. Multiple properties can be specified at one time using multiple \fB-s\fR property options. Multiple \fB-s\fR options are evaluated from left to right in decreasing order of importance.
1712.sp
1713The following is a list of sorting criteria:
1714.RS +4
1715.TP
1716.ie t \(bu
1717.el o
1718Numeric types sort in numeric order.
1719.RE
1720.RS +4
1721.TP
1722.ie t \(bu
1723.el o
1724String types sort in alphabetical order.
1725.RE
1726.RS +4
1727.TP
1728.ie t \(bu
1729.el o
1730Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
1731.RE
1732.RS +4
1733.TP
1734.ie t \(bu
1735.el o
1736If no sorting options are specified the existing behavior of \fBzfs list\fR is preserved.
1737.RE
1738.RE
1739
1740.sp
1741.ne 2
1742.mk
1743.na
1744\fB\fB-S\fR \fIproperty\fR\fR
1745.ad
1746.sp .6
1747.RS 4n
1748Same as the \fB-s\fR option, but sorts by property in descending order.
1749.RE
1750
1751.sp
1752.ne 2
1753.mk
1754.na
1755\fB\fB-t\fR \fItype\fR\fR
1756.ad
1757.sp .6
1758.RS 4n
1759A comma-separated list of types to display, where \fItype\fR is one of \fBfilesystem\fR, \fBsnapshot\fR , \fBvolume\fR, or \fBall\fR. For example, specifying \fB-t snapshot\fR displays only snapshots.
1760.RE
1761
1762.RE
1763
1764.sp
1765.ne 2
1766.mk
1767.na
1768\fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1769.ad
1770.sp .6
1771.RS 4n
1772Sets the property to the given value for each dataset. Only some properties can be edited. See the "Properties" section for more information on what properties can be set and acceptable values. Numeric values can be specified as exact values, or in a human-readable form with a suffix of \fBB\fR, \fBK\fR, \fBM\fR, \fBG\fR, \fBT\fR, \fBP\fR, \fBE\fR, \fBZ\fR (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). User properties can be set on snapshots. For more information, see the "User Properties" section.
1773.RE
1774
1775.sp
1776.ne 2
1777.mk
1778.na
e346ec25 1779\fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR \fIfield\fR[,...] [\fB-t\fR \fItype\fR[,...]] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
058ac9ba
BB
1780.ad
1781.sp .6
1782.RS 4n
1783Displays properties for the given datasets. If no datasets are specified, then the command displays properties for all datasets on the system. For each property, the following columns are displayed:
1784.sp
1785.in +2
1786.nf
1787 name Dataset name
1788 property Property name
1789 value Property value
1790 source Property source. Can either be local, default,
1791 temporary, inherited, or none (-).
1792.fi
1793.in -2
1794.sp
1795
1796All columns are displayed by default, though this can be controlled by using the \fB-o\fR option. This command takes a comma-separated list of properties as described in the "Native Properties" and "User Properties" sections.
1797.sp
1798The special value \fBall\fR can be used to display all properties that apply to the given dataset's type (filesystem, volume, or snapshot).
1799.sp
1800.ne 2
1801.mk
1802.na
1803\fB\fB-r\fR\fR
1804.ad
1805.sp .6
1806.RS 4n
1807Recursively display properties for any children.
1808.RE
1809
1810.sp
1811.ne 2
1812.mk
1813.na
1814\fB\fB-d\fR \fIdepth\fR\fR
1815.ad
1816.sp .6
1817.RS 4n
1818Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
1819.RE
1820
1821.sp
1822.ne 2
1823.mk
1824.na
1825\fB\fB-H\fR\fR
1826.ad
1827.sp .6
1828.RS 4n
1829Display output in a form more easily parsed by scripts. Any headers are omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space.
1830.RE
1831
1832.sp
1833.ne 2
1834.mk
1835.na
1836\fB\fB-o\fR \fIfield\fR\fR
1837.ad
1838.sp .6
1839.RS 4n
1840A comma-separated list of columns to display. \fBname,property,value,source\fR is the default value.
1841.RE
1842
1843.sp
1844.ne 2
1845.mk
1846.na
1847\fB\fB-s\fR \fIsource\fR\fR
1848.ad
1849.sp .6
1850.RS 4n
1851A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following: \fBlocal,default,inherited,temporary,none\fR. The default value is all sources.
1852.RE
1853
1854.sp
1855.ne 2
1856.mk
1857.na
1858\fB\fB-p\fR\fR
1859.ad
1860.sp .6
1861.RS 4n
1862Display numbers in parseable (exact) values.
1863.RE
1864
1865.RE
1866
1867.sp
1868.ne 2
1869.mk
1870.na
1871\fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1872.ad
1873.sp .6
1874.RS 4n
1875Clears the specified property, causing it to be inherited from an ancestor. If no ancestor has the property set, then the default value is used. See the "Properties" section for a listing of default values, and details on which properties can be inherited.
1876.sp
1877.ne 2
1878.mk
1879.na
1880\fB\fB-r\fR\fR
1881.ad
1882.sp .6
1883.RS 4n
1884Recursively inherit the given property for all children.
1885.RE
1886
1887.RE
1888
1889.sp
1890.ne 2
1891.mk
1892.na
1893\fB\fBzfs upgrade\fR [\fB-v\fR]\fR
1894.ad
1895.sp .6
1896.RS 4n
1897Displays a list of file systems that are not the most recent version.
1898.RE
1899
1900.sp
1901.ne 2
1902.mk
1903.na
1904\fB\fBzfs upgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] [\fB-a\fR | \fIfilesystem\fR]\fR
1905.ad
1906.sp .6
1907.RS 4n
1908Upgrades file systems to a new on-disk version. Once this is done, the file systems will no longer be accessible on systems running older versions of the software. \fBzfs send\fR streams generated from new snapshots of these file systems cannot be accessed on systems running older versions of the software.
1909.sp
2d1b7b0b 1910In general, the file system version is independent of the pool version. See \fBzpool\fR(8) for information on the \fBzpool upgrade\fR command.
058ac9ba
BB
1911.sp
1912In some cases, the file system version and the pool version are interrelated and the pool version must be upgraded before the file system version can be upgraded.
1913.sp
1914.ne 2
1915.mk
1916.na
1917\fB\fB-a\fR\fR
1918.ad
1919.sp .6
1920.RS 4n
1921Upgrade all file systems on all imported pools.
1922.RE
1923
1924.sp
1925.ne 2
1926.mk
1927.na
1928\fB\fIfilesystem\fR\fR
1929.ad
1930.sp .6
1931.RS 4n
1932Upgrade the specified file system.
1933.RE
1934
1935.sp
1936.ne 2
1937.mk
1938.na
1939\fB\fB-r\fR\fR
1940.ad
1941.sp .6
1942.RS 4n
1943Upgrade the specified file system and all descendent file systems
1944.RE
1945
1946.sp
1947.ne 2
1948.mk
1949.na
1950\fB\fB-V\fR \fIversion\fR\fR
1951.ad
1952.sp .6
1953.RS 4n
1954Upgrade to the specified \fIversion\fR. If the \fB-V\fR flag is not specified, this command upgrades to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software.
1955.RE
1956
1957.RE
1958
1959.sp
1960.ne 2
1961.mk
1962.na
1963\fB\fBzfs userspace\fR [\fB-niHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-sS\fR \fIfield\fR]... [\fB-t\fR \fItype\fR [,...]] \fIfilesystem\fR | \fIsnapshot\fR\fR
1964.ad
1965.sp .6
1966.RS 4n
1967Displays space consumed by, and quotas on, each user in the specified filesystem or snapshot. This corresponds to the \fBuserused@\fR\fIuser\fR and \fBuserquota@\fR\fIuser\fR properties.
1968.sp
1969.ne 2
1970.mk
1971.na
1972\fB\fB-n\fR\fR
1973.ad
1974.sp .6
1975.RS 4n
1976Print numeric ID instead of user/group name.
1977.RE
1978
1979.sp
1980.ne 2
1981.mk
1982.na
1983\fB\fB-H\fR\fR
1984.ad
1985.sp .6
1986.RS 4n
1987Do not print headers, use tab-delimited output.
1988.RE
1989
1990.sp
1991.ne 2
1992.mk
1993.na
1994\fB\fB-p\fR\fR
1995.ad
1996.sp .6
1997.RS 4n
1998Use exact (parseable) numeric output.
1999.RE
2000
2001.sp
2002.ne 2
2003.mk
2004.na
2005\fB\fB-o\fR \fIfield\fR[,...]\fR
2006.ad
2007.sp .6
2008.RS 4n
2009Display only the specified fields from the following set, \fBtype,name,used,quota\fR.The default is to display all fields.
2010.RE
2011
2012.sp
2013.ne 2
2014.mk
2015.na
2016\fB\fB-s\fR \fIfield\fR\fR
2017.ad
2018.sp .6
2019.RS 4n
2020Sort output by this field. The \fIs\fR and \fIS\fR flags may be specified multiple times to sort first by one field, then by another. The default is \fB-s type\fR \fB-s name\fR.
2021.RE
2022
2023.sp
2024.ne 2
2025.mk
2026.na
2027\fB\fB-S\fR \fIfield\fR\fR
2028.ad
2029.sp .6
2030.RS 4n
2031Sort by this field in reverse order. See \fB-s\fR.
2032.RE
2033
2034.sp
2035.ne 2
2036.mk
2037.na
2038\fB\fB-t\fR \fItype\fR[,...]\fR
2039.ad
2040.sp .6
2041.RS 4n
2042Print only the specified types from the following set, \fBall,posixuser,smbuser,posixgroup,smbgroup\fR.
2043.sp
2044The default is \fB-t posixuser,smbuser\fR
2045.sp
2046The default can be changed to include group types.
2047.RE
2048
2049.sp
2050.ne 2
2051.mk
2052.na
2053\fB\fB-i\fR\fR
2054.ad
2055.sp .6
2056.RS 4n
2057Translate SID to POSIX ID. The POSIX ID may be ephemeral if no mapping exists. Normal POSIX interfaces (for example, \fBstat\fR(2), \fBls\fR \fB-l\fR) perform this translation, so the \fB-i\fR option allows the output from \fBzfs userspace\fR to be compared directly with those utilities. However, \fB-i\fR may lead to confusion if some files were created by an SMB user before a SMB-to-POSIX name mapping was established. In such a case, some files are owned by the SMB entity and some by the POSIX entity. However, the \fB-i\fR option will report that the POSIX entity has the total usage and quota for both.
2058.RE
2059
2060.RE
2061
2062.sp
2063.ne 2
2064.mk
2065.na
2066\fB\fBzfs groupspace\fR [\fB-niHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-sS\fR \fIfield\fR]... [\fB-t\fR \fItype\fR [,...]] \fIfilesystem\fR | \fIsnapshot\fR\fR
2067.ad
2068.sp .6
2069.RS 4n
2070Displays space consumed by, and quotas on, each group in the specified filesystem or snapshot. This subcommand is identical to \fBzfs userspace\fR, except that the default types to display are \fB-t posixgroup,smbgroup\fR.
2071.sp
2072.in +2
2073.nf
2074-
2075.fi
2076.in -2
2077.sp
2078
2079.RE
2080
2081.sp
2082.ne 2
2083.mk
2084.na
2085\fB\fBzfs mount\fR\fR
2086.ad
2087.sp .6
2088.RS 4n
2089Displays all \fBZFS\fR file systems currently mounted.
2090.RE
2091
2092.sp
2093.ne 2
2094.mk
2095.na
2096\fB\fBzfs mount\fR [\fB-vO\fR] [\fB-o\fR \fIoptions\fR] \fB-a\fR | \fIfilesystem\fR\fR
2097.ad
2098.sp .6
2099.RS 4n
2100Mounts \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2101.sp
2102.ne 2
2103.mk
2104.na
2105\fB\fB-o\fR \fIoptions\fR\fR
2106.ad
2107.sp .6
2108.RS 4n
2109An optional, comma-separated list of mount options to use temporarily for the duration of the mount. See the "Temporary Mount Point Properties" section for details.
2110.RE
2111
2112.sp
2113.ne 2
2114.mk
2115.na
2116\fB\fB-O\fR\fR
2117.ad
2118.sp .6
2119.RS 4n
2d1b7b0b 2120Perform an overlay mount. See \fBmount\fR(8) for more information.
058ac9ba
BB
2121.RE
2122
2123.sp
2124.ne 2
2125.mk
2126.na
2127\fB\fB-v\fR\fR
2128.ad
2129.sp .6
2130.RS 4n
2131Report mount progress.
2132.RE
2133
2134.sp
2135.ne 2
2136.mk
2137.na
2138\fB\fB-a\fR\fR
2139.ad
2140.sp .6
2141.RS 4n
2142Mount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2143.RE
2144
2145.sp
2146.ne 2
2147.mk
2148.na
2149\fB\fIfilesystem\fR\fR
2150.ad
2151.sp .6
2152.RS 4n
2153Mount the specified filesystem.
2154.RE
2155
2156.RE
2157
2158.sp
2159.ne 2
2160.mk
2161.na
2162\fB\fBzfs unmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
2163.ad
2164.sp .6
2165.RS 4n
2166Unmounts currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
2167.sp
2168.ne 2
2169.mk
2170.na
2171\fB\fB-f\fR\fR
2172.ad
2173.sp .6
2174.RS 4n
2175Forcefully unmount the file system, even if it is currently in use.
2176.RE
2177
2178.sp
2179.ne 2
2180.mk
2181.na
2182\fB\fB-a\fR\fR
2183.ad
2184.sp .6
2185.RS 4n
2186Unmount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2187.RE
2188
2189.sp
2190.ne 2
2191.mk
2192.na
2193\fB\fIfilesystem\fR|\fImountpoint\fR\fR
2194.ad
2195.sp .6
2196.RS 4n
2197Unmount the specified filesystem. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
2198.RE
2199
2200.RE
2201
2202.sp
2203.ne 2
2204.mk
2205.na
2206\fB\fBzfs share\fR \fB-a\fR | \fIfilesystem\fR\fR
2207.ad
2208.sp .6
2209.RS 4n
2210Shares available \fBZFS\fR file systems.
2211.sp
2212.ne 2
2213.mk
2214.na
2215\fB\fB-a\fR\fR
2216.ad
2217.sp .6
2218.RS 4n
2219Share all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2220.RE
2221
2222.sp
2223.ne 2
2224.mk
2225.na
2226\fB\fIfilesystem\fR\fR
2227.ad
2228.sp .6
2229.RS 4n
2230Share the specified filesystem according to the \fBsharenfs\fR and \fBsharesmb\fR properties. File systems are shared when the \fBsharenfs\fR or \fBsharesmb\fR property is set.
2231.RE
2232
2233.RE
2234
2235.sp
2236.ne 2
2237.mk
2238.na
2239\fB\fBzfs unshare\fR \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
2240.ad
2241.sp .6
2242.RS 4n
2243Unshares currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
2244.sp
2245.ne 2
2246.mk
2247.na
2248\fB\fB-a\fR\fR
2249.ad
2250.sp .6
2251.RS 4n
2252Unshare all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
2253.RE
2254
2255.sp
2256.ne 2
2257.mk
2258.na
2259\fB\fIfilesystem\fR|\fImountpoint\fR\fR
2260.ad
2261.sp .6
2262.RS 4n
2263Unshare the specified filesystem. The command can also be given a path to a \fBZFS\fR file system shared on the system.
2264.RE
2265
2266.RE
2267
2268.sp
2269.ne 2
2270.mk
2271.na
330d06f9 2272\fBzfs send\fR [\fB-DnPpRrv\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
058ac9ba
BB
2273.ad
2274.sp .6
2275.RS 4n
2276Creates a stream representation of the second \fIsnapshot\fR, which is written to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated.
2277.sp
2278.ne 2
2279.mk
2280.na
2281\fB\fB-i\fR \fIsnapshot\fR\fR
2282.ad
2283.sp .6
2284.RS 4n
2285Generate an incremental stream from the first \fIsnapshot\fR to the second \fIsnapshot\fR. The incremental source (the first \fIsnapshot\fR) can be specified as the last component of the snapshot name (for example, the part after the \fB@\fR), and it is assumed to be from the same file system as the second \fIsnapshot\fR.
2286.sp
2287If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, \fBpool/fs@origin\fR, not just \fB@origin\fR).
2288.RE
2289
2290.sp
2291.ne 2
2292.mk
2293.na
2294\fB\fB-I\fR \fIsnapshot\fR\fR
2295.ad
2296.sp .6
2297.RS 4n
2298Generate a stream package that sends all intermediary snapshots from the first snapshot to the second snapshot. For example, \fB-I @a fs@d\fR is similar to \fB-i @a fs@b; -i @b fs@c; -i @c fs@d\fR. The incremental source snapshot may be specified as with the \fB-i\fR option.
2299.RE
2300
e0f86c98
BB
2301.sp
2302.ne 2
2303.mk
2304.na
2305\fB\fB-v\fR\fR
2306.ad
2307.sp .6
2308.RS 4n
2309Print verbose information about the stream package generated.
2310.RE
2311
058ac9ba
BB
2312.sp
2313.ne 2
2314.mk
2315.na
2316\fB\fB-R\fR\fR
2317.ad
2318.sp .6
2319.RS 4n
2320Generate a replication stream package, which will replicate the specified filesystem, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
2321.sp
2322If the \fB-i\fR or \fB-I\fR flags are used in conjunction with the \fB-R\fR flag, an incremental replication stream is generated. The current values of properties, and current snapshot and file system names are set when the stream is received. If the \fB-F\fR flag is specified when this stream is received, snapshots and file systems that do not exist on the sending side are destroyed.
2323.RE
2324
2325.sp
2326.ne 2
2327.mk
2328.na
e0f86c98 2329\fB\fB-D\fR\fR
058ac9ba
BB
2330.ad
2331.sp .6
2332.RS 4n
e0f86c98
BB
2333This option will cause dedup processing to be performed on the data being written to a send stream. Dedup processing is optional because it isn't always appropriate (some kinds of data have very little duplication) and it has significant costs: the checksumming required to detect duplicate blocks is CPU-intensive and the data that must be maintained while the stream is being processed can occupy a very large amount of memory.
2334.sp
2335Duplicate blocks are detected by calculating a cryptographically strong checksum on each data block. Blocks that have the same checksum are presumed to be identical. The checksum type used at this time is SHA256. However, the stream format contains a field which identifies the checksum type, permitting other checksums to be used in the future.
2336.RE
2337
2338.sp
2339.ne 2
2340.mk
2341.na
2342\fB\fB-p\fR\fR
2343.ad
2344.sp .6
2345.RS 4n
2346Include properties in the send stream without the -R option.
058ac9ba
BB
2347.RE
2348
2349The format of the stream is committed. You will be able to receive your streams on future versions of \fBZFS\fR.
2350.RE
2351
2352.sp
2353.ne 2
2354.mk
2355.na
2356\fB\fBzfs receive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
2357.ad
2358.br
2359.na
bb8b81ec 2360\fB\fBzfs receive\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR\fR
058ac9ba
BB
2361.ad
2362.sp .6
2363.RS 4n
2364Creates a snapshot whose contents are as specified in the stream provided on standard input. If a full stream is received, then a new file system is created as well. Streams are created using the \fBzfs send\fR subcommand, which by default creates a full stream. \fBzfs recv\fR can be used as an alias for \fBzfs receive\fR.
2365.sp
2366If an incremental stream is received, then the destination file system must already exist, and its most recent snapshot must match the incremental stream's source. For \fBzvols\fR, the destination device link is destroyed and recreated, which means the \fBzvol\fR cannot be accessed during the \fBreceive\fR operation.
2367.sp
2368When a snapshot replication package stream that is generated by using the \fBzfs send\fR \fB-R\fR command is received, any snapshots that do not exist on the sending location are destroyed by using the \fBzfs destroy\fR \fB-d\fR command.
2369.sp
bb8b81ec 2370The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the use of the \fB-d\fR or \fB-e\fR options.
058ac9ba 2371.sp
bb8b81ec
BB
2372If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or \fIvolume\fR. If neither of the \fB-d\fR or \fB-e\fR options are specified, the provided target snapshot name is used exactly as provided.
2373.sp
2374The \fB-d\fR and \fB-e\fR options cause the file system name of the target snapshot to be determined by appending a portion of the sent snapshot's name to the specified target \fIfilesystem\fR. If the \fB-d\fR option is specified, all but the first element of the sent snapshot's file system path (usually the pool name) is used and any required intermediate file systems within the specified one are created. If the \fB-e\fR option is specified, then only the last element of the sent snapshot's file system name (i.e. the name of the source file system itself) is used as the target file system name.
058ac9ba
BB
2375.sp
2376.ne 2
2377.mk
2378.na
2379\fB\fB-d\fR\fR
2380.ad
2381.sp .6
2382.RS 4n
bb8b81ec
BB
2383Discard the first element of the sent snapshot's file system name, using the remaining elements to determine the name of the target file system for the new snapshot as described in the paragraph above.
2384.RE
2385
2386.sp
2387.ne 2
2388.na
2389\fB\fB-e\fR\fR
2390.ad
2391.sp .6
2392.RS 4n
2393Discard all but the last element of the sent snapshot's file system name, using that element to determine the name of the target file system for the new snapshot as described in the paragraph above.
058ac9ba
BB
2394.RE
2395
2396.sp
2397.ne 2
2398.mk
2399.na
2400\fB\fB-u\fR\fR
2401.ad
2402.sp .6
2403.RS 4n
2404File system that is associated with the received stream is not mounted.
2405.RE
2406
2407.sp
2408.ne 2
2409.mk
2410.na
330d06f9
MA
2411\fB\fB-D\fR\fR
2412.ad
2413.sp .6
2414.RS 4n
2415Generate a deduplicated stream. Blocks which would have been sent multiple
2416times in the send stream will only be sent once. The receiving system must
2417also support this feature to recieve a deduplicated stream. This flag can
2418be used regardless of the dataset's \fBdedup\fR property, but performance
2419will be much better if the filesystem uses a dedup-capable checksum (eg.
2420\fBsha256\fR).
2421.RE
2422
2423.sp
2424.ne 2
2425.na
2426\fB\fB-r\fR\fR
2427.ad
2428.sp .6
2429.RS 4n
2430Recursively send all descendant snapshots. This is similar to the \fB-R\fR
2431flag, but information about deleted and renamed datasets is not included, and
2432property information is only included if the \fB-p\fR flag is specified.
2433.RE
2434
2435.sp
2436.ne 2
2437.na
2438\fB\fB-p\fR\fR
2439.ad
2440.sp .6
2441.RS 4n
2442Include the dataset's properties in the stream. This flag is implicit when
2443\fB-R\fR is specified. The receiving system must also support this feature.
2444.RE
2445
2446.sp
2447.ne 2
2448.na
2449\fB\fB-n\fR\fR
2450.ad
2451.sp .6
2452.RS 4n
2453Do a dry-run ("No-op") send. Do not generate any actual send data. This is
2454useful in conjunction with the \fB-v\fR or \fB-P\fR flags to determine what
2455data will be sent.
2456.RE
2457
2458.sp
2459.ne 2
2460.na
2461\fB\fB-P\fR\fR
2462.ad
2463.sp .6
2464.RS 4n
2465Print machine-parsable verbose information about the stream package generated.
2466.RE
2467
2468.sp
2469.ne 2
2470.na
058ac9ba
BB
2471\fB\fB-v\fR\fR
2472.ad
2473.sp .6
2474.RS 4n
2475Print verbose information about the stream and the time required to perform the receive operation.
2476.RE
2477
2478.sp
2479.ne 2
2480.mk
2481.na
2482\fB\fB-n\fR\fR
2483.ad
2484.sp .6
2485.RS 4n
2486Do not actually receive the stream. This can be useful in conjunction with the \fB-v\fR option to verify the name the receive operation would use.
2487.RE
2488
2489.sp
2490.ne 2
2491.mk
2492.na
2493\fB\fB-F\fR\fR
2494.ad
2495.sp .6
2496.RS 4n
2497Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication stream (for example, one generated by \fBzfs send -R -[iI]\fR), destroy snapshots and file systems that do not exist on the sending side.
2498.RE
2499
2500.RE
2501
2502.sp
2503.ne 2
2504.mk
2505.na
2506\fB\fBzfs allow\fR \fIfilesystem\fR | \fIvolume\fR\fR
2507.ad
2508.sp .6
2509.RS 4n
2510Displays permissions that have been delegated on the specified filesystem or volume. See the other forms of \fBzfs allow\fR for more information.
2511.RE
2512
2513.sp
2514.ne 2
2515.mk
2516.na
2517\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR
2518.ad
2519.br
2520.na
2521\fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR | \fIvolume\fR\fR
2522.ad
2523.sp .6
2524.RS 4n
2525Delegates \fBZFS\fR administration permission for the file systems to non-privileged users.
2526.sp
2527.ne 2
2528.mk
2529.na
2530\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR
2531.ad
2532.sp .6
2533.RS 4n
2534Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword "everyone", then as a user name, and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options.
2535.RE
2536
2537.sp
2538.ne 2
2539.mk
2540.na
2541\fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR
2542.ad
2543.sp .6
2544.RS 4n
2545Specifies that the permissions be delegated to "everyone." Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which begin with an at sign (\fB@\fR) , may be specified. See the \fB-s\fR form below for details.
2546.RE
2547
2548.sp
2549.ne 2
2550.mk
2551.na
2552\fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR
2553.ad
2554.sp .6
2555.RS 4n
2556Specifies where the permissions are delegated. If neither of the \fB-ld\fR options are specified, or both are, then the permissions are allowed for the file system or volume, and all of its descendents. If only the \fB-l\fR option is used, then is allowed "locally" only for the specified file system. If only the \fB-d\fR option is used, then is allowed only for the descendent file systems.
2557.RE
2558
2559.RE
2560
2561.sp
2562.LP
2563Permissions are generally the ability to use a \fBZFS\fR subcommand or change a \fBZFS\fR property. The following permissions are available:
2564.sp
2565.in +2
2566.nf
2567NAME TYPE NOTES
2568allow subcommand Must also have the permission that is being
2569 allowed
2570clone subcommand Must also have the 'create' ability and 'mount'
2571 ability in the origin file system
2572create subcommand Must also have the 'mount' ability
2573destroy subcommand Must also have the 'mount' ability
2574mount subcommand Allows mount/umount of ZFS datasets
2575promote subcommand Must also have the 'mount'
2576 and 'promote' ability in the origin file system
2577receive subcommand Must also have the 'mount' and 'create' ability
2578rename subcommand Must also have the 'mount' and 'create'
2579 ability in the new parent
2580rollback subcommand Must also have the 'mount' ability
2581send subcommand
2582share subcommand Allows sharing file systems over NFS or SMB
2583 protocols
2584snapshot subcommand Must also have the 'mount' ability
2585groupquota other Allows accessing any groupquota@... property
2586groupused other Allows reading any groupused@... property
2587userprop other Allows changing any user property
2588userquota other Allows accessing any userquota@... property
2589userused other Allows reading any userused@... property
2590
2591aclinherit property
2592aclmode property
2593atime property
2594canmount property
2595casesensitivity property
2596checksum property
2597compression property
2598copies property
2599devices property
2600exec property
2601mountpoint property
2602nbmand property
2603normalization property
2604primarycache property
2605quota property
2606readonly property
2607recordsize property
2608refquota property
2609refreservation property
2610reservation property
2611secondarycache property
2612setuid property
2613shareiscsi property
2614sharenfs property
2615sharesmb property
2616snapdir property
2617utf8only property
2618version property
2619volblocksize property
2620volsize property
2621vscan property
2622xattr property
2623zoned property
2624.fi
2625.in -2
2626.sp
2627
2628.sp
2629.ne 2
2630.mk
2631.na
2632\fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
2633.ad
2634.sp .6
2635.RS 4n
2636Sets "create time" permissions. These permissions are granted (locally) to the creator of any newly-created descendent file system.
2637.RE
2638
2639.sp
2640.ne 2
2641.mk
2642.na
2643\fB\fBzfs allow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
2644.ad
2645.sp .6
2646.RS 4n
2647Defines or adds permissions to a permission set. The set can be used by other \fBzfs allow\fR commands for the specified file system and its descendents. Sets are evaluated dynamically, so changes to a set are immediately reflected. Permission sets follow the same naming restrictions as ZFS file systems, but the name must begin with an "at sign" (\fB@\fR), and can be no more than 64 characters long.
2648.RE
2649
2650.sp
2651.ne 2
2652.mk
2653.na
2654\fB\fBzfs unallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR
2655.ad
2656.br
2657.na
2658\fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] \fIfilesystem\fR|\fIvolume\fR\fR
2659.ad
2660.br
2661.na
2662\fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2663.ad
2664.br
2665.na
2666\fB\fIfilesystem\fR|\fIvolume\fR\fR
2667.ad
2668.sp .6
2669.RS 4n
2670Removes permissions that were granted with the \fBzfs allow\fR command. No permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified \fIuser\fR, \fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the \fB-e\fR option) only removes the permissions that were granted to "everyone", not all permissions for every user and group. See the \fBzfs allow\fR command for a description of the \fB-ldugec\fR options.
2671.sp
2672.ne 2
2673.mk
2674.na
2675\fB\fB-r\fR\fR
2676.ad
2677.sp .6
2678.RS 4n
2679Recursively remove the permissions from this file system and all descendents.
2680.RE
2681
2682.RE
2683
2684.sp
2685.ne 2
2686.mk
2687.na
2688\fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2689.ad
2690.br
2691.na
2692\fB\fIfilesystem\fR|\fIvolume\fR\fR
2693.ad
2694.sp .6
2695.RS 4n
2696Removes permissions from a permission set. If no permissions are specified, then all permissions are removed, thus removing the set entirely.
2697.RE
2698
2699.sp
2700.ne 2
2701.mk
2702.na
2703\fB\fBzfs hold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
2704.ad
2705.sp .6
2706.RS 4n
2707Adds a single reference, named with the \fItag\fR argument, to the specified snapshot or snapshots. Each snapshot has its own tag namespace, and tags must be unique within that space.
2708.sp
2709If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
2710.sp
2711.ne 2
2712.mk
2713.na
2714\fB\fB-r\fR\fR
2715.ad
2716.sp .6
2717.RS 4n
2718Specifies that a hold with the given tag is applied recursively to the snapshots of all descendent file systems.
2719.RE
2720
2721.RE
2722
2723.sp
2724.ne 2
2725.mk
2726.na
2727\fB\fBzfs holds\fR [\fB-r\fR] \fIsnapshot\fR...\fR
2728.ad
2729.sp .6
2730.RS 4n
2731Lists all existing user references for the given snapshot or snapshots.
2732.sp
2733.ne 2
2734.mk
2735.na
2736\fB\fB-r\fR\fR
2737.ad
2738.sp .6
2739.RS 4n
2740Lists the holds that are set on the named descendent snapshots, in addition to listing the holds on the named snapshot.
2741.RE
2742
2743.RE
2744
2745.sp
2746.ne 2
2747.mk
2748.na
2749\fB\fBzfs release\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
2750.ad
2751.sp .6
2752.RS 4n
2753Removes a single reference, named with the \fItag\fR argument, from the specified snapshot or snapshots. The tag must already exist for each snapshot.
2754.sp
2755If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
2756.sp
2757.ne 2
2758.mk
2759.na
2760\fB\fB-r\fR\fR
2761.ad
2762.sp .6
2763.RS 4n
2764Recursively releases a hold with the given tag on the snapshots of all descendent file systems.
2765.RE
2766
2767.RE
2768
2769.SH EXAMPLES
2770.LP
2771\fBExample 1 \fRCreating a ZFS File System Hierarchy
2772.sp
2773.LP
2774The following commands create a file system named \fBpool/home\fR and a file system named \fBpool/home/bob\fR. The mount point \fB/export/home\fR is set for the parent file system, and is automatically inherited by the child file system.
2775
2776.sp
2777.in +2
2778.nf
2779# \fBzfs create pool/home\fR
2780# \fBzfs set mountpoint=/export/home pool/home\fR
2781# \fBzfs create pool/home/bob\fR
2782.fi
2783.in -2
2784.sp
2785
2786.LP
2787\fBExample 2 \fRCreating a ZFS Snapshot
2788.sp
2789.LP
2790The following command creates a snapshot named \fByesterday\fR. This snapshot is mounted on demand in the \fB\&.zfs/snapshot\fR directory at the root of the \fBpool/home/bob\fR file system.
2791
2792.sp
2793.in +2
2794.nf
2795# \fBzfs snapshot pool/home/bob@yesterday\fR
2796.fi
2797.in -2
2798.sp
2799
2800.LP
2801\fBExample 3 \fRCreating and Destroying Multiple Snapshots
2802.sp
2803.LP
2804The following command creates snapshots named \fByesterday\fR of \fBpool/home\fR and all of its descendent file systems. Each snapshot is mounted on demand in the \fB\&.zfs/snapshot\fR directory at the root of its file system. The second command destroys the newly created snapshots.
2805
2806.sp
2807.in +2
2808.nf
2809# \fBzfs snapshot -r pool/home@yesterday\fR
2810# \fBzfs destroy -r pool/home@yesterday\fR
2811.fi
2812.in -2
2813.sp
2814
2815.LP
2816\fBExample 4 \fRDisabling and Enabling File System Compression
2817.sp
2818.LP
2819The following command disables the \fBcompression\fR property for all file systems under \fBpool/home\fR. The next command explicitly enables \fBcompression\fR for \fBpool/home/anne\fR.
2820
2821.sp
2822.in +2
2823.nf
2824# \fBzfs set compression=off pool/home\fR
2825# \fBzfs set compression=on pool/home/anne\fR
2826.fi
2827.in -2
2828.sp
2829
2830.LP
2831\fBExample 5 \fRListing ZFS Datasets
2832.sp
2833.LP
2d1b7b0b 2834The following command lists all active file systems and volumes in the system. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR. The default is \fBoff\fR. See \fBzpool\fR(8) for more information on pool properties.
058ac9ba
BB
2835
2836.sp
2837.in +2
2838.nf
2839# \fBzfs list\fR
2840 NAME USED AVAIL REFER MOUNTPOINT
2841 pool 450K 457G 18K /pool
2842 pool/home 315K 457G 21K /export/home
2843 pool/home/anne 18K 457G 18K /export/home/anne
2844 pool/home/bob 276K 457G 276K /export/home/bob
2845.fi
2846.in -2
2847.sp
2848
2849.LP
2850\fBExample 6 \fRSetting a Quota on a ZFS File System
2851.sp
2852.LP
2853The following command sets a quota of 50 Gbytes for \fBpool/home/bob\fR.
2854
2855.sp
2856.in +2
2857.nf
2858# \fBzfs set quota=50G pool/home/bob\fR
2859.fi
2860.in -2
2861.sp
2862
2863.LP
2864\fBExample 7 \fRListing ZFS Properties
2865.sp
2866.LP
2867The following command lists all properties for \fBpool/home/bob\fR.
2868
2869.sp
2870.in +2
2871.nf
2872# \fBzfs get all pool/home/bob\fR
2873NAME PROPERTY VALUE SOURCE
2874pool/home/bob type filesystem -
2875pool/home/bob creation Tue Jul 21 15:53 2009 -
2876pool/home/bob used 21K -
2877pool/home/bob available 20.0G -
2878pool/home/bob referenced 21K -
2879pool/home/bob compressratio 1.00x -
2880pool/home/bob mounted yes -
2881pool/home/bob quota 20G local
2882pool/home/bob reservation none default
2883pool/home/bob recordsize 128K default
2884pool/home/bob mountpoint /pool/home/bob default
2885pool/home/bob sharenfs off default
2886pool/home/bob checksum on default
2887pool/home/bob compression on local
2888pool/home/bob atime on default
2889pool/home/bob devices on default
2890pool/home/bob exec on default
2891pool/home/bob setuid on default
2892pool/home/bob readonly off default
2893pool/home/bob zoned off default
2894pool/home/bob snapdir hidden default
2895pool/home/bob aclmode groupmask default
2896pool/home/bob aclinherit restricted default
2897pool/home/bob canmount on default
2898pool/home/bob shareiscsi off default
2899pool/home/bob xattr on default
2900pool/home/bob copies 1 default
2901pool/home/bob version 4 -
2902pool/home/bob utf8only off -
2903pool/home/bob normalization none -
2904pool/home/bob casesensitivity sensitive -
2905pool/home/bob vscan off default
2906pool/home/bob nbmand off default
2907pool/home/bob sharesmb off default
2908pool/home/bob refquota none default
2909pool/home/bob refreservation none default
2910pool/home/bob primarycache all default
2911pool/home/bob secondarycache all default
2912pool/home/bob usedbysnapshots 0 -
2913pool/home/bob usedbydataset 21K -
2914pool/home/bob usedbychildren 0 -
2915pool/home/bob usedbyrefreservation 0 -
2916.fi
2917.in -2
2918.sp
2919
2920.sp
2921.LP
2922The following command gets a single property value.
2923
2924.sp
2925.in +2
2926.nf
2927# \fBzfs get -H -o value compression pool/home/bob\fR
2928on
2929.fi
2930.in -2
2931.sp
2932
2933.sp
2934.LP
2935The following command lists all properties with local settings for \fBpool/home/bob\fR.
2936
2937.sp
2938.in +2
2939.nf
2940# \fBzfs get -r -s local -o name,property,value all pool/home/bob\fR
2941NAME PROPERTY VALUE
2942pool/home/bob quota 20G
2943pool/home/bob compression on
2944.fi
2945.in -2
2946.sp
2947
2948.LP
2949\fBExample 8 \fRRolling Back a ZFS File System
2950.sp
2951.LP
2952The following command reverts the contents of \fBpool/home/anne\fR to the snapshot named \fByesterday\fR, deleting all intermediate snapshots.
2953
2954.sp
2955.in +2
2956.nf
2957# \fBzfs rollback -r pool/home/anne@yesterday\fR
2958.fi
2959.in -2
2960.sp
2961
2962.LP
2963\fBExample 9 \fRCreating a ZFS Clone
2964.sp
2965.LP
2966The following command creates a writable file system whose initial contents are the same as \fBpool/home/bob@yesterday\fR.
2967
2968.sp
2969.in +2
2970.nf
2971# \fBzfs clone pool/home/bob@yesterday pool/clone\fR
2972.fi
2973.in -2
2974.sp
2975
2976.LP
2977\fBExample 10 \fRPromoting a ZFS Clone
2978.sp
2979.LP
2980The following commands illustrate how to test out changes to a file system, and then replace the original file system with the changed one, using clones, clone promotion, and renaming:
2981
2982.sp
2983.in +2
2984.nf
2985# \fBzfs create pool/project/production\fR
2986 populate /pool/project/production with data
2987# \fBzfs snapshot pool/project/production@today\fR
2988# \fBzfs clone pool/project/production@today pool/project/beta\fR
2989make changes to /pool/project/beta and test them
2990# \fBzfs promote pool/project/beta\fR
2991# \fBzfs rename pool/project/production pool/project/legacy\fR
2992# \fBzfs rename pool/project/beta pool/project/production\fR
2993once the legacy version is no longer needed, it can be destroyed
2994# \fBzfs destroy pool/project/legacy\fR
2995.fi
2996.in -2
2997.sp
2998
2999.LP
3000\fBExample 11 \fRInheriting ZFS Properties
3001.sp
3002.LP
3003The following command causes \fBpool/home/bob\fR and \fBpool/home/anne\fR to inherit the \fBchecksum\fR property from their parent.
3004
3005.sp
3006.in +2
3007.nf
3008# \fBzfs inherit checksum pool/home/bob pool/home/anne\fR
3009.fi
3010.in -2
3011.sp
3012
3013.LP
3014\fBExample 12 \fRRemotely Replicating ZFS Data
3015.sp
3016.LP
3017The following commands send a full stream and then an incremental stream to a remote machine, restoring them into \fBpoolB/received/fs@a\fRand \fBpoolB/received/fs@b\fR, respectively. \fBpoolB\fR must contain the file system \fBpoolB/received\fR, and must not initially contain \fBpoolB/received/fs\fR.
3018
3019.sp
3020.in +2
3021.nf
3022# \fBzfs send pool/fs@a | \e\fR
3023 \fBssh host zfs receive poolB/received/fs@a\fR
3024# \fBzfs send -i a pool/fs@b | ssh host \e\fR
3025 \fBzfs receive poolB/received/fs\fR
3026.fi
3027.in -2
3028.sp
3029
3030.LP
3031\fBExample 13 \fRUsing the \fBzfs receive\fR \fB-d\fR Option
3032.sp
3033.LP
3034The following command sends a full stream of \fBpoolA/fsA/fsB@snap\fR to a remote machine, receiving it into \fBpoolB/received/fsA/fsB@snap\fR. The \fBfsA/fsB@snap\fR portion of the received snapshot's name is determined from the name of the sent snapshot. \fBpoolB\fR must contain the file system \fBpoolB/received\fR. If \fBpoolB/received/fsA\fR does not exist, it is created as an empty file system.
3035
3036.sp
3037.in +2
3038.nf
3039# \fBzfs send poolA/fsA/fsB@snap | \e
3040 ssh host zfs receive -d poolB/received\fR
3041.fi
3042.in -2
3043.sp
3044
3045.LP
3046\fBExample 14 \fRSetting User Properties
3047.sp
3048.LP
3049The following example sets the user-defined \fBcom.example:department\fR property for a dataset.
3050
3051.sp
3052.in +2
3053.nf
3054# \fBzfs set com.example:department=12345 tank/accounting\fR
3055.fi
3056.in -2
3057.sp
3058
3059.LP
3060\fBExample 15 \fRCreating a ZFS Volume as an iSCSI Target Device
3061.sp
3062.LP
3063The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target.
3064
3065.sp
3066.in +2
3067.nf
3068# \fBzfs create -V 2g pool/volumes/vol1\fR
3069# \fBzfs set shareiscsi=on pool/volumes/vol1\fR
3070# \fBiscsitadm list target\fR
3071Target: pool/volumes/vol1
3072 iSCSI Name:
3073 iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
3074 Connections: 0
3075.fi
3076.in -2
3077.sp
3078
3079.sp
3080.LP
3081After the \fBiSCSI\fR target is created, set up the \fBiSCSI\fR initiator. For more information about the Solaris \fBiSCSI\fR initiator, see \fBiscsitadm\fR(1M).
3082.LP
3083\fBExample 16 \fRPerforming a Rolling Snapshot
3084.sp
3085.LP
3086The following example shows how to maintain a history of snapshots with a consistent naming scheme. To keep a week's worth of snapshots, the user destroys the oldest snapshot, renames the remaining snapshots, and then creates a new snapshot, as follows:
3087
3088.sp
3089.in +2
3090.nf
3091# \fBzfs destroy -r pool/users@7daysago\fR
3092# \fBzfs rename -r pool/users@6daysago @7daysago\fR
3093# \fBzfs rename -r pool/users@5daysago @6daysago\fR
3094# \fBzfs rename -r pool/users@yesterday @5daysago\fR
3095# \fBzfs rename -r pool/users@yesterday @4daysago\fR
3096# \fBzfs rename -r pool/users@yesterday @3daysago\fR
3097# \fBzfs rename -r pool/users@yesterday @2daysago\fR
3098# \fBzfs rename -r pool/users@today @yesterday\fR
3099# \fBzfs snapshot -r pool/users@today\fR
3100.fi
3101.in -2
3102.sp
3103
3104.LP
3105\fBExample 17 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System
3106.sp
3107.LP
3108The following commands show how to set \fBsharenfs\fR property options to enable \fBrw\fR access for a set of \fBIP\fR addresses and to enable root access for system \fBneo\fR on the \fBtank/home\fR file system.
3109
3110.sp
3111.in +2
3112.nf
3113# \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
3114.fi
3115.in -2
3116.sp
3117
3118.sp
3119.LP
3120If you are using \fBDNS\fR for host name resolution, specify the fully qualified hostname.
3121
3122.LP
3123\fBExample 18 \fRDelegating ZFS Administration Permissions on a ZFS Dataset
3124.sp
3125.LP
3126The following example shows how to set permissions so that user \fBcindys\fR can create, destroy, mount, and take snapshots on \fBtank/cindys\fR. The permissions on \fBtank/cindys\fR are also displayed.
3127
3128.sp
3129.in +2
3130.nf
3131# \fBzfs allow cindys create,destroy,mount,snapshot tank/cindys\fR
3132# \fBzfs allow tank/cindys\fR
3133-------------------------------------------------------------
3134Local+Descendent permissions on (tank/cindys)
3135 user cindys create,destroy,mount,snapshot
3136-------------------------------------------------------------
3137.fi
3138.in -2
3139.sp
3140
3141.sp
3142.LP
3143Because the \fBtank/cindys\fR mount point permission is set to 755 by default, user \fBcindys\fR will be unable to mount file systems under \fBtank/cindys\fR. Set an \fBACL\fR similar to the following syntax to provide mount point access:
3144.sp
3145.in +2
3146.nf
3147# \fBchmod A+user:cindys:add_subdirectory:allow /tank/cindys\fR
3148.fi
3149.in -2
3150.sp
3151
3152.LP
3153\fBExample 19 \fRDelegating Create Time Permissions on a ZFS Dataset
3154.sp
3155.LP
3156The following example shows how to grant anyone in the group \fBstaff\fR to create file systems in \fBtank/users\fR. This syntax also allows staff members to destroy their own file systems, but not destroy anyone else's file system. The permissions on \fBtank/users\fR are also displayed.
3157
3158.sp
3159.in +2
3160.nf
3161# \fB# zfs allow staff create,mount tank/users\fR
3162# \fBzfs allow -c destroy tank/users\fR
3163# \fBzfs allow tank/users\fR
3164-------------------------------------------------------------
3165Create time permissions on (tank/users)
3166 create,destroy
3167Local+Descendent permissions on (tank/users)
3168 group staff create,mount
3169-------------------------------------------------------------
3170.fi
3171.in -2
3172.sp
3173
3174.LP
3175\fBExample 20 \fRDefining and Granting a Permission Set on a ZFS Dataset
3176.sp
3177.LP
3178The following example shows how to define and grant a permission set on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
3179
3180.sp
3181.in +2
3182.nf
3183# \fBzfs allow -s @pset create,destroy,snapshot,mount tank/users\fR
3184# \fBzfs allow staff @pset tank/users\fR
3185# \fBzfs allow tank/users\fR
3186-------------------------------------------------------------
3187Permission sets on (tank/users)
3188 @pset create,destroy,mount,snapshot
3189Create time permissions on (tank/users)
3190 create,destroy
3191Local+Descendent permissions on (tank/users)
3192 group staff @pset,create,mount
3193-------------------------------------------------------------
3194.fi
3195.in -2
3196.sp
3197
3198.LP
3199\fBExample 21 \fRDelegating Property Permissions on a ZFS Dataset
3200.sp
3201.LP
3202The following example shows to grant the ability to set quotas and reservations on the \fBusers/home\fR file system. The permissions on \fBusers/home\fR are also displayed.
3203
3204.sp
3205.in +2
3206.nf
3207# \fBzfs allow cindys quota,reservation users/home\fR
3208# \fBzfs allow users/home\fR
3209-------------------------------------------------------------
3210Local+Descendent permissions on (users/home)
3211 user cindys quota,reservation
3212-------------------------------------------------------------
3213cindys% \fBzfs set quota=10G users/home/marks\fR
3214cindys% \fBzfs get quota users/home/marks\fR
3215NAME PROPERTY VALUE SOURCE
3216users/home/marks quota 10G local
3217.fi
3218.in -2
3219.sp
3220
3221.LP
3222\fBExample 22 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset
3223.sp
3224.LP
3225The following example shows how to remove the snapshot permission from the \fBstaff\fR group on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
3226
3227.sp
3228.in +2
3229.nf
3230# \fBzfs unallow staff snapshot tank/users\fR
3231# \fBzfs allow tank/users\fR
3232-------------------------------------------------------------
3233Permission sets on (tank/users)
3234 @pset create,destroy,mount,snapshot
3235Create time permissions on (tank/users)
3236 create,destroy
3237Local+Descendent permissions on (tank/users)
3238 group staff @pset,create,mount
3239-------------------------------------------------------------
3240.fi
3241.in -2
3242.sp
3243
3244.SH EXIT STATUS
3245.sp
3246.LP
3247The following exit values are returned:
3248.sp
3249.ne 2
3250.mk
3251.na
3252\fB\fB0\fR\fR
3253.ad
3254.sp .6
3255.RS 4n
3256Successful completion.
3257.RE
3258
3259.sp
3260.ne 2
3261.mk
3262.na
3263\fB\fB1\fR\fR
3264.ad
3265.sp .6
3266.RS 4n
3267An error occurred.
3268.RE
3269
3270.sp
3271.ne 2
3272.mk
3273.na
3274\fB\fB2\fR\fR
3275.ad
3276.sp .6
3277.RS 4n
3278Invalid command line options were specified.
3279.RE
3280
058ac9ba
BB
3281.SH SEE ALSO
3282.sp
3283.LP
4da4a9e1 3284\fBchmod\fR(2), \fBfsync\fR(2), \fBgzip\fR(1), \fBmount\fR(8), \fBssh\fR(1), \fBstat\fR(2), \fBwrite\fR(2), \fBzpool\fR(8)