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