]> CyberLeo.Net >> Repos - FreeBSD/releng/8.1.git/blob - cddl/contrib/opensolaris/cmd/zfs/zfs.8
Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.
[FreeBSD/releng/8.1.git] / cddl / contrib / opensolaris / cmd / zfs / zfs.8
1 '\" te
2 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
3 .\" 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.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" 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 the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH zfs 1M "14 Feb 2009" "SunOS 5.11" "System Administration Commands"
7 .SH NAME
8 zfs \- configures ZFS file systems
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBzfs\fR [\fB-?\fR]
13 .fi
14
15 .LP
16 .nf
17 \fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR
18 .fi
19
20 .LP
21 .nf
22 \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
23 .fi
24
25 .LP
26 .nf
27 \fBzfs\fR \fBdestroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
28 .fi
29
30 .LP
31 .nf
32 \fBzfs\fR \fBsnapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR]... 
33       \fIfilesystem@snapname\fR|\fIvolume@snapname\fR
34 .fi
35
36 .LP
37 .nf
38 \fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
39 .fi
40
41 .LP
42 .nf
43 \fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
44 .fi
45
46 .LP
47 .nf
48 \fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR
49 .fi
50
51 .LP
52 .nf
53 \fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR 
54      \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
55 .fi
56
57 .LP
58 .nf
59 \fBzfs\fR \fBrename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR
60 .fi
61
62 .LP
63 .nf
64 \fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR
65 .fi
66
67 .LP
68 .nf
69 \fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fB-t\fR \fItype\fR[,...]]
70      [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
71 .fi
72
73 .LP
74 .nf
75 \fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|snapshot ...
76 .fi
77
78 .LP
79 .nf
80 \fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...]
81       \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
82 .fi
83
84 .LP
85 .nf
86 \fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
87 .fi
88
89 .LP
90 .nf
91 \fBzfs\fR \fBupgrade\fR [\fB-v\fR]
92 .fi
93
94 .LP
95 .nf
96 \fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR
97 .fi
98
99 .LP
100 .nf
101 \fBzfs\fR \fBmount\fR 
102 .fi
103
104 .LP
105 .nf
106 \fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR
107 .fi
108
109 .LP
110 .nf
111 \fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
112 .fi
113
114 .LP
115 .nf
116 \fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR
117 .fi
118
119 .LP
120 .nf
121 \fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
122 .fi
123
124 .LP
125 .nf
126 \fBzfs\fR \fBsend\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
127 .fi
128
129 .LP
130 .nf
131 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
132 .fi
133
134 .LP
135 .nf
136 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR
137 .fi
138
139 .LP
140 .nf
141 \fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] 
142      \fIfilesystem\fR|\fIvolume\fR
143 .fi
144
145 .LP
146 .nf
147 \fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
148 .fi
149
150 .LP
151 .nf
152 \fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
153 .fi
154
155 .LP
156 .nf
157 \fBzfs\fR \fBallow\fR \fB-s\fR @setname \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
158 .fi
159
160 .LP
161 .nf
162 \fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] 
163      \fIfilesystem\fR|\fIvolume\fR
164 .fi
165
166 .LP
167 .nf
168 \fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
169 .fi
170
171 .LP
172 .nf
173 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR
174 .fi
175
176 .LP
177 .nf
178 \fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
179 .fi
180
181 .SH DESCRIPTION
182 .sp
183 .LP
184 The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
185 .sp
186 .in +2
187 .nf
188 pool/{filesystem,volume,snapshot}
189 .fi
190 .in -2
191 .sp
192
193 .sp
194 .LP
195 where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
196 .sp
197 .LP
198 A dataset can be one of the following:
199 .sp
200 .ne 2
201 .mk
202 .na
203 \fB\fIfile system\fR\fR
204 .ad
205 .sp .6
206 .RS 4n
207 A \fBZFS\fR dataset of type "filesystem" that 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.
208 .RE
209
210 .sp
211 .ne 2
212 .mk
213 .na
214 \fB\fIvolume\fR\fR
215 .ad
216 .sp .6
217 .RS 4n
218 A 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. Volumes cannot be used in a non-global zone.
219 .RE
220
221 .sp
222 .ne 2
223 .mk
224 .na
225 \fB\fIsnapshot\fR\fR
226 .ad
227 .sp .6
228 .RS 4n
229 A 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.
230 .RE
231
232 .SS "ZFS File System Hierarchy"
233 .sp
234 .LP
235 A \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.
236 .sp
237 .LP
238 The 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(1M) command.
239 .sp
240 .LP
241 See \fBzpool\fR(1M) for more information on creating and administering pools.
242 .SS "Snapshots"
243 .sp
244 .LP
245 A 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.
246 .sp
247 .LP
248 Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
249 .sp
250 .LP
251 File system snapshots can be accessed under the ".zfs/snapshot" 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 ".zfs" directory can be controlled by the "snapdir" property.
252 .SS "Clones"
253 .sp
254 .LP
255 A 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.
256 .sp
257 .LP
258 Clones 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 "origin" property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
259 .sp
260 .LP
261 The 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.
262 .SS "Mount Points"
263 .sp
264 .LP
265 Creating 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/vfstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time.
266 .sp
267 .LP
268 By 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.
269 .sp
270 .LP
271 A file system can also have a mount point set in the "mountpoint" 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/vfstab\fR). The mountpoint 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.
272 .sp
273 .LP
274 A file system mountpoint property of "none" prevents the file system from being mounted.
275 .sp
276 .LP
277 If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/vfstab\fR). If a file system's mount point is set to "legacy", \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
278 .SS "Zones"
279 .sp
280 .LP
281 A \fBZFS\fR file system can be added to a non-global zone by using zonecfg's "\fBadd fs\fR" subcommand. A \fBZFS\fR file system that is added to a non-global zone must have its mountpoint property set to legacy.
282 .sp
283 .LP
284 The physical properties of an added file system are controlled by the global administrator. However, the zone administrator can create, modify, or destroy files within the added file system, depending on how the file system is mounted.
285 .sp
286 .LP
287 A dataset can also be delegated to a non-global zone by using zonecfg's "\fBadd dataset\fR" subcommand. You cannot delegate a dataset to one zone and the children of the same dataset to another zone. The zone administrator can change properties of the dataset or any of its children. However, the "quota" property is controlled by the global administrator.
288 .sp
289 .LP
290 A \fBZFS\fR volume can be added as a device to a non-global zone by using zonecfg's "\fBadd device\fR" subcommand. However, its physical properties can only be modified by the global administrator.
291 .sp
292 .LP
293 For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M).
294 .sp
295 .LP
296 After a dataset is delegated to a non-global zone, the "zoned" property is automatically set. A zoned file system cannot be mounted in the global zone, since the zone administrator might have to set the mount point to an unacceptable value.
297 .sp
298 .LP
299 The global administrator can forcibly clear the "zoned" property, though this should be done with extreme care. The global administrator should verify that all the mount points are acceptable before clearing the property.
300 .SS "Native Properties"
301 .sp
302 .LP
303 Properties are divided into two types, native properties and user defined 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.
304 .sp
305 .LP
306 Every dataset has a set of properties that export statistics about the dataset as well as control various behavior. Properties are inherited from the parent unless overridden by the child. Some properties only apply to certain types of datasets (file systems, volumes or snapshots).
307 .sp
308 .LP
309 The values of numeric properties can be specified using human-readable suffixes (for example, "k", "KB", "M", "Gb", etc, up to Z for zettabyte). The following are all valid (and equal) specifications: 
310 .sp
311 .in +2
312 .nf
313 "1536M", "1.5g", "1.50GB".
314 .fi
315 .in -2
316 .sp
317
318 .sp
319 .LP
320 The values of non-numeric properties are case sensitive and must be lowercase, except for "mountpoint", "sharenfs" and "sharesmb".
321 .sp
322 .LP
323 The following native properties consist of read-only statistics about the dataset. These properties cannot be set, nor are they inherited. Native properties apply to all dataset types unless otherwise noted.
324 .sp
325 .ne 2
326 .mk
327 .na
328 \fBavailable\fR
329 .ad
330 .sp .6
331 .RS 4n
332 The 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.
333 .sp
334 This property can also be referred to by its shortened column name, "avail".
335 .RE
336
337 .sp
338 .ne 2
339 .mk
340 .na
341 \fBcompressratio\fR
342 .ad
343 .sp .6
344 .RS 4n
345 The compression ratio achieved for this dataset, expressed as a multiplier. Compression can be turned on by running "zfs set compression=on \fIdataset\fR". The default value is "off".
346 .RE
347
348 .sp
349 .ne 2
350 .mk
351 .na
352 \fBcreation\fR
353 .ad
354 .sp .6
355 .RS 4n
356 The time this dataset was created.
357 .RE
358
359 .sp
360 .ne 2
361 .mk
362 .na
363 \fBmounted\fR
364 .ad
365 .sp .6
366 .RS 4n
367 For file systems, indicates whether the file system is currently mounted. This property can be either "yes" or "no".
368 .RE
369
370 .sp
371 .ne 2
372 .mk
373 .na
374 \fBorigin\fR
375 .ad
376 .sp .6
377 .RS 4n
378 For cloned file systems or volumes, the snapshot from which the clone was created. The origin cannot be destroyed (even with the \fB-r\fR or \fB-f\fR options) so long as a clone exists.
379 .RE
380
381 .sp
382 .ne 2
383 .mk
384 .na
385 \fBreferenced\fR
386 .ad
387 .sp .6
388 .RS 4n
389 The 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.
390 .sp
391 This property can also be referred to by its shortened column name, "refer".
392 .RE
393
394 .sp
395 .ne 2
396 .mk
397 .na
398 \fBtype\fR
399 .ad
400 .sp .6
401 .RS 4n
402 The type of dataset: "filesystem", "volume", or "snapshot".
403 .RE
404
405 .sp
406 .ne 2
407 .mk
408 .na
409 \fBused\fR
410 .ad
411 .sp .6
412 .RS 4n
413 The 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.
414 .sp
415 When 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.
416 .sp
417 The 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(3c) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
418 .RE
419
420 .sp
421 .ne 2
422 .mk
423 .na
424 \fBusedby*\fR
425 .ad
426 .sp .6
427 .RS 4n
428 The \fBusedby*\fR snapshots decompose the "used" 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 zpool "version 13" pools.
429 .RE
430
431 .sp
432 .ne 2
433 .mk
434 .na
435 \fBusedbychildren\fR
436 .ad
437 .sp .6
438 .RS 4n
439 The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
440 .RE
441
442 .sp
443 .ne 2
444 .mk
445 .na
446 \fBusedbydataset\fR
447 .ad
448 .sp .6
449 .RS 4n
450 The 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).
451 .RE
452
453 .sp
454 .ne 2
455 .mk
456 .na
457 \fBusedbyrefreservation\fR
458 .ad
459 .sp .6
460 .RS 4n
461 The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
462 .RE
463
464 .sp
465 .ne 2
466 .mk
467 .na
468 \fBusedbysnapshots\fR
469 .ad
470 .sp .6
471 .RS 4n
472 The 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' "used" properties because space can be shared by multiple snapshots
473 .RE
474
475 .sp
476 .ne 2
477 .mk
478 .na
479 \fBvolblocksize=\fIblocksize\fR\fR
480 .ad
481 .sp .6
482 .RS 4n
483 For 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.
484 .sp
485 This property can also be referred to by its shortened column name, "volblock".
486 .RE
487
488 .sp
489 .LP
490 The following native properties can be used to change the behavior of a \fBZFS\fR dataset.
491 .sp
492 .ne 2
493 .mk
494 .na
495 \fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
496 .ad
497 .sp .6
498 .RS 4n
499 Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an "aclinherit" property of "\fBdiscard\fR" does not inherit any \fBACL\fR entries. A file system with an "aclinherit" 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 "aclinherit" 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 "aclinherit" 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.
500 .sp
501 When 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.
502 .RE
503
504 .sp
505 .ne 2
506 .mk
507 .na
508 \fBaclmode=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR
509 .ad
510 .sp .6
511 .RS 4n
512 Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR" deletes all \fBACL\fR entries that do not represent the mode of the file. An "aclmode" 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 "aclmode" 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.
513 .RE
514
515 .sp
516 .ne 2
517 .mk
518 .na
519 \fBatime=\fIon\fR | \fIoff\fR\fR
520 .ad
521 .sp .6
522 .RS 4n
523 Controls 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 "on".
524 .RE
525
526 .sp
527 .ne 2
528 .mk
529 .na
530 \fBcanmount=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR
531 .ad
532 .sp .6
533 .RS 4n
534 If 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 "mountpoint" property to "\fBnone\fR", except that the dataset still has a normal "mountpoint" 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 canmount=\fBoff\fR is to have two datasets with the same mountpoint, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
535 .sp
536 When 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. 
537 .sp
538 This property is not inherited.
539 .RE
540
541 .sp
542 .ne 2
543 .mk
544 .na
545 \fBchecksum=\fIon\fR | \fIoff\fR | \fIfletcher2\fR, | \fIfletcher4\fR | \fIsha256\fR\fR
546 .ad
547 .sp .6
548 .RS 4n
549 Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity checking on user data. Disabling checksums is NOT a recommended practice.
550 .RE
551
552 .sp
553 .ne 2
554 .mk
555 .na
556 \fBcompression=\fIon\fR | \fIoff\fR | \fIlzjb\fR | \fIgzip\fR | \fIgzip-N\fR\fR
557 .ad
558 .sp .6
559 .RS 4n
560 Controls the compression algorithm used for this dataset. The "lzjb" compression algorithm is optimized for performance while providing decent data compression. Setting compression to "on" uses the "lzjb" compression algorithm. The "gzip" compression algorithm uses the same compression as the \fBgzip\fR(1) command. You can specify the "gzip" level by using the value "gzip-\fIN\fR" where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
561 .sp
562 This property can also be referred to by its shortened column name "compress".
563 .RE
564
565 .sp
566 .ne 2
567 .mk
568 .na
569 \fBcopies=\fB1\fR | \fB2\fR | \fB3\fR\fR
570 .ad
571 .sp .6
572 .RS 4n
573 Controls 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 "used" property and counting against quotas and reservations.
574 .sp
575 Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the "\fB-o\fR copies=" option.
576 .RE
577
578 .sp
579 .ne 2
580 .mk
581 .na
582 \fBdevices=\fIon\fR | \fIoff\fR\fR
583 .ad
584 .sp .6
585 .RS 4n
586 Controls whether device nodes can be opened on this file system. The default value is "on".
587 .RE
588
589 .sp
590 .ne 2
591 .mk
592 .na
593 \fBexec=\fIon\fR | \fIoff\fR\fR
594 .ad
595 .sp .6
596 .RS 4n
597 Controls whether processes can be executed from within this file system. The default value is "on".
598 .RE
599
600 .sp
601 .ne 2
602 .mk
603 .na
604 \fBmountpoint=\fIpath\fR | \fInone\fR | \fIlegacy\fR\fR
605 .ad
606 .sp .6
607 .RS 4n
608 Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
609 .sp
610 When the mountpoint 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 "legacy", then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously "legacy" or "none", or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
611 .RE
612
613 .sp
614 .ne 2
615 .mk
616 .na
617 \fBnbmand=\fIon\fR | \fIoff\fR\fR
618 .ad
619 .sp .6
620 .RS 4n
621 Controls 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(1M) for more information on "\fBnbmand\fR" mounts.
622 .RE
623
624 .sp
625 .ne 2
626 .mk
627 .na
628 \fBprimarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
629 .ad
630 .sp .6
631 .RS 4n
632 Controls what is cached in the primary cache (ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
633 .RE
634
635 .sp
636 .ne 2
637 .mk
638 .na
639 \fBquota=\fIsize\fR | \fInone\fR\fR
640 .ad
641 .sp .6
642 .RS 4n
643 Limits 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.
644 .sp
645 Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
646 .RE
647
648 .sp
649 .ne 2
650 .mk
651 .na
652 \fBreadonly=\fIon\fR | \fIoff\fR\fR
653 .ad
654 .sp .6
655 .RS 4n
656 Controls whether this dataset can be modified. The default value is "off".
657 .sp
658 This property can also be referred to by its shortened column name, "rdonly".
659 .RE
660
661 .sp
662 .ne 2
663 .mk
664 .na
665 \fBrecordsize=\fIsize\fR\fR
666 .ad
667 .sp .6
668 .RS 4n
669 Specifies 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. 
670 .sp
671 For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a "recordsize" 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.
672 .sp
673 The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
674 .sp
675 Changing the file system's \fBrecordsize\fR only affects files created afterward; existing files are unaffected.
676 .sp
677 This property can also be referred to by its shortened column name, "recsize".
678 .RE
679
680 .sp
681 .ne 2
682 .mk
683 .na
684 \fBrefquota=\fIsize\fR | \fInone\fR\fR
685 .ad
686 .sp .6
687 .RS 4n
688 Limits 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.
689 .RE
690
691 .sp
692 .ne 2
693 .mk
694 .na
695 \fBrefreservation=\fIsize\fR | \fInone\fR\fR
696 .ad
697 .sp .6
698 .RS 4n
699 The 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.
700 .sp
701 If \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.
702 .sp
703 This property can also be referred to by its shortened column name, "refreserv".
704 .RE
705
706 .sp
707 .ne 2
708 .mk
709 .na
710 \fBreservation=\fIsize\fR | \fInone\fR\fR
711 .ad
712 .sp .6
713 .RS 4n
714 The 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.
715 .sp
716 This property can also be referred to by its shortened column name, "reserv".
717 .RE
718
719 .sp
720 .ne 2
721 .mk
722 .na
723 \fBsecondarycache=\fIall\fR | \fInone\fR | \fImetadata\fR\fR
724 .ad
725 .sp .6
726 .RS 4n
727 Controls what is cached in the secondary cache (L2ARC). If this property is set to "all", then both user data and metadata is cached. If this property is set to "none", then neither user data nor metadata is cached. If this property is set to "metadata", then only metadata is cached. The default value is "all".
728 .RE
729
730 .sp
731 .ne 2
732 .mk
733 .na
734 \fBsetuid=\fIon\fR | \fIoff\fR\fR
735 .ad
736 .sp .6
737 .RS 4n
738 Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is "on".
739 .RE
740
741 .sp
742 .ne 2
743 .mk
744 .na
745 \fBshareiscsi=\fIon\fR | \fIoff\fR\fR
746 .ad
747 .sp .6
748 .RS 4n
749 Like the "sharenfs" property, "shareiscsi" indicates whether a \fBZFS\fR volume is exported as an \fBiSCSI\fR target. The acceptable values for this property are "on", "off", and "type=disk". The default value is "off". In the future, other target types might be supported. For example, "tape".
750 .sp
751 You might want to set "shareiscsi=on" for a file system so that all \fBZFS\fR volumes within the file system are shared by default. Setting this property on a file system has no direct effect, however.
752 .RE
753
754 .sp
755 .ne 2
756 .mk
757 .na
758 \fBsharesmb=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
759 .ad
760 .sp .6
761 .RS 4n
762 Controls 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 "off" 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.
763 .sp
764 Because \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.
765 .sp
766 When 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.
767 .sp
768 When 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.
769 .RE
770
771 .sp
772 .ne 2
773 .mk
774 .na
775 \fBsharenfs=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
776 .ad
777 .sp .6
778 .RS 4n
779 Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a"\fBsharenfs\fR" property of "off" 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 "on", 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.
780 .sp
781 When the "sharenfs" 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 "off", or if they were shared before the property was changed. If the new property is "off", the file systems are unshared.
782 .RE
783
784 .sp
785 .ne 2
786 .mk
787 .na
788 \fBsnapdir=\fIhidden\fR | \fIvisible\fR\fR
789 .ad
790 .sp .6
791 .RS 4n
792 Controls whether the ".zfs" directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is "hidden".
793 .RE
794
795 .sp
796 .ne 2
797 .mk
798 .na
799 \fBversion=\fB1\fR|\fB2\fR|\fBcurrent\fR\fR
800 .ad
801 .sp .6
802 .RS 4n
803 The 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 "\fBzfs upgrade\fR". 
804 .RE
805
806 .sp
807 .ne 2
808 .mk
809 .na
810 \fBvolsize=\fIsize\fR\fR
811 .ad
812 .sp .6
813 .RS 4n
814 For 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.
815 .sp
816 The 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.
817 .sp
818 Though 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.
819 .RE
820
821 .sp
822 .ne 2
823 .mk
824 .na
825 \fBvscan=\fBon\fR|\fBoff\fR\fR
826 .ad
827 .sp .6
828 .RS 4n
829 Controls 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 "off".
830 .RE
831
832 .sp
833 .ne 2
834 .mk
835 .na
836 \fBxattr=\fBon\fR | \fBoff\fR\fR
837 .ad
838 .sp .6
839 .RS 4n
840 Controls whether extended attributes are enabled for this file system. The default value is "\fBon\fR".
841 .RE
842
843 .sp
844 .ne 2
845 .mk
846 .na
847 \fBzoned=\fIon\fR | \fIoff\fR\fR
848 .ad
849 .sp .6
850 .RS 4n
851 Controls whether the dataset is managed from a non-global zone. See the "Zones" section for more information. The default value is "off".
852 .RE
853
854 .sp
855 .LP
856 The 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.
857 .sp
858 .ne 2
859 .mk
860 .na
861 \fBcasesensitivity = \fBsensitive\fR | \fBinsensitive\fR | \fBmixed\fR\fR
862 .ad
863 .sp .6
864 .RS 4n
865 Indicates 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.
866 .sp
867 The "\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 "mixed" value behavior, see the \fIZFS Administration Guide\fR.
868 .RE
869
870 .sp
871 .ne 2
872 .mk
873 .na
874 \fBnormalization =\fBnone\fR | \fBformD\fR | \fBformKCf\fR\fR
875 .ad
876 .sp .6
877 .RS 4n
878 Indicates 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.
879 .RE
880
881 .sp
882 .ne 2
883 .mk
884 .na
885 \fButf8only =\fBon\fR | \fBoff\fR\fR
886 .ad
887 .sp .6
888 .RS 4n
889 Indicates 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 "off." This property cannot be changed after the file system is created.
890 .RE
891
892 .sp
893 .LP
894 The "\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.
895 .SS "Temporary Mount Point Properties"
896 .sp
897 .LP
898 When a file system is mounted, either through \fBmount\fR(1M) 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:
899 .sp
900 .in +2
901 .nf
902     PROPERTY                MOUNT OPTION
903      devices                 devices/nodevices
904      exec                    exec/noexec
905      readonly                ro/rw
906      setuid                  setuid/nosetuid
907      xattr                   xattr/noxattr
908 .fi
909 .in -2
910 .sp
911
912 .sp
913 .LP
914 In 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 "nodevices,nosetuid". 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.
915 .SS "User Properties"
916 .sp
917 .LP
918 In 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).
919 .sp
920 .LP
921 User property names must contain a colon (":") character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (":"), dash ("-"), period ("."), and underscore ("_"). The expected convention is that the property name is divided into two portions such as "\fImodule\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 ("-").
922 .sp
923 .LP
924 When 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. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
925 .sp
926 .LP
927 The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties ("zfs list", "zfs get", "zfs set", etc.) 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.
928 .SS "ZFS Volumes as Swap or Dump Devices"
929 .sp
930 .LP
931 During an initial installation or a live upgrade from a \fBUFS\fR file system, a swap device and dump device are created on \fBZFS\fR volumes in the \fBZFS\fR root pool. By default, the swap area size is based on 1/2 the size of physical memory up to 2 Gbytes. The size of the dump device depends on the kernel's requirements at installation time. Separate \fBZFS\fR volumes must be used for the swap area and dump devices. Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported. 
932 .sp
933 .LP
934 If you need to change your swap area or dump device after the system is installed or upgraded, use the \fBswap\fR(1M) and \fBdumpadm\fR(1M) commands. If you need to change the size of your swap area or dump device, see the \fISolaris ZFS Administration Guide\fR.
935 .SH SUBCOMMANDS
936 .sp
937 .LP
938 All subcommands that modify state are logged persistently to the pool in their original form.
939 .sp
940 .ne 2
941 .mk
942 .na
943 \fB\fBzfs ?\fR\fR
944 .ad
945 .sp .6
946 .RS 4n
947 Displays a help message.
948 .RE
949
950 .sp
951 .ne 2
952 .mk
953 .na
954 \fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR\fR
955 .ad
956 .sp .6
957 .RS 4n
958 Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the "mountpoint" property inherited from the parent.
959 .sp
960 .ne 2
961 .mk
962 .na
963 \fB\fB-p\fR\fR
964 .ad
965 .sp .6
966 .RS 4n
967 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" 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.
968 .RE
969
970 .sp
971 .ne 2
972 .mk
973 .na
974 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
975 .ad
976 .sp .6
977 .RS 4n
978 Sets the specified property as if "\fBzfs set property=value\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.
979 .RE
980
981 .RE
982
983 .sp
984 .ne 2
985 .mk
986 .na
987 \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
988 .ad
989 .sp .6
990 .RS 4n
991 Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/{dsk,rdsk}/\fIpath\fR\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.
992 .sp
993 \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.
994 .sp
995 .ne 2
996 .mk
997 .na
998 \fB\fB-p\fR\fR
999 .ad
1000 .sp .6
1001 .RS 4n
1002 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" 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.
1003 .RE
1004
1005 .sp
1006 .ne 2
1007 .mk
1008 .na
1009 \fB\fB-s\fR\fR
1010 .ad
1011 .sp .6
1012 .RS 4n
1013 Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
1014 .RE
1015
1016 .sp
1017 .ne 2
1018 .mk
1019 .na
1020 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1021 .ad
1022 .sp .6
1023 .RS 4n
1024 Sets the specified property as if "\fBzfs set property=value\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.
1025 .RE
1026
1027 .sp
1028 .ne 2
1029 .mk
1030 .na
1031 \fB\fB-b\fR \fIblocksize\fR\fR
1032 .ad
1033 .sp .6
1034 .RS 4n
1035 Equivalent to "\fB\fR\fB-o\fR \fBvolblocksize=\fIblocksize\fR\fR". If this option is specified in conjunction with "\fB\fR\fB-o\fR \fBvolblocksize\fR", the resulting behavior is undefined.
1036 .RE
1037
1038 .RE
1039
1040 .sp
1041 .ne 2
1042 .mk
1043 .na
1044 \fB\fBzfs destroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1045 .ad
1046 .sp .6
1047 .RS 4n
1048 Destroys 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, snapshots, clones).
1049 .sp
1050 .ne 2
1051 .mk
1052 .na
1053 \fB\fB-r\fR\fR
1054 .ad
1055 .sp .6
1056 .RS 4n
1057 Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
1058 .RE
1059
1060 .sp
1061 .ne 2
1062 .mk
1063 .na
1064 \fB\fB-R\fR\fR
1065 .ad
1066 .sp .6
1067 .RS 4n
1068 Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendent file systems.
1069 .RE
1070
1071 .sp
1072 .ne 2
1073 .mk
1074 .na
1075 \fB\fB-f\fR\fR
1076 .ad
1077 .sp .6
1078 .RS 4n
1079 Force 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.
1080 .RE
1081
1082 Extreme care should be taken when applying either the \fB-r\fR or the \fB-f\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use. 
1083 .RE
1084
1085 .sp
1086 .ne 2
1087 .mk
1088 .na
1089 \fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR
1090 .ad
1091 .sp .6
1092 .RS 4n
1093 Creates a snapshot with the given name. See the "Snapshots" section for details.
1094 .sp
1095 .ne 2
1096 .mk
1097 .na
1098 \fB\fB-r\fR\fR
1099 .ad
1100 .sp .6
1101 .RS 4n
1102 Recursively create snapshots of all descendent datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
1103 .RE
1104
1105 .sp
1106 .ne 2
1107 .mk
1108 .na
1109 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1110 .ad
1111 .sp .6
1112 .RS 4n
1113 Sets the specified property; see "\fBzfs create\fR" for details.
1114 .RE
1115
1116 .RE
1117
1118 .sp
1119 .ne 2
1120 .mk
1121 .na
1122 \fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
1123 .ad
1124 .sp .6
1125 .RS 4n
1126 Roll 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.
1127 .sp
1128 .ne 2
1129 .mk
1130 .na
1131 \fB\fB-r\fR\fR
1132 .ad
1133 .sp .6
1134 .RS 4n
1135 Recursively destroy any snapshots more recent than the one specified.
1136 .RE
1137
1138 .sp
1139 .ne 2
1140 .mk
1141 .na
1142 \fB\fB-R\fR\fR
1143 .ad
1144 .sp .6
1145 .RS 4n
1146 Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
1147 .RE
1148
1149 .sp
1150 .ne 2
1151 .mk
1152 .na
1153 \fB\fB-f\fR\fR
1154 .ad
1155 .sp .6
1156 .RS 4n
1157 Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
1158 .RE
1159
1160 .RE
1161
1162 .sp
1163 .ne 2
1164 .mk
1165 .na
1166 \fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
1167 .ad
1168 .sp .6
1169 .RS 4n
1170 Creates 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.
1171 .sp
1172 .ne 2
1173 .mk
1174 .na
1175 \fB\fB-p\fR\fR
1176 .ad
1177 .sp .6
1178 .RS 4n
1179 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
1180 .RE
1181
1182 .sp
1183 .ne 2
1184 .mk
1185 .na
1186 \fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
1187 .ad
1188 .sp .6
1189 .RS 4n
1190 Sets the specified property; see "\fBzfs create\fR" for details.
1191 .RE
1192
1193 .RE
1194
1195 .sp
1196 .ne 2
1197 .mk
1198 .na
1199 \fB\fBzfs promote\fR \fIclone-filesystem\fR\fR
1200 .ad
1201 .sp .6
1202 .RS 4n
1203 Promotes 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. 
1204 .sp
1205 The 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.
1206 .RE
1207
1208 .sp
1209 .ne 2
1210 .mk
1211 .na
1212 \fB\fBzfs rename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1213 .ad
1214 .br
1215 .na
1216 \fB\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1217 .ad
1218 .br
1219 .na
1220 \fB\fBzfs rename\fR [\fB-p\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
1221 .ad
1222 .sp .6
1223 .RS 4n
1224 Renames 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.
1225 .sp
1226 .ne 2
1227 .mk
1228 .na
1229 \fB\fB-p\fR\fR
1230 .ad
1231 .sp .6
1232 .RS 4n
1233 Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the "mountpoint" property inherited from their parent.
1234 .RE
1235
1236 .RE
1237
1238 .sp
1239 .ne 2
1240 .mk
1241 .na
1242 \fB\fBzfs rename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR\fR
1243 .ad
1244 .sp .6
1245 .RS 4n
1246 Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively.
1247 .RE
1248
1249 .sp
1250 .ne 2
1251 .mk
1252 .na
1253 \fB\fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]]\fR
1254 .ad
1255 .br
1256 .na
1257 \fB[ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR
1258 .ad
1259 .sp .6
1260 .RS 4n
1261 Lists 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 "listsnaps" property is "on" (the default is "off") . The following fields are displayed:
1262 .sp
1263 .in +2
1264 .nf
1265 name,used,available,referenced,mountpoint
1266 .fi
1267 .in -2
1268 .sp
1269
1270 .sp
1271 .ne 2
1272 .mk
1273 .na
1274 \fB\fB-H\fR\fR
1275 .ad
1276 .sp .6
1277 .RS 4n
1278 Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary whitespace.
1279 .RE
1280
1281 .sp
1282 .ne 2
1283 .mk
1284 .na
1285 \fB\fB-r\fR\fR
1286 .ad
1287 .sp .6
1288 .RS 4n
1289 Recursively display any children of the dataset on the command line. 
1290 .RE
1291
1292 .sp
1293 .ne 2
1294 .mk
1295 .na
1296 \fB\fB-o\fR \fIproperty\fR\fR
1297 .ad
1298 .sp .6
1299 .RS 4n
1300 A comma-separated list of properties to display. The property must be:
1301 .RS +4
1302 .TP
1303 .ie t \(bu
1304 .el o
1305 one of the properties described in the "Native Properties" section.
1306 .RE
1307 .RS +4
1308 .TP
1309 .ie t \(bu
1310 .el o
1311 a user property.
1312 .RE
1313 .RS +4
1314 .TP
1315 .ie t \(bu
1316 .el o
1317 the value "name" to display the dataset name.
1318 .RE
1319 .RS +4
1320 .TP
1321 .ie t \(bu
1322 .el o
1323 the value "space" to display space usage properties on file systems and volumes. This is a shortcut for "\fB-o name,avail,used,usedsnap,usedds, usedrefreserv,usedchild -t filesystem,volume\fR".
1324 .RE
1325 .RE
1326
1327 .sp
1328 .ne 2
1329 .mk
1330 .na
1331 \fB\fB-s\fR \fIproperty\fR\fR
1332 .ad
1333 .sp .6
1334 .RS 4n
1335 A property to use 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 "name" 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.
1336 .sp
1337 The following is a list of sorting criteria:
1338 .RS +4
1339 .TP
1340 .ie t \(bu
1341 .el o
1342 Numeric types sort in numeric order.
1343 .RE
1344 .RS +4
1345 .TP
1346 .ie t \(bu
1347 .el o
1348 String types sort in alphabetical order.
1349 .RE
1350 .RS +4
1351 .TP
1352 .ie t \(bu
1353 .el o
1354 Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
1355 .RE
1356 .RS +4
1357 .TP
1358 .ie t \(bu
1359 .el o
1360 If no sorting options are specified the existing behavior of "\fBzfs list\fR" is preserved.
1361 .RE
1362 .RE
1363
1364 .sp
1365 .ne 2
1366 .mk
1367 .na
1368 \fB\fB-S\fR \fIproperty\fR\fR
1369 .ad
1370 .sp .6
1371 .RS 4n
1372 Same as the \fB-s\fR option, but sorts by property in descending order. 
1373 .RE
1374
1375 .sp
1376 .ne 2
1377 .mk
1378 .na
1379 \fB\fB-t\fR \fItype\fR\fR
1380 .ad
1381 .sp .6
1382 .RS 4n
1383 A comma-separated list of types to display, where "type" is one of "filesystem", "snapshot" , "volume" or "all". For example, specifying "\fB-t snapshot\fR" displays only snapshots.
1384 .RE
1385
1386 .RE
1387
1388 .sp
1389 .ne 2
1390 .mk
1391 .na
1392 \fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1393 .ad
1394 .sp .6
1395 .RS 4n
1396 Sets 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 "B", "K", "M", "G", "T", "P", "E", "Z" (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). Properties cannot be set on snapshots.
1397 .RE
1398
1399 .sp
1400 .ne 2
1401 .mk
1402 .na
1403 \fB\fBzfs get\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,...] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1404 .ad
1405 .sp .6
1406 .RS 4n
1407 Displays 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:
1408 .sp
1409 .in +2
1410 .nf
1411     name      Dataset name
1412      property  Property name
1413      value     Property value
1414      source    Property source. Can either be local, default,
1415                temporary, inherited, or none (-).
1416 .fi
1417 .in -2
1418 .sp
1419
1420 All 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.
1421 .sp
1422 The special value "all" can be used to display all properties that apply to the given dataset's type (filesystem, volume or snapshot).
1423 .sp
1424 .ne 2
1425 .mk
1426 .na
1427 \fB\fB-r\fR\fR
1428 .ad
1429 .sp .6
1430 .RS 4n
1431 Recursively display properties for any children.
1432 .RE
1433
1434 .sp
1435 .ne 2
1436 .mk
1437 .na
1438 \fB\fB-H\fR\fR
1439 .ad
1440 .sp .6
1441 .RS 4n
1442 Display 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.
1443 .RE
1444
1445 .sp
1446 .ne 2
1447 .mk
1448 .na
1449 \fB\fB-o\fR \fIfield\fR\fR
1450 .ad
1451 .sp .6
1452 .RS 4n
1453 A comma-separated list of columns to display. "name,property,value,source" is the default value. 
1454 .RE
1455
1456 .sp
1457 .ne 2
1458 .mk
1459 .na
1460 \fB\fB-s\fR \fIsource\fR\fR
1461 .ad
1462 .sp .6
1463 .RS 4n
1464 A 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: "local,default,inherited,temporary,none". The default value is all sources.
1465 .RE
1466
1467 .sp
1468 .ne 2
1469 .mk
1470 .na
1471 \fB\fB-p\fR\fR
1472 .ad
1473 .sp .6
1474 .RS 4n
1475 Display numbers in parsable (exact) values.
1476 .RE
1477
1478 .RE
1479
1480 .sp
1481 .ne 2
1482 .mk
1483 .na
1484 \fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1485 .ad
1486 .sp .6
1487 .RS 4n
1488 Clears 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.
1489 .sp
1490 .ne 2
1491 .mk
1492 .na
1493 \fB\fB-r\fR\fR
1494 .ad
1495 .sp .6
1496 .RS 4n
1497 Recursively inherit the given property for all children.
1498 .RE
1499
1500 .RE
1501
1502 .sp
1503 .ne 2
1504 .mk
1505 .na
1506 \fB\fBzfs upgrade\fR [\fB-v\fR]\fR
1507 .ad
1508 .sp .6
1509 .RS 4n
1510 Displays a list of file systems that are not the most recent version.
1511 .RE
1512
1513 .sp
1514 .ne 2
1515 .mk
1516 .na
1517 \fB\fBzfs upgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] [\fB-a\fR | \fIfilesystem\fR]\fR
1518 .ad
1519 .sp .6
1520 .RS 4n
1521 Upgrades 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 can not be accessed on systems running older versions of the software.
1522 .sp
1523 The file system version is independent of the pool version (see \fBzpool\fR(1M) for information on the "\fBzpool upgrade\fR" command). 
1524 .sp
1525 The file system version does not have to be upgraded when the pool version is upgraded, and vice versa.
1526 .sp
1527 .ne 2
1528 .mk
1529 .na
1530 \fB\fB-a\fR\fR
1531 .ad
1532 .sp .6
1533 .RS 4n
1534 Upgrade all file systems on all imported pools.
1535 .RE
1536
1537 .sp
1538 .ne 2
1539 .mk
1540 .na
1541 \fB\fIfilesystem\fR\fR
1542 .ad
1543 .sp .6
1544 .RS 4n
1545 Upgrade the specified file system. 
1546 .RE
1547
1548 .sp
1549 .ne 2
1550 .mk
1551 .na
1552 \fB\fB-r\fR\fR
1553 .ad
1554 .sp .6
1555 .RS 4n
1556 Upgrade the specified file system and all descendent file systems 
1557 .RE
1558
1559 .sp
1560 .ne 2
1561 .mk
1562 .na
1563 \fB\fB-V\fR \fIversion\fR\fR
1564 .ad
1565 .sp .6
1566 .RS 4n
1567 Upgrade 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.
1568 .RE
1569
1570 .RE
1571
1572 .sp
1573 .ne 2
1574 .mk
1575 .na
1576 \fB\fBzfs mount\fR\fR
1577 .ad
1578 .sp .6
1579 .RS 4n
1580 Displays all \fBZFS\fR file systems currently mounted.
1581 .RE
1582
1583 .sp
1584 .ne 2
1585 .mk
1586 .na
1587 \fB\fBzfs mount\fR [\fB-vO\fR] [\fB-o\fR \fIoptions\fR] \fB-a\fR | \fIfilesystem\fR\fR
1588 .ad
1589 .sp .6
1590 .RS 4n
1591 Mounts \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1592 .sp
1593 .ne 2
1594 .mk
1595 .na
1596 \fB\fB-o\fR \fIoptions\fR\fR
1597 .ad
1598 .sp .6
1599 .RS 4n
1600 An 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.
1601 .RE
1602
1603 .sp
1604 .ne 2
1605 .mk
1606 .na
1607 \fB\fB-O\fR\fR
1608 .ad
1609 .sp .6
1610 .RS 4n
1611 Perform an overlay mount. See \fBmount\fR(1M) for more information.
1612 .RE
1613
1614 .sp
1615 .ne 2
1616 .mk
1617 .na
1618 \fB\fB-v\fR\fR
1619 .ad
1620 .sp .6
1621 .RS 4n
1622 Report mount progress.
1623 .RE
1624
1625 .sp
1626 .ne 2
1627 .mk
1628 .na
1629 \fB\fB-a\fR\fR
1630 .ad
1631 .sp .6
1632 .RS 4n
1633 Mount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
1634 .RE
1635
1636 .sp
1637 .ne 2
1638 .mk
1639 .na
1640 \fB\fIfilesystem\fR\fR
1641 .ad
1642 .sp .6
1643 .RS 4n
1644 Mount the specified filesystem.
1645 .RE
1646
1647 .RE
1648
1649 .sp
1650 .ne 2
1651 .mk
1652 .na
1653 \fB\fBzfs unmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
1654 .ad
1655 .sp .6
1656 .RS 4n
1657 Unmounts currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
1658 .sp
1659 .ne 2
1660 .mk
1661 .na
1662 \fB\fB-f\fR\fR
1663 .ad
1664 .sp .6
1665 .RS 4n
1666 Forcefully unmount the file system, even if it is currently in use.
1667 .RE
1668
1669 .sp
1670 .ne 2
1671 .mk
1672 .na
1673 \fB\fB-a\fR\fR
1674 .ad
1675 .sp .6
1676 .RS 4n
1677 Unmount all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
1678 .RE
1679
1680 .sp
1681 .ne 2
1682 .mk
1683 .na
1684 \fB\fIfilesystem\fR|\fImountpoint\fR\fR
1685 .ad
1686 .sp .6
1687 .RS 4n
1688 Unmount the specified filesystem. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
1689 .RE
1690
1691 .RE
1692
1693 .sp
1694 .ne 2
1695 .mk
1696 .na
1697 \fB\fBzfs share\fR \fB-a\fR | \fIfilesystem\fR\fR
1698 .ad
1699 .sp .6
1700 .RS 4n
1701 Shares available \fBZFS\fR file systems. 
1702 .sp
1703 .ne 2
1704 .mk
1705 .na
1706 \fB\fB-a\fR\fR
1707 .ad
1708 .sp .6
1709 .RS 4n
1710 Share all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
1711 .RE
1712
1713 .sp
1714 .ne 2
1715 .mk
1716 .na
1717 \fB\fIfilesystem\fR\fR
1718 .ad
1719 .sp .6
1720 .RS 4n
1721 Share the specified filesystem according to the "sharenfs" and "sharesmb" properties. File systems are shared when the "sharenfs" or "sharesmb" property is set.
1722 .RE
1723
1724 .RE
1725
1726 .sp
1727 .ne 2
1728 .mk
1729 .na
1730 \fB\fBzfs unshare\fR \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
1731 .ad
1732 .sp .6
1733 .RS 4n
1734 Unshares currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
1735 .sp
1736 .ne 2
1737 .mk
1738 .na
1739 \fB\fB-a\fR\fR
1740 .ad
1741 .sp .6
1742 .RS 4n
1743 Unshare all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
1744 .RE
1745
1746 .sp
1747 .ne 2
1748 .mk
1749 .na
1750 \fB\fIfilesystem\fR|\fImountpoint\fR\fR
1751 .ad
1752 .sp .6
1753 .RS 4n
1754 Unshare the specified filesystem. The command can also be given a path to a \fBZFS\fR file system shared on the system.
1755 .RE
1756
1757 .RE
1758
1759 .sp
1760 .ne 2
1761 .mk
1762 .na
1763 \fB\fBzfs send\fR [\fB-vR\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR\fR
1764 .ad
1765 .sp .6
1766 .RS 4n
1767 Creates 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.
1768 .sp
1769 .ne 2
1770 .mk
1771 .na
1772 \fB\fB-i\fR \fIsnapshot\fR\fR
1773 .ad
1774 .sp .6
1775 .RS 4n
1776 Generate 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 "@"), and it is assumed to be from the same file system as the second \fIsnapshot\fR.
1777 .sp
1778 If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, "pool/fs@origin", not just "@origin").
1779 .RE
1780
1781 .sp
1782 .ne 2
1783 .mk
1784 .na
1785 \fB\fB-I\fR \fIsnapshot\fR\fR
1786 .ad
1787 .sp .6
1788 .RS 4n
1789 Generate 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.
1790 .RE
1791
1792 .sp
1793 .ne 2
1794 .mk
1795 .na
1796 \fB\fB-R\fR\fR
1797 .ad
1798 .sp .6
1799 .RS 4n
1800 Generate a replication stream package, which will replicate the specified filesystem, and all descendant file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
1801 .sp
1802 If 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 recieved, snapshots and file systems that do not exist on the sending side are destroyed. 
1803 .RE
1804
1805 .sp
1806 .ne 2
1807 .mk
1808 .na
1809 \fB\fB-v\fR\fR
1810 .ad
1811 .sp .6
1812 .RS 4n
1813 Print verbose information about the stream package generated.
1814 .RE
1815
1816 The format of the stream is evolving. No backwards compatibility is guaranteed. You may not be able to receive your streams on future versions of \fBZFS\fR.
1817 .RE
1818
1819 .sp
1820 .ne 2
1821 .mk
1822 .na
1823 \fB\fBzfs receive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1824 .ad
1825 .br
1826 .na
1827 \fB\fBzfs receive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR\fR
1828 .ad
1829 .sp .6
1830 .RS 4n
1831 Creates 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".
1832 .sp
1833 If 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 re-created, which means the \fBzvol\fR cannot be accessed during the \fBreceive\fR operation.
1834 .sp
1835 The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the \fB-d\fR option.
1836 .sp
1837 If 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 the \fB-d\fR option is specified, the snapshot name is determined by appending the sent snapshot's name to the specified \fIfilesystem\fR. If the \fB-d\fR option is specified, any required file systems within the specified one are created.
1838 .sp
1839 .ne 2
1840 .mk
1841 .na
1842 \fB\fB-d\fR\fR
1843 .ad
1844 .sp .6
1845 .RS 4n
1846 Use the name of the sent snapshot to determine the name of the new snapshot as described in the paragraph above.
1847 .RE
1848
1849 .sp
1850 .ne 2
1851 .mk
1852 .na
1853 \fB\fB-v\fR\fR
1854 .ad
1855 .sp .6
1856 .RS 4n
1857 Print verbose information about the stream and the time required to perform the receive operation.
1858 .RE
1859
1860 .sp
1861 .ne 2
1862 .mk
1863 .na
1864 \fB\fB-n\fR\fR
1865 .ad
1866 .sp .6
1867 .RS 4n
1868 Do 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.
1869 .RE
1870
1871 .sp
1872 .ne 2
1873 .mk
1874 .na
1875 \fB\fB-F\fR\fR
1876 .ad
1877 .sp .6
1878 .RS 4n
1879 Force 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 "z\fBfs send -R -[iI]\fR"), destroy snapshots and file systems that do not exist on the sending side.
1880 .RE
1881
1882 .RE
1883
1884 .sp
1885 .ne 2
1886 .mk
1887 .na
1888 \fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR
1889 .ad
1890 .br
1891 .na
1892 \fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
1893 .ad
1894 .sp .6
1895 .RS 4n
1896 Delegates \fBZFS\fR administration permission for the file systems to non-privileged users.
1897 .sp
1898 .ne 2
1899 .mk
1900 .na
1901 \fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR
1902 .ad
1903 .sp .6
1904 .RS 4n
1905 Specifies 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.
1906 .RE
1907
1908 .sp
1909 .ne 2
1910 .mk
1911 .na
1912 \fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR
1913 .ad
1914 .sp .6
1915 .RS 4n
1916 Specifies 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" ("@") , may be specified. See the \fB-s\fR form below for details.
1917 .RE
1918
1919 .sp
1920 .ne 2
1921 .mk
1922 .na
1923 \fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR
1924 .ad
1925 .sp .6
1926 .RS 4n
1927 Specifies 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.
1928 .RE
1929
1930 .RE
1931
1932 .sp
1933 .LP
1934 Permissions are generally the ability to use a \fBZFS\fR subcommand or change a \fBZFS\fR property. The following permissions are available:
1935 .sp
1936 .in +2
1937 .nf
1938 NAME         TYPE         NOTES
1939 allow        subcommand   Must also have the permission
1940                            that is being allowed.
1941 clone        subcommand   Must also have the 'create' ability
1942                            and the 'mount' ability in the origin 
1943                            file system.
1944 create       subcommand   Must also have the 'mount' ability.
1945 destroy      subcommand   Must also have the 'mount' ability.     
1946 mount        subcommand   Allows mount, unmount, and
1947                            create/remove zvol device links.
1948 promote      subcommand   Must also have the 'mount' ability and
1949                            'promote' ability in the origin file system.    
1950 receive      subcommand   Must also have the 'mount' ability and 
1951                            the 'create' ability.     
1952 rename       subcommand   Must also have the 'mount' ability and
1953                            the 'create' ability in the new parent.
1954 rollback     subcommand   Must also have the 'mount' ability.      
1955 snapshot     subcommand   Must also have the 'mount' ability.
1956 share        subcommand   Allows share and unshare.
1957 send         subcommand
1958        
1959        
1960 aclinherit       property
1961 aclmode          property
1962 atime            property
1963 canmount         property
1964 checksum         property
1965 compression      property
1966 copies           property
1967 devices          property
1968 exec             property
1969 mountpoint       property
1970 primarycache     property
1971 quota            property
1972 readonly         property
1973 recordsize       property
1974 reservation      property
1975 secondarycache   property
1976 setuid           property
1977 shareiscsi       property
1978 sharenfs         property
1979 snapdir          property
1980 version          property
1981 volsize          property
1982 xattr            property
1983 zoned            property
1984 userprop         other        Allows changing any user property.
1985 .fi
1986 .in -2
1987 .sp
1988
1989 .sp
1990 .ne 2
1991 .mk
1992 .na
1993 \fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
1994 .ad
1995 .sp .6
1996 .RS 4n
1997 Sets "create time" permissions. These permissions are granted (locally) to the creator of any newly-created descendent file system.
1998 .RE
1999
2000 .sp
2001 .ne 2
2002 .mk
2003 .na
2004 \fB\fBzfs allow\fR \fB-s\fR @setname \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
2005 .ad
2006 .sp .6
2007 .RS 4n
2008 Defines 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" ("@"), and can be no more than 64 characters long.
2009 .RE
2010
2011 .sp
2012 .ne 2
2013 .mk
2014 .na
2015 \fB\fBzfs unallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR
2016 .ad
2017 .br
2018 .na
2019 \fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] \fIfilesystem\fR|\fIvolume\fR\fR
2020 .ad
2021 .br
2022 .na
2023 \fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2024 .ad
2025 .br
2026 .na
2027 \fB\fIfilesystem\fR|\fIvolume\fR\fR
2028 .ad
2029 .sp .6
2030 .RS 4n
2031 Removes 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.
2032 .sp
2033 .ne 2
2034 .mk
2035 .na
2036 \fB\fB-r\fR\fR
2037 .ad
2038 .sp .6
2039 .RS 4n
2040 Recursively remove the permissions from this file system and all descendents.
2041 .RE
2042
2043 .RE
2044
2045 .sp
2046 .ne 2
2047 .mk
2048 .na
2049 \fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @setname [\fIperm\fR|@\fIsetname\fR[,...]]\fR
2050 .ad
2051 .br
2052 .na
2053 \fB\fIfilesystem\fR|\fIvolume\fR\fR
2054 .ad
2055 .sp .6
2056 .RS 4n
2057 Removes permissions from a permission set. If no permissions are specified, then all permissions are removed, thus removing the set entirely.
2058 .RE
2059
2060 .SH EXAMPLES
2061 .LP
2062 \fBExample 1 \fRCreating a ZFS File System Hierarchy
2063 .sp
2064 .LP
2065 The 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 automatically inherited by the child file system.
2066
2067 .sp
2068 .in +2
2069 .nf
2070 # zfs create pool/home
2071 # zfs set mountpoint=/export/home pool/home
2072 # zfs create pool/home/bob
2073 .fi
2074 .in -2
2075 .sp
2076
2077 .LP
2078 \fBExample 2 \fRCreating a ZFS Snapshot
2079 .sp
2080 .LP
2081 The following command creates a snapshot named "yesterday". This snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of the "\fBpool/home/bob\fR" file system.
2082
2083 .sp
2084 .in +2
2085 .nf
2086 # zfs snapshot pool/home/bob@yesterday
2087 .fi
2088 .in -2
2089 .sp
2090
2091 .LP
2092 \fBExample 3 \fRTaking and destroying multiple snapshots
2093 .sp
2094 .LP
2095 The 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 ".zfs/snapshot" directory at the root of its file system. The second command destroys the newly created snapshots.
2096
2097 .sp
2098 .in +2
2099 .nf
2100 # \fBzfs snapshot -r pool/home@yesterday\fR
2101 \fB# zfs destroy -r pool/home@yesterday\fR
2102 .fi
2103 .in -2
2104 .sp
2105
2106 .LP
2107 \fBExample 4 \fRTurning Off Compression
2108 .sp
2109 .LP
2110 The following commands turn compression off for all file systems under "\fBpool/home\fR", but explicitly turns it on for "\fBpool/home/anne\fR".
2111
2112 .sp
2113 .in +2
2114 .nf
2115 \fB# zfs set compression=off pool/home
2116 # zfs set compression=on pool/home/anne\fR
2117 .fi
2118 .in -2
2119 .sp
2120
2121 .LP
2122 \fBExample 5 \fRListing ZFS Datasets
2123 .sp
2124 .LP
2125 The following command lists all active file systems and volumes in the system. Snapshots are displayed if the "listsnaps" property is "on" (the default is "off") . See \fBzpool\fR(1M) for more information on pool properties.
2126
2127 .sp
2128 .in +2
2129 .nf
2130 \fB# zfs list\fR
2131
2132
2133    NAME                      USED  AVAIL  REFER  MOUNTPOINT
2134    pool                      450K   457G    18K  /pool
2135    pool/home                 315K   457G    21K  /export/home
2136    pool/home/anne             18K   457G    18K  /export/home/anne
2137    pool/home/bob             276K   457G   276K  /export/home/bob
2138 .fi
2139 .in -2
2140 .sp
2141
2142 .LP
2143 \fBExample 6 \fRSetting a Quota on a ZFS File System
2144 .sp
2145 .LP
2146 The following command sets a quota of 50 gbytes for "\fBpool/home/bob\fR".
2147
2148 .sp
2149 .in +2
2150 .nf
2151 \fB# zfs set quota=50G pool/home/bob\fR
2152 .fi
2153 .in -2
2154 .sp
2155
2156 .LP
2157 \fBExample 7 \fRListing ZFS Properties
2158 .sp
2159 .LP
2160 The following command lists all properties for "\fBpool/home/bob\fR".
2161
2162 .sp
2163 .in +2
2164 .nf
2165 \fB# zfs get all pool/home/bob\fR
2166
2167
2168 NAME           PROPERTY              VALUE                  SOURCE
2169 pool/home/bob  type                  filesystem             -
2170 pool/home/bob  creation              Thu Jul 12 14:44 2007  -
2171 pool/home/bob  used                  276K                   -
2172 pool/home/bob  available             50.0G                  -
2173 pool/home/bob  referenced            276K                   -
2174 pool/home/bob  compressratio         1.00x                  -
2175 pool/home/bob  mounted               yes                    -
2176 pool/home/bob  quota                 50G                    local
2177 pool/home/bob  reservation           none                   default
2178 pool/home/bob  recordsize            128K                   default
2179 pool/home/bob  mountpoint            /export/home/bob       inherited 
2180                                                             from
2181                                                             pool/home
2182 pool/home/bob  sharenfs              off                    default
2183 pool/home/bob  checksum              on                     default
2184 pool/home/bob  compression           off                    default
2185 pool/home/bob  atime                 on                     default
2186 pool/home/bob  devices               on                     default
2187 pool/home/bob  exec                  on                     default
2188 pool/home/bob  setuid                on                     default
2189 pool/home/bob  readonly              off                    default
2190 pool/home/bob  zoned                 off                    default
2191 pool/home/bob  snapdir               hidden                 default
2192 pool/home/bob  aclmode               groupmask              default
2193 pool/home/bob  aclinherit            restricted             default
2194 pool/home/bob  canmount              on                     default
2195 pool/home/bob  shareiscsi            off                    default
2196 pool/home/bob  xattr                 on                     default
2197 pool/home/bob  copies                1                      default
2198 pool/home/bob  version               1                      -
2199 pool/home/bob  utf8only              off                    -
2200 pool/home/bob  normalization         none                   -
2201 pool/home/bob  casesensitivity       sensitive              -
2202 pool/home/bob  vscan                 off                    default
2203 pool/home/bob  nbmand                off                    default
2204 pool/home/bob  sharesmb              off                    default
2205 pool/home/bob  refquota              10M                    local
2206 pool/home/bob  refreservation        none                   default
2207 pool/home/bob  primarycache          all                    default
2208 pool/home/bob  secondarycache        a                      default
2209 pool/home/bob  usedbysnapshots       0                      -
2210 pool/home/bob  usedbydataset         18K                    -
2211 pool/home/bob  usedbychildren        0                      -
2212 pool/home/bob  usedbyrefreservation  0                      -
2213     
2214 .fi
2215 .in -2
2216 .sp
2217
2218 .sp
2219 .LP
2220 The following command gets a single property value.
2221
2222 .sp
2223 .in +2
2224 .nf
2225 \fB# zfs get -H -o value compression pool/home/bob\fR
2226 on
2227 .fi
2228 .in -2
2229 .sp
2230
2231 .sp
2232 .LP
2233 The following command lists all properties with local settings for "\fBpool/home/bob\fR".
2234
2235 .sp
2236 .in +2
2237 .nf
2238 \fB# zfs get -r -s local -o name,property,value all pool/home/bob\fR
2239
2240    NAME             PROPERTY      VALUE
2241    pool             compression   on
2242    pool/home        checksum      off
2243 .fi
2244 .in -2
2245 .sp
2246
2247 .LP
2248 \fBExample 8 \fRRolling Back a ZFS File System
2249 .sp
2250 .LP
2251 The following command reverts the contents of "\fBpool/home/anne\fR" to the snapshot named "\fByesterday\fR", deleting all intermediate snapshots.
2252
2253 .sp
2254 .in +2
2255 .nf
2256 \fB# zfs rollback -r pool/home/anne@yesterday\fR
2257 .fi
2258 .in -2
2259 .sp
2260
2261 .LP
2262 \fBExample 9 \fRCreating a ZFS Clone
2263 .sp
2264 .LP
2265 The following command creates a writable file system whose initial contents are the same as "\fBpool/home/bob@yesterday\fR".
2266
2267 .sp
2268 .in +2
2269 .nf
2270 \fB# zfs clone pool/home/bob@yesterday pool/clone\fR
2271 .fi
2272 .in -2
2273 .sp
2274
2275 .LP
2276 \fBExample 10 \fRPromoting a ZFS Clone
2277 .sp
2278 .LP
2279 The 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:
2280
2281 .sp
2282 .in +2
2283 .nf
2284 \fB# zfs create pool/project/production\fR
2285   populate /pool/project/production with data
2286 \fB# zfs snapshot pool/project/production@today
2287 # zfs clone pool/project/production@today pool/project/beta\fR
2288   make changes to /pool/project/beta and test them
2289 \fB# zfs promote pool/project/beta
2290 # zfs rename pool/project/production pool/project/legacy
2291 # zfs rename pool/project/beta pool/project/production\fR
2292   once the legacy version is no longer needed, it can be
2293   destroyed
2294 \fB# zfs destroy pool/project/legacy\fR
2295 .fi
2296 .in -2
2297 .sp
2298
2299 .LP
2300 \fBExample 11 \fRInheriting ZFS Properties
2301 .sp
2302 .LP
2303 The following command causes "\fBpool/home/bob\fR" and "\fBpool/home/anne\fR" to inherit the "checksum" property from their parent.
2304
2305 .sp
2306 .in +2
2307 .nf
2308 \fB# zfs inherit checksum pool/home/bob pool/home/anne\fR
2309 .fi
2310 .in -2
2311 .sp
2312
2313 .LP
2314 \fBExample 12 \fRRemotely Replicating ZFS Data
2315 .sp
2316 .LP
2317 The following commands send a full stream and then an incremental stream to a remote machine, restoring them into "\fBpoolB/received/fs\fR@a" and "\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".
2318
2319 .sp
2320 .in +2
2321 .nf
2322 # zfs send pool/fs@a | \e
2323    ssh host zfs receive poolB/received/fs@a
2324 # zfs send -i a pool/fs@b | ssh host \e
2325    zfs receive poolB/received/fs
2326 .fi
2327 .in -2
2328 .sp
2329
2330 .LP
2331 \fBExample 13 \fRUsing the zfs receive -d Option
2332 .sp
2333 .LP
2334 The 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 be created as an empty file system.
2335
2336 .sp
2337 .in +2
2338 .nf
2339 \fB# zfs send poolA/fsA/fsB@snap | \e
2340    ssh host zfs receive -d poolB/received\fR
2341 .fi
2342 .in -2
2343 .sp
2344
2345 .LP
2346 \fBExample 14 \fRSetting User Properties
2347 .sp
2348 .LP
2349 The following example sets the user defined "com.example:department" property for a dataset.
2350
2351 .sp
2352 .in +2
2353 .nf
2354 \fB# zfs set com.example:department=12345 tank/accounting\fR
2355 .fi
2356 .in -2
2357 .sp
2358
2359 .LP
2360 \fBExample 15 \fRCreating a ZFS Volume as a iSCSI Target Device
2361 .sp
2362 .LP
2363 The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target. 
2364
2365 .sp
2366 .in +2
2367 .nf
2368 \fB# zfs create -V 2g pool/volumes/vol1
2369  # zfs set shareiscsi=on pool/volumes/vol1
2370  # iscsitadm list target\fR
2371  Target: pool/volumes/vol1
2372  iSCSI Name: 
2373  iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
2374  Connections: 0
2375 .fi
2376 .in -2
2377 .sp
2378
2379 .sp
2380 .LP
2381 After the \fBiSCSI\fR target is created, set up the \fBiSCSI\fR initiator. For more information about the Solaris \fBiSCSI\fR initiator, see the Solaris Administration Guide: Devices and File Systems.
2382 .LP
2383 \fBExample 16 \fRPerforming a Rolling Snapshot
2384 .sp
2385 .LP
2386 The 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:
2387
2388 .sp
2389 .in +2
2390 .nf
2391 \fB# zfs destroy -r pool/users@7daysago
2392 # zfs rename -r pool/users@6daysago @7daysago
2393 # zfs rename -r pool/users@5daysago @6daysago
2394 \&...
2395 # zfs rename -r pool/users@yesterday @2daysago
2396 # zfs rename -r pool/users@today @yesterday
2397 # zfs snapshot -r pool/users@today\fR
2398 .fi
2399 .in -2
2400 .sp
2401
2402 .LP
2403 \fBExample 17 \fRSetting sharenfs Property Options on a ZFS File System
2404 .sp
2405 .LP
2406 The following commands show how to set "sharenfs" 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.
2407
2408 .sp
2409 .in +2
2410 .nf
2411 \fB# zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
2412  
2413 .fi
2414 .in -2
2415 .sp
2416
2417 .sp
2418 .LP
2419 If you are using \fBDNS\fR for host name resolution, specify the fully qualified hostname.
2420
2421 .LP
2422 \fBExample 18 \fRDelegating ZFS Administration Permissions on a ZFS Dataset
2423 .sp
2424 .LP
2425 The 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.
2426
2427 .sp
2428 .in +2
2429 .nf
2430 \fB# zfs allow cindys create,destroy,mount,snapshot tank/cindys
2431 # zfs allow tank/cindys\fR
2432 -------------------------------------------------------------
2433 Local+Descendent permissions on (tank/cindys)
2434           user cindys create,destroy,mount,snapshot
2435 -------------------------------------------------------------
2436  
2437 .fi
2438 .in -2
2439 .sp
2440
2441 .sp
2442 .LP
2443 Because 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:
2444 .sp
2445 .in +2
2446 .nf
2447 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
2448 .fi
2449 .in -2
2450 .sp
2451
2452 .LP
2453 \fBExample 19 \fRDelegating Create Time Permissions on a ZFS Dataset
2454 .sp
2455 .LP
2456 The 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.
2457
2458 .sp
2459 .in +2
2460 .nf
2461 \fB# zfs allow staff create,mount tank/users
2462 # zfs allow -c destroy tank/users
2463 # zfs allow tank/users\fR
2464 -------------------------------------------------------------
2465 Create time permissions on (tank/users)
2466           create,destroy
2467 Local+Descendent permissions on (tank/users)
2468           group staff create,mount
2469 ------------------------------------------------------------- 
2470 .fi
2471 .in -2
2472 .sp
2473
2474 .LP
2475 \fBExample 20 \fRDefining and Granting a Permission Set on a ZFS Dataset
2476 .sp
2477 .LP
2478 The 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.
2479
2480 .sp
2481 .in +2
2482 .nf
2483 \fB# zfs allow -s @pset create,destroy,snapshot,mount tank/users
2484 # zfs allow staff @pset tank/users
2485 # zfs allow tank/users
2486 -------------------------------------------------------------
2487 Permission sets on (tank/users)
2488         @pset create,destroy,mount,snapshot
2489 Create time permissions on (tank/users)
2490         create,destroy
2491 Local+Descendent permissions on (tank/users)
2492         group staff @pset,create,mount
2493 -------------------------------------------------------------\fR
2494 .fi
2495 .in -2
2496 .sp
2497
2498 .LP
2499 \fBExample 21 \fRDelegating Property Permissions on a ZFS Dataset
2500 .sp
2501 .LP
2502 The 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.
2503
2504 .sp
2505 .in +2
2506 .nf
2507 \fB# zfs allow cindys quota,reservation users/home
2508 # zfs allow users/home\fR
2509 -------------------------------------------------------------
2510 Local+Descendent permissions on (users/home)
2511         user cindys quota,reservation
2512 -------------------------------------------------------------
2513 cindys% zfs set quota=10G users/home/marks
2514 cindys% zfs get quota users/home/marks
2515 NAME              PROPERTY  VALUE             SOURCE
2516 users/home/marks  quota     10G               local 
2517 .fi
2518 .in -2
2519 .sp
2520
2521 .LP
2522 \fBExample 22 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset
2523 .sp
2524 .LP
2525 The 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.
2526
2527 .sp
2528 .in +2
2529 .nf
2530 \fB# zfs unallow staff snapshot tank/users
2531 # zfs allow tank/users\fR
2532 -------------------------------------------------------------
2533 Permission sets on (tank/users)
2534         @pset create,destroy,mount,snapshot
2535 Create time permissions on (tank/users)
2536         create,destroy
2537 Local+Descendent permissions on (tank/users)
2538         group staff @pset,create,mount
2539 ------------------------------------------------------------- 
2540 .fi
2541 .in -2
2542 .sp
2543
2544 .SH EXIT STATUS
2545 .sp
2546 .LP
2547 The following exit values are returned:
2548 .sp
2549 .ne 2
2550 .mk
2551 .na
2552 \fB\fB0\fR\fR
2553 .ad
2554 .sp .6
2555 .RS 4n
2556 Successful completion. 
2557 .RE
2558
2559 .sp
2560 .ne 2
2561 .mk
2562 .na
2563 \fB\fB1\fR\fR
2564 .ad
2565 .sp .6
2566 .RS 4n
2567 An error occurred.
2568 .RE
2569
2570 .sp
2571 .ne 2
2572 .mk
2573 .na
2574 \fB\fB2\fR\fR
2575 .ad
2576 .sp .6
2577 .RS 4n
2578 Invalid command line options were specified.
2579 .RE
2580
2581 .SH ATTRIBUTES
2582 .sp
2583 .LP
2584 See \fBattributes\fR(5) for descriptions of the following attributes:
2585 .sp
2586
2587 .sp
2588 .TS
2589 tab(\a) box;
2590 cw(2.75i) |cw(2.75i) 
2591 lw(2.75i) |lw(2.75i) 
2592 .
2593 ATTRIBUTE TYPE\aATTRIBUTE VALUE
2594 _
2595 Availability\aSUNWzfsu
2596 _
2597 Interface Stability\aCommitted
2598 .TE
2599
2600 .SH SEE ALSO
2601 .sp
2602 .LP
2603 \fBgzip\fR(1), \fBssh\fR(1), \fBmount\fR(1M), \fBshare\fR(1M), \fBsharemgr\fR(1M), \fBunshare\fR(1M), \fBzonecfg\fR(1M), \fBzpool\fR(1M), \fBchmod\fR(2), \fBstat\fR(2), \fBfsync\fR(3c), \fBdfstab\fR(4), \fBattributes\fR(5)
2604 .sp
2605 .LP
2606 For information about using the \fBZFS\fR web-based management tool and other \fBZFS\fR features, see the \fISolaris ZFS Administration Guide\fR.