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