]> CyberLeo.Net >> Repos - FreeBSD/releng/7.2.git/blob - cddl/contrib/opensolaris/cmd/zfs/zfs.8
Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.
[FreeBSD/releng/7.2.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 "16 Mar 2007" "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-o\fR property=\fIvalue\fR]]... \fIfilesystem\fR
33 .fi
34
35 .LP
36 .nf
37 \fBzfs\fR \fBcreate\fR [\fB-s\fR] [\fB-b\fR \fIblocksize\fR] [[\fB-o\fR property=\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 \fBclone\fR \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
48 .fi
49
50 .LP
51 .nf
52 \fBzfs\fR \fBpromote\fR \fIfilesystem\fR
53 .fi
54
55 .LP
56 .nf
57 \fBzfs\fR \fBrename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR 
58     [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR]
59 .fi
60
61 .LP
62 .nf
63 \fBzfs\fR \fBsnapshot\fR [\fB-r\fR] \fIfilesystem@name\fR|\fIvolume@name\fR
64 .fi
65
66 .LP
67 .nf
68 \fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
69 .fi
70
71 .LP
72 .nf
73 \fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIprop\fR[,\fIprop\fR] ]... [ \fB-t\fR \fItype\fR[,\fItype\fR]...]
74     [ \fB-s\fR \fIprop\fR [\fB-s\fR \fIprop\fR]... [ \fB-S\fR \fIprop\fR [\fB-S\fR \fIprop\fR]... 
75     [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fI/pathname\fR|.\fI/pathname\fR ...
76 .fi
77
78 .LP
79 .nf
80 \fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...
81 .fi
82
83 .LP
84 .nf
85 \fBzfs\fR \fBget\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] 
86     [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fIall\fR | \fIproperty\fR[,\fIproperty\fR]...
87      \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
88 .fi
89
90 .LP
91 .nf
92 \fBzfs\fR \fBinherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR... ...
93 .fi
94
95 .LP
96 .nf
97 \fBzfs\fR \fBmount\fR 
98 .fi
99
100 .LP
101 .nf
102 \fBzfs\fR \fBmount\fR [\fB-o \fIoptions\fR\fR] [\fB-O\fR] \fB-a\fR
103 .fi
104
105 .LP
106 .nf
107 \fBzfs\fR \fBmount\fR [\fB-o \fIoptions\fR\fR] [\fB-O\fR] \fIfilesystem\fR
108 .fi
109
110 .LP
111 .nf
112 \fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB-a\fR
113 .fi
114
115 .LP
116 .nf
117 \fBzfs\fR \fBunmount\fR [\fB-f\fR] \fB\fIfilesystem\fR|\fImountpoint\fR\fR
118 .fi
119
120 .LP
121 .nf
122 \fBzfs\fR \fBshare\fR \fB-a\fR
123 .fi
124
125 .LP
126 .nf
127 \fBzfs\fR \fBshare\fR \fIfilesystem\fR
128 .fi
129
130 .LP
131 .nf
132 \fBzfs\fR \fBunshare\fR [\fB-f\fR] \fB-a\fR
133 .fi
134
135 .LP
136 .nf
137 \fBzfs\fR \fBunshare\fR [\fB-f\fR] \fB\fIfilesystem\fR|\fImountpoint\fR\fR
138 .fi
139
140 .LP
141 .nf
142 \fBzfs\fR \fBsend\fR [\fB-i\fR \fIsnapshot1\fR] \fB\fIsnapshot2\fR\fR
143 .fi
144
145 .LP
146 .nf
147 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR ] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
148 .fi
149
150 .LP
151 .nf
152 \fBzfs\fR \fBreceive\fR [\fB-vnF\fR ] \fB-d\fR \fB\fIfilesystem\fR\fR
153 .fi
154 .LP
155 .nf
156 \fBzfs\fR \fBjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
157 .fi
158 .LP
159 .nf
160 \fBzfs\fR \fBunjail\fR \fBjailid\fR \fB\fIfilesystem\fR\fR
161 .fi
162
163 .SH DESCRIPTION
164 .LP
165 The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(1M). A
166 dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
167 .sp
168 .in +2
169 .nf
170 pool/{filesystem,volume,snapshot}
171 .fi
172 .in -2
173 .sp
174
175 .LP
176 where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
177 .LP
178 A dataset can be one of the following:
179 .sp
180 .ne 2
181 .mk
182 .na
183 \fB\fIfile system\fR\fR
184 .ad
185 .RS 15n
186 .rt  
187 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.
188 .RE
189
190 .sp
191 .ne 2
192 .mk
193 .na
194 \fB\fIvolume\fR\fR
195 .ad
196 .RS 15n
197 .rt  
198 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.
199 .RE
200
201 .sp
202 .ne 2
203 .mk
204 .na
205 \fB\fIsnapshot\fR\fR
206 .ad
207 .RS 15n
208 .rt  
209 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.
210 .RE
211
212 .SS "ZFS File System Hierarchy"
213 .LP
214 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.
215 .LP
216 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.
217 .LP
218 See \fBzpool\fR(1M) for more information on creating and administering pools.
219 .SS "Snapshots"
220 .LP
221 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.
222 .LP
223 Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back, but cannot be accessed independently.
224 .LP
225 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"
226 property.
227 .SS "Clones"
228 .LP
229 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.
230 .LP
231 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"
232 property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
233 .LP
234 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
235 was created from.
236 .SS "Mount Points"
237 .LP
238 Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system will likely 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.
239 All automatically managed file systems are mounted by \fBZFS\fR at boot time.
240 .LP
241 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.
242 .LP
243 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.
244 .LP
245 A file system mountpoint property of "none" prevents the file system from being mounted.
246 .LP
247 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
248 the file system, and the administrator is responsible for mounting and unmounting the file system.
249 .SS "Zones"
250 .LP
251 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.
252 .LP
253 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.
254 .LP
255 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
256 any of its children. However, the "quota" property is controlled by the global administrator.
257 .LP
258 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.
259 .LP
260 For more information about \fBzonecfg\fR syntax, see \fBzonecfg\fR(1M).
261 .LP
262 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.
263 .LP
264 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.
265 .SS "Native Properties"
266 .LP
267 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,
268 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.
269 .LP
270 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
271 that are not applicable to snapshots are not displayed.
272 .LP
273 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: 
274 .sp
275 .in +2
276 .nf
277 "1536M", "1.5g", "1.50GB".
278 .fi
279 .in -2
280 .sp
281
282 .LP
283 The values of non-numeric properties are case sensitive and must be lowercase, except for "mountpoint" and "sharenfs".
284 .LP
285 The first set of 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.
286 .sp
287 .ne 2
288 .mk
289 .na
290 \fBtype\fR
291 .ad
292 .RS 17n
293 .rt  
294 The type of dataset: "filesystem", "volume", "snapshot", or "clone".
295 .RE
296
297 .sp
298 .ne 2
299 .mk
300 .na
301 \fBcreation\fR
302 .ad
303 .RS 17n
304 .rt  
305 The time this dataset was created.
306 .RE
307
308 .sp
309 .ne 2
310 .mk
311 .na
312 \fBused\fR
313 .ad
314 .RS 17n
315 .rt  
316 The amount of space consumed by this dataset and all its descendants. 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 descendant datasets.
317 The amount of space that a dataset consumes from its parent, as well as the amount of space that will be freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
318 .sp
319 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
320 the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
321 .sp
322 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.
323 .RE
324
325 .sp
326 .ne 2
327 .mk
328 .na
329 \fBavailable\fR
330 .ad
331 .RS 17n
332 .rt  
333 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
334 within the pool.
335 .sp
336 This property can also be referred to by its shortened column name, "avail".
337 .RE
338
339 .sp
340 .ne 2
341 .mk
342 .na
343 \fBreferenced\fR
344 .ad
345 .RS 17n
346 .rt  
347 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
348 identical.
349 .sp
350 This property can also be referred to by its shortened column name, "refer".
351 .RE
352
353 .sp
354 .ne 2
355 .mk
356 .na
357 \fBcompressratio\fR
358 .ad
359 .RS 17n
360 .rt  
361 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".
362 .RE
363
364 .sp
365 .ne 2
366 .mk
367 .na
368 \fBmounted\fR
369 .ad
370 .RS 17n
371 .rt  
372 For file systems, indicates whether the file system is currently mounted. This property can be either "yes" or "no".
373 .RE
374
375 .sp
376 .ne 2
377 .mk
378 .na
379 \fBorigin\fR
380 .ad
381 .RS 17n
382 .rt  
383 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.
384 .RE
385
386 .LP
387 The following two properties can be set to control the way space is allocated between datasets. These properties are not inherited, but do affect their descendants.
388 .sp
389 .ne 2
390 .mk
391 .na
392 \fBquota=\fIsize\fR | \fInone\fR\fR
393 .ad
394 .sp .6
395 .RS 4n
396 Limits the amount of space a dataset and its descendants can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendants, including file systems and snapshots. Setting a quota on a descendant of a dataset that already
397 has a quota does not override the ancestor's quota, but rather imposes an additional limit.
398 .sp
399 Quotas cannot be set on volumes, as the "volsize" property acts as an implicit quota.
400 .RE
401
402 .sp
403 .ne 2
404 .mk
405 .na
406 \fBreservation=\fIsize\fR | \fInone\fR\fR
407 .ad
408 .sp .6
409 .RS 4n
410 The minimum amount of space guaranteed to a dataset and its descendants. 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
411 used, and count against the parent datasets' quotas and reservations.
412 .sp
413 This property can also be referred to by its shortened column name, "reserv".
414 .RE
415
416 .sp
417 .ne 2
418 .mk
419 .na
420 \fBvolsize=\fIsize\fR\fR
421 .ad
422 .sp .6
423 .RS 4n
424 For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation. The \fBvolsize\fR can only be set to a
425 multiple of \fBvolblocksize\fR, and cannot be zero.
426 .sp
427 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
428 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.
429 .sp
430 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.
431 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.
432 .RE
433
434 .sp
435 .ne 2
436 .mk
437 .na
438 \fBvolblocksize=\fIblocksize\fR\fR
439 .ad
440 .sp .6
441 .RS 4n
442 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
443 to 128 Kbytes is valid.
444 .sp
445 This property can also be referred to by its shortened column name, "volblock".
446 .RE
447
448 .sp
449 .ne 2
450 .mk
451 .na
452 \fBrecordsize=\fIsize\fR\fR
453 .ad
454 .sp .6
455 .RS 4n
456 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
457 access patterns. 
458 .sp
459 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
460 purpose file systems is strongly discouraged, and may adversely affect performance.
461 .sp
462 The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
463 .sp
464 Changing the file system's \fBrecordsize\fR only affects files created afterward; existing files are unaffected.
465 .sp
466 This property can also be referred to by its shortened column name, "recsize".
467 .RE
468
469 .sp
470 .ne 2
471 .mk
472 .na
473 \fBmountpoint=\fIpath\fR | \fInone\fR | \fIlegacy\fR\fR
474 .ad
475 .sp .6
476 .RS 4n
477 Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
478 .sp
479 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
480 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.
481 .RE
482
483 .sp
484 .ne 2
485 .mk
486 .na
487 \fBsharenfs=\fIon\fR | \fIoff\fR | \fIopts\fR\fR
488 .ad
489 .sp .6
490 .RS 4n
491 Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a sharenfs property of "off" is managed through traditional tools such as \fBshare\fR(1M), \fBunshare\fR(1M), and \fBdfstab\fR(4). Otherwise, the file system is automatically shared and unshared with the "\fBzfs share\fR" and "\fBzfs unshare\fR" commands. If the property is set to "on", the \fBshare\fR(1M) command is invoked with no options. Otherwise, the \fBshare\fR(1M) command is invoked with options equivalent to the contents of this property.
492 .sp
493 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",
494 the file systems are unshared.
495 .RE
496
497 .sp
498 .ne 2
499 .mk
500 .na
501 \fBshareiscsi=\fIon\fR | \fIoff\fR\fR
502 .ad
503 .sp .6
504 .RS 4n
505 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".
506 The default value is "off". In the future, other target types might be supported. For example, "tape".
507 .sp
508 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.
509 .RE
510
511 .sp
512 .ne 2
513 .mk
514 .na
515 \fBchecksum=\fIon\fR | \fIoff\fR | \fIfletcher2\fR, | \fIfletcher4\fR | \fIsha256\fR\fR
516 .ad
517 .sp .6
518 .RS 4n
519 Controls the checksum used to verify data integrity. The default value is "on", which automatically selects an appropriate algorithm (currently, \fIfletcher2\fR, but this may change in future releases). The value "off" disables integrity
520 checking on user data. Disabling checksums is NOT a recommended practice.
521 .RE
522
523 .sp
524 .ne 2
525 .mk
526 .na
527 \fBcompression=\fIon\fR | \fIoff\fR | \fIlzjb\fR | \fIgzip\fR | \fIgzip-N\fR\fR
528 .ad
529 .sp .6
530 .RS 4n
531 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"
532 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",
533 where \fIN\fR is an integer from 1 (fastest) to 9 (best compression ratio). Currently, "gzip" is equivalent to "gzip-6" (which is also the default for \fBgzip\fR(1)).
534 .sp
535 This property can also be referred to by its shortened column name "compress".
536 .RE
537
538 .sp
539 .ne 2
540 .mk
541 .na
542 \fBatime=\fIon\fR | \fIoff\fR\fR
543 .ad
544 .sp .6
545 .RS 4n
546 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
547 is "on".
548 .RE
549
550 .sp
551 .ne 2
552 .mk
553 .na
554 \fBdevices=\fIon\fR | \fIoff\fR\fR
555 .ad
556 .sp .6
557 .RS 4n
558 Controls whether device nodes can be opened on this file system. The default value is "on".
559 .RE
560
561 .sp
562 .ne 2
563 .mk
564 .na
565 \fBexec=\fIon\fR | \fIoff\fR\fR
566 .ad
567 .sp .6
568 .RS 4n
569 Controls whether processes can be executed from within this file system. The default value is "on".
570 .RE
571
572 .sp
573 .ne 2
574 .mk
575 .na
576 \fBsetuid=\fIon\fR | \fIoff\fR\fR
577 .ad
578 .sp .6
579 .RS 4n
580 Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is "on".
581 .RE
582
583 .sp
584 .ne 2
585 .mk
586 .na
587 \fBreadonly=\fIon\fR | \fIoff\fR\fR
588 .ad
589 .sp .6
590 .RS 4n
591 Controls whether this dataset can be modified. The default value is "off".
592 .sp
593 This property can also be referred to by its shortened column name, "rdonly".
594 .RE
595
596 .sp
597 .ne 2
598 .mk
599 .na
600 \fBzoned=\fIon\fR | \fIoff\fR\fR
601 .ad
602 .sp .6
603 .RS 4n
604 Controls whether the dataset is managed from a non-global zone. See the "Zones" section for more information. The default value is "off".
605 .RE
606
607 .sp
608 .ne 2
609 .mk
610 .na
611 \fBsnapdir=\fIhidden\fR | \fIvisible\fR\fR
612 .ad
613 .sp .6
614 .RS 4n
615 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".
616 .RE
617
618 .sp
619 .ne 2
620 .mk
621 .na
622 \fBaclmode=\fBdiscard\fR | \fBgroupmask\fR | \fBpassthrough\fR\fR
623 .ad
624 .sp .6
625 .RS 4n
626 Controls how an \fBACL\fR is modified during \fBchmod\fR(2). A file system with an "aclmode" property of "\fBdiscard\fR"
627 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
628 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 will be made to the \fBACL\fR other than generating the necessary \fBACL\fR entries to represent the new mode of the file or directory.
629 .RE
630
631 .sp
632 .ne 2
633 .mk
634 .na
635 \fBaclinherit=\fBdiscard\fR | \fBnoallow\fR | \fBsecure\fR | \fBpassthrough\fR\fR
636 .ad
637 .sp .6
638 .RS 4n
639 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"
640 property value of "\fBnoallow\fR" only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value "\fBsecure\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.
641 .RE
642
643 .sp
644 .ne 2
645 .mk
646 .na
647 \fBcanmount=\fBon\fR | \fBoff\fR\fR
648 .ad
649 .sp .6
650 .RS 4n
651 If this property is set to "\fBoff\fR", the file system cannot be mounted, and is ignored by "\fBzfs mount -a\fR". This is similar to setting the "mountpoint" property to "\fBnone\fR", except
652 that the dataset still has a normal "mountpoint" property which can be inherited. This allows datasets to be used solely as a mechanism to inherit properties. One use case is to have two logically separate datasets have the same mountpoint, so that the children of both datasets appear
653 in the same directory, but may have different inherited characteristics. The default value is "\fBon\fR". 
654 .sp
655 This property is not inherited.
656 .RE
657
658 .sp
659 .ne 2
660 .mk
661 .na
662 \fBxattr=\fBon\fR | \fBoff\fR\fR
663 .ad
664 .sp .6
665 .RS 4n
666 Controls whether extended attributes are enabled for this file system. The default value is "\fBon\fR".
667 .RE
668
669 .sp
670 .ne 2
671 .mk
672 .na
673 \fBcopies=\fB1\fR | \fB2\fR | \fB3\fR\fR
674 .ad
675 .sp .6
676 .RS 4n
677 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
678 file and dataset, changing the "used" property and counting against quotas and reservations.
679 .sp
680 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.
681 .RE
682
683 .sp
684 .ne 2
685 .mk
686 .na
687 \fBjailed=\fIon\fR | \fIoff\fR\fR
688 .ad
689 .sp .6
690 .RS 4n
691 Controls whether the dataset is managed from within a jail. The default value is "off".
692 .RE
693
694 .SS "iscsioptions"
695 .LP
696 This read-only property, which is hidden, is used by the \fBiSCSI\fR target daemon to store persistent information, such as the \fBIQN\fR. It cannot be viewed or modified using the \fBzfs\fR command. The contents are not intended for external consumers.
697 .SS "Temporary Mount Point Properties"
698 .LP
699 When a file system is mounted, either through \fBmount\fR(1M) for legacy mounts or the "\fBzfs mount\fR" command for normal file systems,
700 its mount options are set according to its properties. The correlation between properties and mount options is as follows:
701 .sp
702 .in +2
703 .nf
704     PROPERTY                MOUNT OPTION
705     devices                 devices/nodevices
706     exec                    exec/noexec
707     readonly                ro/rw
708     setuid                  setuid/nosetuid
709     xattr                   xattr/noxattr
710 .fi
711 .in -2
712 .sp
713
714 .LP
715 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".
716 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.
717 .SS "User Properties"
718 .LP
719 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.
720 .LP
721 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
722 ("_"). 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,
723 and cannot begin with a dash ("-").
724 .LP
725 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
726 different purposes. Property names beginning with "com.sun." are reserved for use by Sun Microsystems.
727 .LP
728 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.
729 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.
730 .SS "Volumes as Swap or Dump Devices"
731 .LP
732 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.
733 .LP
734 Do not swap to a file on a \fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
735 .LP
736 Using a \fBZFS\fR volume as a dump device is not supported.
737 .SH SUBCOMMANDS
738 .LP
739 All subcommands that modify state are logged persistently to the pool in their original form.
740 .sp
741 .ne 2
742 .mk
743 .na
744 \fB\fBzfs ?\fR\fR
745 .ad
746 .sp .6
747 .RS 4n
748 Displays a help message.
749 .RE
750
751 .sp
752 .ne 2
753 .mk
754 .na
755 \fB\fBzfs create\fR [[\fB-o\fR property=value]...] \fIfilesystem\fR\fR
756 .ad
757 .sp .6
758 .RS 4n
759 Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the "mountpoint" property inherited from the parent.
760 .sp
761 .ne 2
762 .mk
763 .na
764 \fB\fB-o\fR property=value\fR
765 .ad
766 .RS 21n
767 .rt  
768 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
769 error results if the same property is specified in multiple \fB-o\fR options.
770 .RE
771
772 .RE
773
774 .sp
775 .ne 2
776 .mk
777 .na
778 \fB\fBzfs create\fR [\fB-s\fR] [\fB-b\fR \fIblocksize\fR] [[\fB-o\fR property=value]...] \fB-V\fR \fIsize\fR \fIvolume\fR\fR
779 .ad
780 .sp .6
781 .RS 4n
782 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
783 the logical size as exported by the device. By default, a reservation of equal size is created.
784 .sp
785 \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.
786 .sp
787 .ne 2
788 .mk
789 .na
790 \fB\fB-s\fR\fR
791 .ad
792 .RS 21n
793 .rt  
794 Creates a sparse volume with no reservation. See "volsize" in the Native Properties section for more information about sparse volumes.
795 .RE
796
797 .sp
798 .ne 2
799 .mk
800 .na
801 \fB\fB-o\fR property=value\fR
802 .ad
803 .RS 21n
804 .rt  
805 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
806 error results if the same property is specified in multiple \fB-o\fR options.
807 .RE
808
809 .sp
810 .ne 2
811 .mk
812 .na
813 \fB\fB-b\fR \fIblocksize\fR\fR
814 .ad
815 .RS 21n
816 .rt  
817 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
818 behavior is undefined.
819 .RE
820
821 .RE
822
823 .sp
824 .ne 2
825 .mk
826 .na
827 \fB\fBzfs destroy\fR [\fB-rRf\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
828 .ad
829 .sp .6
830 .RS 4n
831 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).
832 .sp
833 .ne 2
834 .mk
835 .na
836 \fB\fB-r\fR\fR
837 .ad
838 .RS 6n
839 .rt  
840 Recursively destroy all children. If a snapshot is specified, destroy all snapshots with this name in descendant file systems.
841 .RE
842
843 .sp
844 .ne 2
845 .mk
846 .na
847 \fB\fB-R\fR\fR
848 .ad
849 .RS 6n
850 .rt  
851 Recursively destroy all dependents, including cloned file systems outside the target hierarchy. If a snapshot is specified, destroy all snapshots with this name in descendant file systems.
852 .RE
853
854 .sp
855 .ne 2
856 .mk
857 .na
858 \fB\fB-f\fR\fR
859 .ad
860 .RS 6n
861 .rt  
862 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.
863 .RE
864
865 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. 
866 .RE
867
868 .sp
869 .ne 2
870 .mk
871 .na
872 \fB\fBzfs clone\fR \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
873 .ad
874 .sp .6
875 .RS 4n
876 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.
877 .RE
878
879 .sp
880 .ne 2
881 .mk
882 .na
883 \fB\fBzfs promote\fR \fIfilesystem\fR\fR
884 .ad
885 .sp .6
886 .RS 4n
887 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
888 becomes a clone of the specified file system. 
889 .sp
890 The snaphot 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
891 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.
892 .RE
893
894 .sp
895 .ne 2
896 .mk
897 .na
898 \fB\fBzfs rename\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
899 .ad
900 .sp .6
901 .RS 4n
902 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
903 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.
904 .RE
905
906 .sp
907 .ne 2
908 .mk
909 .na
910 \fB\fBzfs snapshot\fR [\fB-r\fR] \fIfilesystem@name\fR|\fIvolume@name\fR\fR
911 .ad
912 .sp .6
913 .RS 4n
914 Creates a snapshot with the given name. See the "Snapshots" section for details.
915 .sp
916 .ne 2
917 .mk
918 .na
919 \fB\fB-r\fR\fR
920 .ad
921 .RS 6n
922 .rt  
923 Recursively create snapshots of all descendant datasets. Snapshots are taken atomically, so that all recursive snapshots correspond to the same moment in time.
924 .RE
925
926 .RE
927
928 .sp
929 .ne 2
930 .mk
931 .na
932 \fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
933 .ad
934 .sp .6
935 .RS 4n
936 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
937 the most recent one. In order to do so, all intermediate snapshots must be destroyed by specifying the \fB-r\fR option. The file system is unmounted and remounted, if necessary.
938 .sp
939 .ne 2
940 .mk
941 .na
942 \fB\fB-r\fR\fR
943 .ad
944 .RS 6n
945 .rt  
946 Recursively destroy any snapshots more recent than the one specified.
947 .RE
948
949 .sp
950 .ne 2
951 .mk
952 .na
953 \fB\fB-R\fR\fR
954 .ad
955 .RS 6n
956 .rt  
957 Recursively destroy any more recent snapshots, as well as any clones of those snapshots.
958 .RE
959
960 .sp
961 .ne 2
962 .mk
963 .na
964 \fB\fB-f\fR\fR
965 .ad
966 .RS 6n
967 .rt  
968 Force an unmount of any file systems using the "\fBunmount -f\fR" command. 
969 .RE
970
971 .RE
972
973 .sp
974 .ne 2
975 .mk
976 .na
977 \fB\fBzfs\fR \fBlist\fR [\fB-rH\fR] [\fB-o\fR \fIprop\fR[,\fIprop\fR] ]... [ \fB-t\fR \fItype\fR[,\fItype\fR]...] [ \fB-s\fR \fIprop\fR [\fB-s\fR \fIprop\fR]... [ \fB-S\fR \fIprop\fR [\fB-S\fR \fIprop\fR]... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR|\fI/pathname\fR|.\fI/pathname\fR ...\fR
978 .ad
979 .sp .6
980 .RS 4n
981 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:
982 .sp
983 .in +2
984 .nf
985 name,used,available,referenced,mountpoint
986 .fi
987 .in -2
988 .sp
989
990 .sp
991 .ne 2
992 .mk
993 .na
994 \fB\fB-H\fR\fR
995 .ad
996 .RS 11n
997 .rt  
998 Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary whitespace.
999 .RE
1000
1001 .sp
1002 .ne 2
1003 .mk
1004 .na
1005 \fB\fB-r\fR\fR
1006 .ad
1007 .RS 11n
1008 .rt  
1009 Recursively display any children of the dataset on the command line. 
1010 .RE
1011
1012 .sp
1013 .ne 2
1014 .mk
1015 .na
1016 \fB\fB-o\fR \fIprop\fR\fR
1017 .ad
1018 .RS 11n
1019 .rt  
1020 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.
1021 .RE
1022
1023 .sp
1024 .ne 2
1025 .mk
1026 .na
1027 \fB\fB-s\fR \fIprop\fR\fR
1028 .ad
1029 .RS 11n
1030 .rt  
1031 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
1032 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. 
1033 .sp
1034 The following is a list of sorting criteria:
1035 .RS +4
1036 .TP
1037 .ie t \(bu
1038 .el o
1039 Numeric types sort in numeric order.
1040 .RE
1041 .RS +4
1042 .TP
1043 .ie t \(bu
1044 .el o
1045 String types sort in alphabetical order.
1046 .RE
1047 .RS +4
1048 .TP
1049 .ie t \(bu
1050 .el o
1051 Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
1052 .RE
1053 .RS +4
1054 .TP
1055 .ie t \(bu
1056 .el o
1057 If no sorting options are specified the existing behavior of "\fBzfs list\fR" is preserved.
1058 .RE
1059 .RE
1060
1061 .sp
1062 .ne 2
1063 .mk
1064 .na
1065 \fB\fB-S\fR \fIprop\fR\fR
1066 .ad
1067 .RS 11n
1068 .rt  
1069 Same as the \fB-s\fR option, but sorts by property in descending order. 
1070 .RE
1071
1072 .sp
1073 .ne 2
1074 .mk
1075 .na
1076 \fB\fB-t\fR \fItype\fR\fR
1077 .ad
1078 .RS 11n
1079 .rt  
1080 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.
1081 .RE
1082
1083 .RE
1084
1085 .sp
1086 .ne 2
1087 .mk
1088 .na
1089 \fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
1090 .ad
1091 .sp .6
1092 .RS 4n
1093 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
1094 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.
1095 .RE
1096
1097 .sp
1098 .ne 2
1099 .mk
1100 .na
1101 \fB\fBzfs get\fR [\fB-rHp\fR] [\fB-o\fR \fIfield\fR[,\fIfield\fR]...] [\fB-s\fR \fIsource\fR[,\fIsource\fR]...] \fIall\fR | \fIproperty\fR[,\fIproperty\fR]... \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
1102 .ad
1103 .sp .6
1104 .RS 4n
1105 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:
1106 .sp
1107 .in +2
1108 .nf
1109     name      Dataset name
1110     property  Property name
1111     value     Property value
1112     source    Property source. Can either be local, default,
1113               temporary, inherited, or none (-).
1114 .fi
1115 .in -2
1116 .sp
1117
1118 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.
1119 .sp
1120 The special value "all" can be used to display all properties for the given dataset.
1121 .sp
1122 .ne 2
1123 .mk
1124 .na
1125 \fB\fB-r\fR\fR
1126 .ad
1127 .RS 13n
1128 .rt  
1129 Recursively display properties for any children.
1130 .RE
1131
1132 .sp
1133 .ne 2
1134 .mk
1135 .na
1136 \fB\fB-H\fR\fR
1137 .ad
1138 .RS 13n
1139 .rt  
1140 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.
1141 .RE
1142
1143 .sp
1144 .ne 2
1145 .mk
1146 .na
1147 \fB\fB-o\fR \fIfield\fR\fR
1148 .ad
1149 .RS 13n
1150 .rt  
1151 A comma-separated list of columns to display. "name,property,value,source" is the default value. 
1152 .RE
1153
1154 .sp
1155 .ne 2
1156 .mk
1157 .na
1158 \fB\fB-s\fR \fIsource\fR\fR
1159 .ad
1160 .RS 13n
1161 .rt  
1162 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.
1163 .RE
1164
1165 .sp
1166 .ne 2
1167 .mk
1168 .na
1169 \fB\fB-p\fR\fR
1170 .ad
1171 .RS 13n
1172 .rt  
1173 Display numbers in parsable (exact) values.
1174 .RE
1175
1176 .RE
1177
1178 .sp
1179 .ne 2
1180 .mk
1181 .na
1182 \fB\fBzfs inherit\fR [\fB-r\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR ...\fR
1183 .ad
1184 .sp .6
1185 .RS 4n
1186 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.
1187 .sp
1188 .ne 2
1189 .mk
1190 .na
1191 \fB\fB-r\fR\fR
1192 .ad
1193 .RS 6n
1194 .rt  
1195 Recursively inherit the given property for all children.
1196 .RE
1197
1198 .RE
1199
1200 .sp
1201 .ne 2
1202 .mk
1203 .na
1204 \fB\fBzfs mount\fR\fR
1205 .ad
1206 .sp .6
1207 .RS 4n
1208 Displays all \fBZFS\fR file systems currently mounted.
1209 .RE
1210
1211 .sp
1212 .ne 2
1213 .mk
1214 .na
1215 \fB\fBzfs mount\fR[\fB-o\fR \fIopts\fR] [\fB-O\fR] \fB-a\fR\fR
1216 .ad
1217 .sp .6
1218 .RS 4n
1219 Mounts all available \fBZFS\fR file systems. Invoked automatically as part of the boot process.
1220 .sp
1221 .ne 2
1222 .mk
1223 .na
1224 \fB\fB-o\fR \fIopts\fR\fR
1225 .ad
1226 .RS 11n
1227 .rt  
1228 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.
1229 .RE
1230
1231 .sp
1232 .ne 2
1233 .mk
1234 .na
1235 \fB\fB-O\fR\fR
1236 .ad
1237 .RS 11n
1238 .rt  
1239 Perform an overlay mount. See \fBmount\fR(1M) for more information.
1240 .RE
1241
1242 .RE
1243
1244 .sp
1245 .ne 2
1246 .mk
1247 .na
1248 \fB\fBzfs mount\fR [\fB-o\fR \fIopts\fR] [\fB-O\fR] \fIfilesystem\fR\fR
1249 .ad
1250 .sp .6
1251 .RS 4n
1252 Mounts a specific \fBZFS\fR file system. This is typically not necessary, as file systems are automatically mounted when they are created or the mountpoint property has changed. See the "Mount Points" section for details.
1253 .sp
1254 .ne 2
1255 .mk
1256 .na
1257 \fB\fB-o\fR \fIopts\fR\fR
1258 .ad
1259 .RS 11n
1260 .rt  
1261 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.
1262 .RE
1263
1264 .sp
1265 .ne 2
1266 .mk
1267 .na
1268 \fB\fB-O\fR\fR
1269 .ad
1270 .RS 11n
1271 .rt  
1272 Perform an overlay mount. See \fBmount\fR(1M) for more information.
1273 .RE
1274
1275 .RE
1276
1277 .sp
1278 .ne 2
1279 .mk
1280 .na
1281 \fB\fBzfs unmount\fR \fB-a\fR\fR
1282 .ad
1283 .sp .6
1284 .RS 4n
1285 Unmounts all currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
1286 .RE
1287
1288 .sp
1289 .ne 2
1290 .mk
1291 .na
1292 \fB\fBzfs unmount\fR [\fB-f\fR] \fIfilesystem\fR|\fImountpoint\fR\fR
1293 .ad
1294 .sp .6
1295 .RS 4n
1296 Unmounts the given file system. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
1297 .sp
1298 .ne 2
1299 .mk
1300 .na
1301 \fB\fB-f\fR\fR
1302 .ad
1303 .RS 6n
1304 .rt  
1305 Forcefully unmount the file system, even if it is currently in use.
1306 .RE
1307
1308 .RE
1309
1310 .sp
1311 .ne 2
1312 .mk
1313 .na
1314 \fB\fBzfs share\fR \fB-a\fR\fR
1315 .ad
1316 .sp .6
1317 .RS 4n
1318 Shares all available \fBZFS\fR file systems. This is invoked automatically as part of the boot process.
1319 .RE
1320
1321 .sp
1322 .ne 2
1323 .mk
1324 .na
1325 \fB\fBzfs share\fR \fIfilesystem\fR\fR
1326 .ad
1327 .sp .6
1328 .RS 4n
1329 Shares a specific \fBZFS\fR file system according to the "sharenfs" property. File systems are shared when the "sharenfs" property is set.
1330 .RE
1331
1332 .sp
1333 .ne 2
1334 .mk
1335 .na
1336 \fB\fBzfs unshare\fR \fB-a\fR\fR
1337 .ad
1338 .sp .6
1339 .RS 4n
1340 Unshares all currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
1341 .RE
1342
1343 .sp
1344 .ne 2
1345 .mk
1346 .na
1347 \fB\fBzfs unshare\fR [\fB-F\fR] \fIfilesystem\fR|\fImountpoint\fR\fR
1348 .ad
1349 .sp .6
1350 .RS 4n
1351 Unshares the given file system. The command can also be given a path to a \fBZFS\fR file system shared on the system.
1352 .sp
1353 .ne 2
1354 .mk
1355 .na
1356 \fB\fB-F\fR\fR
1357 .ad
1358 .RS 6n
1359 .rt  
1360 Forcefully unshare the file system, even if it is currently in use.
1361 .RE
1362
1363 .RE
1364
1365 .sp
1366 .ne 2
1367 .mk
1368 .na
1369 \fB\fBzfs send\fR [\fB-i\fR \fIsnapshot1\fR] \fIsnapshot2\fR\fR
1370 .ad
1371 .sp .6
1372 .RS 4n
1373 Creates a stream representation of snapshot2, 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.
1374 .sp
1375 .ne 2
1376 .mk
1377 .na
1378 \fB\fB-i\fR \fIsnapshot1\fR\fR
1379 .ad
1380 .RS 16n
1381 .rt  
1382 Generate an incremental stream from \fIsnapshot1\fR to \fIsnapshot2\fR. The incremental source \fIsnapshot1\fR can be specified as the last component of the snapshot name (for example, the part after the "@"),
1383 and it is assumed to be from the same file system as \fIsnapshot2\fR.
1384 .RE
1385
1386 .RE
1387
1388 .LP
1389 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.
1390 .sp
1391 .ne 2
1392 .mk
1393 .na
1394 \fB\fBzfs receive\fR [\fB-vnF\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
1395 .ad
1396 .br
1397 .na
1398 \fB\fBzfs receive\fR [\fB-vnF\fR] \fB-d\fR \fIfilesystem\fR\fR
1399 .ad
1400 .sp .6
1401 .RS 4n
1402 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
1403 stream. "\fBzfs recv\fR" can be used as an alias for "\fBzfs receive\fR".
1404 .sp
1405 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. The destination file system and all of its child file systems are unmounted and cannot be accessed during the receive operation.
1406 .sp
1407 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.
1408 .sp
1409 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.
1410 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.
1411 .sp
1412 .ne 2
1413 .mk
1414 .na
1415 \fB\fB-d\fR\fR
1416 .ad
1417 .RS 6n
1418 .rt  
1419 Use the name of the sent snapshot to determine the name of the new snapshot as described in the paragraph above.
1420 .RE
1421
1422 .sp
1423 .ne 2
1424 .mk
1425 .na
1426 \fB\fB-v\fR\fR
1427 .ad
1428 .RS 6n
1429 .rt  
1430 Print verbose information about the stream and the time required to perform the receive operation.
1431 .RE
1432
1433 .sp
1434 .ne 2
1435 .mk
1436 .na
1437 \fB\fB-n\fR\fR
1438 .ad
1439 .RS 6n
1440 .rt  
1441 Do not actually receive the stream. This can be useful in conjunction with the \fB-v\fR option to determine what name the receive operation would use.
1442 .RE
1443
1444 .sp
1445 .ne 2
1446 .mk
1447 .na
1448 \fB\fB-F\fR\fR
1449 .ad
1450 .RS 6n
1451 .rt  
1452 Force a rollback of the \fIfilesystem\fR to the most recent snapshot before performing the receive operation.
1453 .RE
1454
1455 .RE
1456
1457 .sp
1458 .ne 2
1459 .mk
1460 .na
1461 \fB\fBzfs jail\fR \fIjailid\fR \fIfilesystem\fR\fR
1462 .ad
1463 .sp .6
1464 .RS 4n
1465 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.
1466 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.
1467 .RE
1468
1469 .sp
1470 .ne 2
1471 .mk
1472 .na
1473 \fB\fBzfs unjail\fR \fIjailid\fR \fIfilesystem\fR\fR
1474 .ad
1475 .sp .6
1476 .RS 4n
1477 Detaches the given file system from the given jail.
1478 .RE
1479
1480 .SH EXAMPLES
1481 .LP
1482 \fBExample 1 \fRCreating a ZFS File System Hierarchy
1483 .LP
1484 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
1485 by the child file system.
1486
1487 .sp
1488 .in +2
1489 .nf
1490 # zfs create pool/home
1491 # zfs set mountpoint=/export/home pool/home
1492 # zfs create pool/home/bob
1493 .fi
1494 .in -2
1495 .sp
1496
1497 .LP
1498 \fBExample 2 \fRCreating a ZFS Snapshot
1499 .LP
1500 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.
1501
1502 .sp
1503 .in +2
1504 .nf
1505 # zfs snapshot pool/home/bob@yesterday
1506 .fi
1507 .in -2
1508 .sp
1509
1510 .LP
1511 \fBExample 3 \fRTaking and destroying multiple snapshots
1512 .LP
1513 The following command creates snapshots named "\fByesterday\fR" of "\fBpool/home\fR" and all of its descendant file systems. Each snapshot is mounted on demand in the ".zfs/snapshot" directory at the root of its file system. The
1514 second command destroys the newly created snapshots.
1515
1516 .sp
1517 .in +2
1518 .nf
1519 # \fBzfs snapshot -r pool/home@yesterday\fR
1520 \fB# zfs destroy -r pool/home@yesterday\fR
1521 .fi
1522 .in -2
1523 .sp
1524
1525 .LP
1526 \fBExample 4 \fRTurning Off Compression
1527 .LP
1528 The following commands turn compression off for all file systems under "\fBpool/home\fR", but explicitly turns it on for "\fBpool/home/anne\fR".
1529
1530 .sp
1531 .in +2
1532 .nf
1533 \fB# zfs set compression=off pool/home
1534 # zfs set compression=on pool/home/anne\fR
1535 .fi
1536 .in -2
1537 .sp
1538
1539 .LP
1540 \fBExample 5 \fRListing ZFS Datasets
1541 .LP
1542 The following command lists all active file systems and volumes in the system.
1543
1544 .sp
1545 .in +2
1546 .nf
1547 \fB# zfs list\fR
1548
1549
1550   NAME                      USED  AVAIL  REFER  MOUNTPOINT
1551   pool                      100G   60G       -  /pool
1552   pool/home                 100G   60G       -  /export/home
1553   pool/home/bob              40G   60G     40G  /export/home/bob
1554   pool/home/bob@yesterday     3M     -     40G  -
1555   pool/home/anne             60G   60G     40G  /export/home/anne
1556 .fi
1557 .in -2
1558 .sp
1559
1560 .LP
1561 \fBExample 6 \fRSetting a Quota on a ZFS File System
1562 .LP
1563 The following command sets a quota of 50 gbytes for "\fBpool/home/bob\fR".
1564
1565 .sp
1566 .in +2
1567 .nf
1568 \fB# zfs set quota=50G pool/home/bob\fR
1569 .fi
1570 .in -2
1571 .sp
1572
1573 .LP
1574 \fBExample 7 \fRListing ZFS Properties
1575 .LP
1576 The following command lists all properties for "\fBpool/home/bob\fR".
1577
1578 .sp
1579 .in +2
1580 .nf
1581 \fB# zfs get all pool/home/bob\fR
1582
1583
1584   NAME           PROPERTY       VALUE                  SOURCE
1585   pool/home/bob  type           filesystem             -
1586   pool/home/bob  creation       Fri Feb 23 14:20 2007  -
1587   pool/home/bob  used           24.5K                  -
1588   pool/home/bob  available      50.0G                  -
1589   pool/home/bob  referenced     24.5K                  -
1590   pool/home/bob  compressratio  1.00x                  -
1591   pool/home/bob  mounted        yes                    -
1592   pool/home/bob  quota          50G                    local
1593   pool/home/bob  reservation    none                   default
1594   pool/home/bob  recordsize     128K                   default
1595   pool/home/bob  mountpoint     /pool/home/bob         default
1596   pool/home/bob  sharenfs       off                    default
1597   pool/home/bob  shareiscsi     off                    default
1598   pool/home/bob  checksum       on                     default
1599   pool/home/bob  compression    off                    default
1600   pool/home/bob  atime          on                     default
1601   pool/home/bob  devices        on                     default
1602   pool/home/bob  exec           on                     default
1603   pool/home/bob  setuid         on                     default
1604   pool/home/bob  readonly       off                    default
1605   pool/home/bob  zoned          off                    default
1606   pool/home/bob  snapdir        hidden                 default
1607   pool/home/bob  aclmode        groupmask              default
1608   pool/home/bob  aclinherit     secure                 default
1609   pool/home/bob  canmount       on                     default
1610   pool/home/bob  xattr          on                     default
1611
1612    
1613 .fi
1614 .in -2
1615 .sp
1616
1617 .LP
1618 The following command gets a single property value.
1619
1620 .sp
1621 .in +2
1622 .nf
1623 \fB# zfs get -H -o value compression pool/home/bob\fR
1624 on
1625 .fi
1626 .in -2
1627 .sp
1628
1629 .LP
1630 The following command lists all properties with local settings for "\fBpool/home/bob\fR".
1631
1632 .sp
1633 .in +2
1634 .nf
1635 \fB# zfs get -r -s local -o name,property,value all pool/home/bob\fR
1636
1637   NAME             PROPERTY      VALUE
1638   pool             compression   on
1639   pool/home        checksum      off
1640 .fi
1641 .in -2
1642 .sp
1643
1644 .LP
1645 \fBExample 8 \fRRolling Back a ZFS File System
1646 .LP
1647 The following command reverts the contents of "\fBpool/home/anne\fR" to the snapshot named "\fByesterday\fR", deleting all intermediate snapshots.
1648
1649 .sp
1650 .in +2
1651 .nf
1652 \fB# zfs rollback -r pool/home/anne@yesterday\fR
1653 .fi
1654 .in -2
1655 .sp
1656
1657 .LP
1658 \fBExample 9 \fRCreating a ZFS Clone
1659 .LP
1660 The following command creates a writable file system whose initial contents are the same as "\fBpool/home/bob@yesterday\fR".
1661
1662 .sp
1663 .in +2
1664 .nf
1665 \fB# zfs clone pool/home/bob@yesterday pool/clone\fR
1666 .fi
1667 .in -2
1668 .sp
1669
1670 .LP
1671 \fBExample 10 \fRPromoting a ZFS Clone
1672 .LP
1673 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:
1674
1675 .sp
1676 .in +2
1677 .nf
1678 \fB# zfs create pool/project/production\fR
1679  populate /pool/project/production with data
1680 \fB# zfs snapshot pool/project/production@today
1681 # zfs clone pool/project/production@today pool/project/beta\fR
1682  make changes to /pool/project/beta and test them
1683 \fB# zfs promote pool/project/beta
1684 # zfs rename pool/project/production pool/project/legacy
1685 # zfs rename pool/project/beta pool/project/production\fR
1686  once the legacy version is no longer needed, it can be
1687  destroyed
1688 \fB# zfs destroy pool/project/legacy\fR
1689 .fi
1690 .in -2
1691 .sp
1692
1693 .LP
1694 \fBExample 11 \fRInheriting ZFS Properties
1695 .LP
1696 The following command causes "\fBpool/home/bob\fR" and "\fBpool/home/anne\fR" to inherit the "checksum" property from their parent.
1697
1698 .sp
1699 .in +2
1700 .nf
1701 \fB# zfs inherit checksum pool/home/bob pool/home/anne\fR
1702 .fi
1703 .in -2
1704 .sp
1705
1706 .LP
1707 \fBExample 12 \fRRemotely Replicating ZFS Data
1708 .LP
1709 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
1710 the file system "\fBpoolB/received\fR", and must not initially contain "\fBpoolB/received/fs\fR".
1711
1712 .sp
1713 .in +2
1714 .nf
1715 # zfs send pool/fs@a | \e
1716   ssh host zfs receive poolB/received/fs@a
1717 # zfs send -i a pool/fs@b | ssh host \e
1718   zfs receive poolB/received/fs
1719 .fi
1720 .in -2
1721 .sp
1722
1723 .LP
1724 \fBExample 13 \fRUsing the  zfs receive -d Option
1725 .LP
1726 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
1727 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 will be created as an empty file system.
1728
1729 .sp
1730 .in +2
1731 .nf
1732 \fB# zfs send poolA/fsA/fsB@snap | \e
1733   ssh host zfs receive -d poolB/received
1734    \fR
1735 .fi
1736 .in -2
1737 .sp
1738
1739 .LP
1740 \fBExample 14 \fRCreating a ZFS volume as a Swap Device
1741 .LP
1742 The following example shows how to create a 5-Gbyte ZFS volume and then add the volume as a swap device.
1743
1744 .sp
1745 .in +2
1746 .nf
1747 \fB# zfs create  -V 5gb tank/vol
1748 # swap -a /dev/zvol/dsk/tank/vol\fR
1749 .fi
1750 .in -2
1751 .sp
1752
1753 .LP
1754 \fBExample 15 \fRSetting User Properties
1755 .LP
1756 The following example sets the user defined "com.example:department" property for a dataset.
1757
1758 .sp
1759 .in +2
1760 .nf
1761 \fB# zfs set com.example:department=12345 tank/accounting\fR
1762 .fi
1763 .in -2
1764 .sp
1765
1766 .LP
1767 \fBExample 16 \fRCreating a ZFS Volume as a iSCSI Target Device
1768 .LP
1769 The following example shows how to create a \fBZFS\fR volume as an \fBiSCSI\fR target. 
1770
1771 .sp
1772 .in +2
1773 .nf
1774 \fB# zfs create -V 2g pool/volumes/vol1
1775 # zfs set shareiscsi=on pool/volumes/vol1
1776 # iscsitadm list target\fR
1777 Target: pool/volumes/vol1
1778 iSCSI Name: 
1779 iqn.1986-03.com.sun:02:7b4b02a6-3277-eb1b-e686-a24762c52a8c
1780 Connections: 0
1781 .fi
1782 .in -2
1783 .sp
1784
1785 .LP
1786 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.
1787 .SH EXIT STATUS
1788 .LP
1789 The following exit values are returned:
1790 .sp
1791 .ne 2
1792 .mk
1793 .na
1794 \fB\fB0\fR\fR
1795 .ad
1796 .RS 5n
1797 .rt  
1798 Successful completion. 
1799 .RE
1800
1801 .sp
1802 .ne 2
1803 .mk
1804 .na
1805 \fB\fB1\fR\fR
1806 .ad
1807 .RS 5n
1808 .rt  
1809 An error occurred.
1810 .RE
1811
1812 .sp
1813 .ne 2
1814 .mk
1815 .na
1816 \fB\fB2\fR\fR
1817 .ad
1818 .RS 5n
1819 .rt  
1820 Invalid command line options were specified.
1821 .RE
1822
1823 .SH ATTRIBUTES
1824 .LP
1825 See \fBattributes\fR(5) for descriptions of the following attributes:
1826 .sp
1827
1828 .sp
1829 .TS
1830 tab(\a) box;
1831 cw(2.75i) |cw(2.75i) 
1832 lw(2.75i) |lw(2.75i) 
1833 .
1834 ATTRIBUTE TYPE\aATTRIBUTE VALUE
1835 _
1836 Availability\aSUNWzfsu
1837 _
1838 Interface Stability\aEvolving
1839 .TE
1840
1841 .SH SEE ALSO
1842 .LP
1843 \fBgzip\fR(1), \fBssh\fR(1), \fBmount\fR(1M), \fBshare\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)