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