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