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