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