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