]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - man/man8/zfs.8
Destroy makes full snap list before destroying
[FreeBSD/FreeBSD.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 n
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 dnodesize Ns = Ns Sy legacy Ns | Ns Sy auto Ns | Ns Sy 1k Ns | Ns
1334 .Sy 2k Ns | Ns Sy 4k Ns | Ns Sy 8k Ns | Ns Sy 16k
1335 .Xc
1336 Specifies a compatibility mode or literal value for the size of dnodes in the
1337 file system. The default value is
1338 .Sy legacy .
1339 Setting this property to a value other than
1340 .Sy legacy
1341 requires the large_dnode pool feature to be enabled.
1342 .Pp
1343 Consider setting
1344 .Sy dnodesize
1345 to
1346 .Sy auto
1347 if the dataset uses the
1348 .Sy xattr=sa
1349 property setting and the workload makes heavy use of extended attributes. This
1350 may be applicable to SELinux-enabled systems, Lustre servers, and Samba
1351 servers, for example. Literal values are supported for cases where the optimal
1352 size is known in advance and for performance testing.
1353 .Pp
1354 Leave
1355 .Sy dnodesize
1356 set to
1357 .Sy legacy
1358 if you need to receive a send stream of this dataset on a pool that doesn't
1359 enable the large_dnode feature, or if you need to import this pool on a system
1360 that doesn't support the large_dnode feature.
1361 .Pp
1362 This property can also be referred to by its shortened column name,
1363 .Sy dnsize .
1364 .It Xo
1365 .Sy encryption Ns = Ns Sy off Ns | Ns Sy on Ns | Ns Sy aes-128-ccm Ns | Ns
1366 .Sy aes-192-ccm Ns | Ns Sy aes-256-ccm Ns | Ns Sy aes-128-gcm Ns | Ns
1367 .Sy aes-192-gcm Ns | Ns Sy aes-256-gcm
1368 .Xc
1369 Controls the encryption cipher suite (block cipher, key length, and mode) used
1370 for this dataset. Requires the
1371 .Sy encryption
1372 feature to be enabled on the pool.
1373 Requires a
1374 .Sy keyformat
1375 to be set at dataset creation time.
1376 .Pp
1377 Selecting
1378 .Sy encryption Ns = Ns Sy on
1379 when creating a dataset indicates that the default encryption suite will be
1380 selected, which is currently
1381 .Sy aes-256-ccm .
1382 In order to provide consistent data protection, encryption must be specified at
1383 dataset creation time and it cannot be changed afterwards.
1384 .Pp
1385 For more details and caveats about encryption see the
1386 .Sy Encryption
1387 section.
1388 .It Sy keyformat Ns = Ns Sy raw Ns | Ns Sy hex Ns | Ns Sy passphrase
1389 Controls what format the user's encryption key will be provided as. This
1390 property is only set when the dataset is encrypted.
1391 .Pp
1392 Raw keys and hex keys must be 32 bytes long (regardless of the chosen
1393 encryption suite) and must be randomly generated. A raw key can be generated
1394 with the following command:
1395 .Bd -literal
1396 # dd if=/dev/urandom of=/path/to/output/key bs=32 count=1
1397 .Ed
1398 .Pp
1399 Passphrases must be between 8 and 512 bytes long and will be processed through
1400 PBKDF2 before being used (see the
1401 .Sy pbkdf2iters
1402 property). Even though the
1403 encryption suite cannot be changed after dataset creation, the keyformat can be
1404 with
1405 .Nm zfs Cm change-key .
1406 .It Xo
1407 .Sy keylocation Ns = Ns Sy prompt Ns | Ns Sy file:// Ns Em </absolute/file/path>
1408 .Xc
1409 Controls where the user's encryption key will be loaded from by default for
1410 commands such as
1411 .Nm zfs Cm load-key
1412 and
1413 .Nm zfs Cm mount Cm -l . This property is
1414 only set for encrypted datasets which are encryption roots. If unspecified, the
1415 default is
1416 .Sy prompt.
1417 .Pp
1418 Even though the encryption suite cannot be changed after dataset creation, the
1419 keylocation can be with either
1420 .Nm zfs Cm set
1421 or
1422 .Nm zfs Cm change-key .
1423 If
1424 .Sy prompt
1425 is selected ZFS will ask for the key at the command prompt when it is required
1426 to access the encrypted data (see
1427 .Nm zfs Cm load-key
1428 for details). This setting will also allow the key to be passed in via STDIN,
1429 but users should be careful not to place keys which should be kept secret on
1430 the command line. If a file URI is selected, the key will be loaded from the
1431 specified absolute file path.
1432 .It Sy pbkdf2iters Ns = Ns Ar iterations
1433 Controls the number of PBKDF2 iterations that a
1434 .Sy passphrase
1435 encryption key should be run through when processing it into an encryption key.
1436 This property is only defined when encryption is enabled and a keyformat of
1437 .Sy passphrase
1438 is selected. The goal of PBKDF2 is to significantly increase the
1439 computational difficulty needed to brute force a user's passphrase. This is
1440 accomplished by forcing the attacker to run each passphrase through a
1441 computationally expensive hashing function many times before they arrive at the
1442 resulting key. A user who actually knows the passphrase will only have to pay
1443 this cost once. As CPUs become better at processing, this number should be
1444 raised to ensure that a brute force attack is still not possible. The current
1445 default is
1446 .Sy 350000
1447 and the minimum is
1448 .Sy 100000 .
1449 This property may be changed with
1450 .Nm zfs Cm change-key .
1451 .It Sy exec Ns = Ns Sy on Ns | Ns Sy off
1452 Controls whether processes can be executed from within this file system.
1453 The default value is
1454 .Sy on .
1455 The values
1456 .Sy on
1457 and
1458 .Sy off
1459 are equivalent to the
1460 .Sy exec
1461 and
1462 .Sy noexec
1463 mount options.
1464 .It Sy filesystem_limit Ns = Ns Em count Ns | Ns Sy none
1465 Limits the number of filesystems and volumes that can exist under this point in
1466 the dataset tree.
1467 The limit is not enforced if the user is allowed to change the limit.
1468 Setting a
1469 .Sy filesystem_limit
1470 to
1471 .Sy on
1472 a descendent of a filesystem that already has a
1473 .Sy filesystem_limit
1474 does not override the ancestor's
1475 .Sy filesystem_limit ,
1476 but rather imposes an additional limit.
1477 This feature must be enabled to be used
1478 .Po see
1479 .Xr zpool-features 5
1480 .Pc .
1481 .It Sy mountpoint Ns = Ns Pa path Ns | Ns Sy none Ns | Ns Sy legacy
1482 Controls the mount point used for this file system.
1483 See the
1484 .Sx Mount Points
1485 section for more information on how this property is used.
1486 .Pp
1487 When the
1488 .Sy mountpoint
1489 property is changed for a file system, the file system and any children that
1490 inherit the mount point are unmounted.
1491 If the new value is
1492 .Sy legacy ,
1493 then they remain unmounted.
1494 Otherwise, they are automatically remounted in the new location if the property
1495 was previously
1496 .Sy legacy
1497 or
1498 .Sy none ,
1499 or if they were mounted before the property was changed.
1500 In addition, any shared file systems are unshared and shared in the new
1501 location.
1502 .It Sy nbmand Ns = Ns Sy on Ns | Ns Sy off
1503 Controls whether the file system should be mounted with
1504 .Sy nbmand
1505 .Pq Non Blocking mandatory locks .
1506 This is used for SMB clients.
1507 Changes to this property only take effect when the file system is umounted and
1508 remounted.
1509 See
1510 .Xr mount 8
1511 for more information on
1512 .Sy nbmand
1513 mounts. This property is not used on Linux.
1514 .It Sy overlay Ns = Ns Sy off Ns | Ns Sy on
1515 Allow mounting on a busy directory or a directory which already contains
1516 files or directories. This is the default mount behavior for Linux file systems.
1517 For consistency with OpenZFS on other platforms overlay mounts are
1518 .Sy off
1519 by default. Set to
1520 .Sy on
1521 to enable overlay mounts.
1522 .It Sy primarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1523 Controls what is cached in the primary cache
1524 .Pq ARC .
1525 If this property is set to
1526 .Sy all ,
1527 then both user data and metadata is cached.
1528 If this property is set to
1529 .Sy none ,
1530 then neither user data nor metadata is cached.
1531 If this property is set to
1532 .Sy metadata ,
1533 then only metadata is cached.
1534 The default value is
1535 .Sy all .
1536 .It Sy quota Ns = Ns Em size Ns | Ns Sy none
1537 Limits the amount of space a dataset and its descendents can consume.
1538 This property enforces a hard limit on the amount of space used.
1539 This includes all space consumed by descendents, including file systems and
1540 snapshots.
1541 Setting a quota on a descendent of a dataset that already has a quota does not
1542 override the ancestor's quota, but rather imposes an additional limit.
1543 .Pp
1544 Quotas cannot be set on volumes, as the
1545 .Sy volsize
1546 property acts as an implicit quota.
1547 .It Sy snapshot_limit Ns = Ns Em count Ns | Ns Sy none
1548 Limits the number of snapshots that can be created on a dataset and its
1549 descendents.
1550 Setting a
1551 .Sy snapshot_limit
1552 on a descendent of a dataset that already has a
1553 .Sy snapshot_limit
1554 does not override the ancestor's
1555 .Sy snapshot_limit ,
1556 but rather imposes an additional limit.
1557 The limit is not enforced if the user is allowed to change the limit.
1558 For example, this means that recursive snapshots taken from the global zone are
1559 counted against each delegated dataset within a zone.
1560 This feature must be enabled to be used
1561 .Po see
1562 .Xr zpool-features 5
1563 .Pc .
1564 .It Sy userquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1565 Limits the amount of space consumed by the specified user.
1566 User space consumption is identified by the
1567 .Sy userspace@ Ns Em user
1568 property.
1569 .Pp
1570 Enforcement of user quotas may be delayed by several seconds.
1571 This delay means that a user might exceed their quota before the system notices
1572 that they are over quota and begins to refuse additional writes with the
1573 .Er EDQUOT
1574 error message.
1575 See the
1576 .Nm zfs Cm userspace
1577 subcommand for more information.
1578 .Pp
1579 Unprivileged users can only access their own groups' space usage.
1580 The root user, or a user who has been granted the
1581 .Sy userquota
1582 privilege with
1583 .Nm zfs Cm allow ,
1584 can get and set everyone's quota.
1585 .Pp
1586 This property is not available on volumes, on file systems before version 4, or
1587 on pools before version 15.
1588 The
1589 .Sy userquota@ Ns Em ...
1590 properties are not displayed by
1591 .Nm zfs Cm get Sy all .
1592 The user's name must be appended after the
1593 .Sy @
1594 symbol, using one of the following forms:
1595 .Bl -bullet
1596 .It
1597 .Em POSIX name
1598 .Po for example,
1599 .Sy joe
1600 .Pc
1601 .It
1602 .Em POSIX numeric ID
1603 .Po for example,
1604 .Sy 789
1605 .Pc
1606 .It
1607 .Em SID name
1608 .Po for example,
1609 .Sy joe.smith@mydomain
1610 .Pc
1611 .It
1612 .Em SID numeric ID
1613 .Po for example,
1614 .Sy S-1-123-456-789
1615 .Pc
1616 .El
1617 .Pp
1618 Files created on Linux always have POSIX owners.
1619 .It Sy userobjquota@ Ns Em user Ns = Ns Em size Ns | Ns Sy none
1620 The
1621 .Sy userobjquota
1622 is similar to
1623 .Sy userquota
1624 but it limits the number of objects a user can create. Please refer to
1625 .Sy userobjused
1626 for more information about how objects are counted.
1627 .It Sy groupquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1628 Limits the amount of space consumed by the specified group.
1629 Group space consumption is identified by the
1630 .Sy groupused@ Ns Em group
1631 property.
1632 .Pp
1633 Unprivileged users can access only their own groups' space usage.
1634 The root user, or a user who has been granted the
1635 .Sy groupquota
1636 privilege with
1637 .Nm zfs Cm allow ,
1638 can get and set all groups' quotas.
1639 .It Sy groupobjquota@ Ns Em group Ns = Ns Em size Ns | Ns Sy none
1640 The
1641 .Sy groupobjquota
1642 is similar to
1643 .Sy groupquota
1644 but it limits number of objects a group can consume. Please refer to
1645 .Sy userobjused
1646 for more information about how objects are counted.
1647 .It Sy projectquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1648 Limits the amount of space consumed by the specified project. Project
1649 space consumption is identified by the
1650 .Sy projectused@ Ns Em project
1651 property. Please refer to
1652 .Sy projectused
1653 for more information about how project is identified and set/changed.
1654 .Pp
1655 The root user, or a user who has been granted the
1656 .Sy projectquota
1657 privilege with
1658 .Nm zfs allow ,
1659 can access all projects' quota.
1660 .It Sy projectobjquota@ Ns Em project Ns = Ns Em size Ns | Ns Sy none
1661 The
1662 .Sy projectobjquota
1663 is similar to
1664 .Sy projectquota
1665 but it limits number of objects a project can consume. Please refer to
1666 .Sy userobjused
1667 for more information about how objects are counted.
1668 .It Sy readonly Ns = Ns Sy on Ns | Ns Sy off
1669 Controls whether this dataset can be modified.
1670 The default value is
1671 .Sy off .
1672 The values
1673 .Sy on
1674 and
1675 .Sy off
1676 are equivalent to the
1677 .Sy ro
1678 and
1679 .Sy rw
1680 mount options.
1681 .Pp
1682 This property can also be referred to by its shortened column name,
1683 .Sy rdonly .
1684 .It Sy recordsize Ns = Ns Em size
1685 Specifies a suggested block size for files in the file system.
1686 This property is designed solely for use with database workloads that access
1687 files in fixed-size records.
1688 ZFS automatically tunes block sizes according to internal algorithms optimized
1689 for typical access patterns.
1690 .Pp
1691 For databases that create very large files but access them in small random
1692 chunks, these algorithms may be suboptimal.
1693 Specifying a
1694 .Sy recordsize
1695 greater than or equal to the record size of the database can result in
1696 significant performance gains.
1697 Use of this property for general purpose file systems is strongly discouraged,
1698 and may adversely affect performance.
1699 .Pp
1700 The size specified must be a power of two greater than or equal to 512 and less
1701 than or equal to 128 Kbytes.
1702 If the
1703 .Sy large_blocks
1704 feature is enabled on the pool, the size may be up to 1 Mbyte.
1705 See
1706 .Xr zpool-features 5
1707 for details on ZFS feature flags.
1708 .Pp
1709 Changing the file system's
1710 .Sy recordsize
1711 affects only files created afterward; existing files are unaffected.
1712 .Pp
1713 This property can also be referred to by its shortened column name,
1714 .Sy recsize .
1715 .It Sy redundant_metadata Ns = Ns Sy all Ns | Ns Sy most
1716 Controls what types of metadata are stored redundantly.
1717 ZFS stores an extra copy of metadata, so that if a single block is corrupted,
1718 the amount of user data lost is limited.
1719 This extra copy is in addition to any redundancy provided at the pool level
1720 .Pq e.g. by mirroring or RAID-Z ,
1721 and is in addition to an extra copy specified by the
1722 .Sy copies
1723 property
1724 .Pq up to a total of 3 copies .
1725 For example if the pool is mirrored,
1726 .Sy copies Ns = Ns 2 ,
1727 and
1728 .Sy redundant_metadata Ns = Ns Sy most ,
1729 then ZFS stores 6 copies of most metadata, and 4 copies of data and some
1730 metadata.
1731 .Pp
1732 When set to
1733 .Sy all ,
1734 ZFS stores an extra copy of all metadata.
1735 If a single on-disk block is corrupt, at worst a single block of user data
1736 .Po which is
1737 .Sy recordsize
1738 bytes long
1739 .Pc
1740 can be lost.
1741 .Pp
1742 When set to
1743 .Sy most ,
1744 ZFS stores an extra copy of most types of metadata.
1745 This can improve performance of random writes, because less metadata must be
1746 written.
1747 In practice, at worst about 100 blocks
1748 .Po of
1749 .Sy recordsize
1750 bytes each
1751 .Pc
1752 of user data can be lost if a single on-disk block is corrupt.
1753 The exact behavior of which metadata blocks are stored redundantly may change in
1754 future releases.
1755 .Pp
1756 The default value is
1757 .Sy all .
1758 .It Sy refquota Ns = Ns Em size Ns | Ns Sy none
1759 Limits the amount of space a dataset can consume.
1760 This property enforces a hard limit on the amount of space used.
1761 This hard limit does not include space used by descendents, including file
1762 systems and snapshots.
1763 .It Sy refreservation Ns = Ns Em size Ns | Ns Sy none
1764 The minimum amount of space guaranteed to a dataset, not including its
1765 descendents.
1766 When the amount of space used is below this value, the dataset is treated as if
1767 it were taking up the amount of space specified by
1768 .Sy refreservation .
1769 The
1770 .Sy refreservation
1771 reservation is accounted for in the parent datasets' space used, and counts
1772 against the parent datasets' quotas and reservations.
1773 .Pp
1774 If
1775 .Sy refreservation
1776 is set, a snapshot is only allowed if there is enough free pool space outside of
1777 this reservation to accommodate the current number of
1778 .Qq referenced
1779 bytes in the dataset.
1780 .Pp
1781 This property can also be referred to by its shortened column name,
1782 .Sy refreserv .
1783 .It Sy relatime Ns = Ns Sy on Ns | Ns Sy off
1784 Controls the manner in which the access time is updated when
1785 .Sy atime=on
1786 is set. Turning this property on causes the access time to be updated relative
1787 to the modify or change time. Access time is only updated if the previous
1788 access time was earlier than the current modify or change time or if the
1789 existing access time hasn't been updated within the past 24 hours. The default
1790 value is
1791 .Sy off .
1792 The values
1793 .Sy on
1794 and
1795 .Sy off
1796 are equivalent to the
1797 .Sy relatime
1798 and
1799 .Sy norelatime
1800 mount options.
1801 .It Sy reservation Ns = Ns Em size Ns | Ns Sy none
1802 The minimum amount of space guaranteed to a dataset and its descendants.
1803 When the amount of space used is below this value, the dataset is treated as if
1804 it were taking up the amount of space specified by its reservation.
1805 Reservations are accounted for in the parent datasets' space used, and count
1806 against the parent datasets' quotas and reservations.
1807 .Pp
1808 This property can also be referred to by its shortened column name,
1809 .Sy reserv .
1810 .It Sy secondarycache Ns = Ns Sy all Ns | Ns Sy none Ns | Ns Sy metadata
1811 Controls what is cached in the secondary cache
1812 .Pq L2ARC .
1813 If this property is set to
1814 .Sy all ,
1815 then both user data and metadata is cached.
1816 If this property is set to
1817 .Sy none ,
1818 then neither user data nor metadata is cached.
1819 If this property is set to
1820 .Sy metadata ,
1821 then only metadata is cached.
1822 The default value is
1823 .Sy all .
1824 .It Sy setuid Ns = Ns Sy on Ns | Ns Sy off
1825 Controls whether the setuid bit is respected for the file system.
1826 The default value is
1827 .Sy on .
1828 The values
1829 .Sy on
1830 and
1831 .Sy off
1832 are equivalent to the
1833 .Sy suid
1834 and
1835 .Sy nosuid
1836 mount options.
1837 .It Sy sharesmb Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1838 Controls whether the file system is shared by using
1839 .Sy Samba USERSHARES
1840 and what options are to be used. Otherwise, the file system is automatically
1841 shared and unshared with the
1842 .Nm zfs Cm share
1843 and
1844 .Nm zfs Cm unshare
1845 commands. If the property is set to on, the
1846 .Xr net 8
1847 command is invoked to create a
1848 .Sy USERSHARE .
1849 .Pp
1850 Because SMB shares requires a resource name, a unique resource name is
1851 constructed from the dataset name. The constructed name is a copy of the
1852 dataset name except that the characters in the dataset name, which would be
1853 invalid in the resource name, are replaced with underscore (_) characters.
1854 Linux does not currently support additional options which might be available
1855 on Solaris.
1856 .Pp
1857 If the
1858 .Sy sharesmb
1859 property is set to
1860 .Sy off ,
1861 the file systems are unshared.
1862 .Pp
1863 The share is created with the ACL (Access Control List) "Everyone:F" ("F"
1864 stands for "full permissions", ie. read and write permissions) and no guest
1865 access (which means Samba must be able to authenticate a real user, system
1866 passwd/shadow, LDAP or smbpasswd based) by default. This means that any
1867 additional access control (disallow specific user specific access etc) must
1868 be done on the underlying file system.
1869 .It Sy sharenfs Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Em opts
1870 Controls whether the file system is shared via NFS, and what options are to be
1871 used.
1872 A file system with a
1873 .Sy sharenfs
1874 property of
1875 .Sy off
1876 is managed with the
1877 .Xr exportfs 8
1878 command and entries in the
1879 .Em /etc/exports
1880 file.
1881 Otherwise, the file system is automatically shared and unshared with the
1882 .Nm zfs Cm share
1883 and
1884 .Nm zfs Cm unshare
1885 commands.
1886 If the property is set to
1887 .Sy on ,
1888 the dataset is shared using the default options:
1889 .Pp
1890 .Em sec=sys,rw,crossmnt,no_subtree_check,no_root_squash
1891 .Pp
1892 See
1893 .Xr exports 5
1894 for the meaning of the default options. Otherwise, the
1895 .Xr exportfs 8
1896 command is invoked with options equivalent to the contents of this property.
1897 .Pp
1898 When the
1899 .Sy sharenfs
1900 property is changed for a dataset, the dataset and any children inheriting the
1901 property are re-shared with the new options, only if the property was previously
1902 .Sy off ,
1903 or if they were shared before the property was changed.
1904 If the new property is
1905 .Sy off ,
1906 the file systems are unshared.
1907 .It Sy logbias Ns = Ns Sy latency Ns | Ns Sy throughput
1908 Provide a hint to ZFS about handling of synchronous requests in this dataset.
1909 If
1910 .Sy logbias
1911 is set to
1912 .Sy latency
1913 .Pq the default ,
1914 ZFS will use pool log devices
1915 .Pq if configured
1916 to handle the requests at low latency.
1917 If
1918 .Sy logbias
1919 is set to
1920 .Sy throughput ,
1921 ZFS will not use configured pool log devices.
1922 ZFS will instead optimize synchronous operations for global pool throughput and
1923 efficient use of resources.
1924 .It Sy snapdev Ns = Ns Sy hidden Ns | Ns Sy visible
1925 Controls whether the volume snapshot devices under
1926 .Em /dev/zvol/<pool>
1927 are hidden or visible. The default value is
1928 .Sy hidden .
1929 .It Sy snapdir Ns = Ns Sy hidden Ns | Ns Sy visible
1930 Controls whether the
1931 .Pa .zfs
1932 directory is hidden or visible in the root of the file system as discussed in
1933 the
1934 .Sx Snapshots
1935 section.
1936 The default value is
1937 .Sy hidden .
1938 .It Sy sync Ns = Ns Sy standard Ns | Ns Sy always Ns | Ns Sy disabled
1939 Controls the behavior of synchronous requests
1940 .Pq e.g. fsync, O_DSYNC .
1941 .Sy standard
1942 is the
1943 .Tn POSIX
1944 specified behavior of ensuring all synchronous requests are written to stable
1945 storage and all devices are flushed to ensure data is not cached by device
1946 controllers
1947 .Pq this is the default .
1948 .Sy always
1949 causes every file system transaction to be written and flushed before its
1950 system call returns.
1951 This has a large performance penalty.
1952 .Sy disabled
1953 disables synchronous requests.
1954 File system transactions are only committed to stable storage periodically.
1955 This option will give the highest performance.
1956 However, it is very dangerous as ZFS would be ignoring the synchronous
1957 transaction demands of applications such as databases or NFS.
1958 Administrators should only use this option when the risks are understood.
1959 .It Sy version Ns = Ns Em N Ns | Ns Sy current
1960 The on-disk version of this file system, which is independent of the pool
1961 version.
1962 This property can only be set to later supported versions.
1963 See the
1964 .Nm zfs Cm upgrade
1965 command.
1966 .It Sy volsize Ns = Ns Em size
1967 For volumes, specifies the logical size of the volume.
1968 By default, creating a volume establishes a reservation of equal size.
1969 For storage pools with a version number of 9 or higher, a
1970 .Sy refreservation
1971 is set instead.
1972 Any changes to
1973 .Sy volsize
1974 are reflected in an equivalent change to the reservation
1975 .Po or
1976 .Sy refreservation
1977 .Pc .
1978 The
1979 .Sy volsize
1980 can only be set to a multiple of
1981 .Sy volblocksize ,
1982 and cannot be zero.
1983 .Pp
1984 The reservation is kept equal to the volume's logical size to prevent unexpected
1985 behavior for consumers.
1986 Without the reservation, the volume could run out of space, resulting in
1987 undefined behavior or data corruption, depending on how the volume is used.
1988 These effects can also occur when the volume size is changed while it is in use
1989 .Pq particularly when shrinking the size .
1990 Extreme care should be used when adjusting the volume size.
1991 .Pp
1992 Though not recommended, a
1993 .Qq sparse volume
1994 .Po also known as
1995 .Qq thin provisioning
1996 .Pc
1997 can be created by specifying the
1998 .Fl s
1999 option to the
2000 .Nm zfs Cm create Fl V
2001 command, or by changing the reservation after the volume has been created.
2002 A
2003 .Qq sparse volume
2004 is a volume where the reservation is less then the volume size.
2005 Consequently, writes to a sparse volume can fail with
2006 .Er ENOSPC
2007 when the pool is low on space.
2008 For a sparse volume, changes to
2009 .Sy volsize
2010 are not reflected in the reservation.
2011 .It Sy volmode Ns = Ns Cm default | full | geom | dev | none
2012 This property specifies how volumes should be exposed to the OS.
2013 Setting it to
2014 .Sy full
2015 exposes volumes as fully fledged block devices, providing maximal
2016 functionality. The value
2017 .Sy geom
2018 is just an alias for
2019 .Sy full
2020 and is kept for compatibility.
2021 Setting it to
2022 .Sy dev
2023 hides its partitions.
2024 Volumes with property set to
2025 .Sy none
2026 are not exposed outside ZFS, but can be snapshoted, cloned, replicated, etc,
2027 that can be suitable for backup purposes.
2028 Value
2029 .Sy default
2030 means that volumes exposition is controlled by system-wide tunable
2031 .Va zvol_volmode ,
2032 where
2033 .Sy full ,
2034 .Sy dev
2035 and
2036 .Sy none
2037 are encoded as 1, 2 and 3 respectively.
2038 The default values is
2039 .Sy full .
2040 .It Sy vscan Ns = Ns Sy on Ns | Ns Sy off
2041 Controls whether regular files should be scanned for viruses when a file is
2042 opened and closed.
2043 In addition to enabling this property, the virus scan service must also be
2044 enabled for virus scanning to occur.
2045 The default value is
2046 .Sy off .
2047 This property is not used on Linux.
2048 .It Sy xattr Ns = Ns Sy on Ns | Ns Sy off Ns | Ns Sy sa
2049 Controls whether extended attributes are enabled for this file system. Two
2050 styles of extended attributes are supported either directory based or system
2051 attribute based.
2052 .Pp
2053 The default value of
2054 .Sy on
2055 enables directory based extended attributes. This style of extended attribute
2056 imposes no practical limit on either the size or number of attributes which
2057 can be set on a file. Although under Linux the
2058 .Xr getxattr 2
2059 and
2060 .Xr setxattr 2
2061 system calls limit the maximum size to 64K. This is the most compatible
2062 style of extended attribute and is supported by all OpenZFS implementations.
2063 .Pp
2064 System attribute based xattrs can be enabled by setting the value to
2065 .Sy sa .
2066 The key advantage of this type of xattr is improved performance. Storing
2067 extended attributes as system attributes significantly decreases the amount of
2068 disk IO required. Up to 64K of data may be stored per-file in the space
2069 reserved for system attributes. If there is not enough space available for
2070 an extended attribute then it will be automatically written as a directory
2071 based xattr. System attribute based extended attributes are not accessible
2072 on platforms which do not support the
2073 .Sy xattr=sa
2074 feature.
2075 .Pp
2076 The use of system attribute based xattrs is strongly encouraged for users of
2077 SELinux or posix ACLs. Both of these features heavily rely of extended
2078 attributes and benefit significantly from the reduced access time.
2079 .Pp
2080 The values
2081 .Sy on
2082 and
2083 .Sy off
2084 are equivalent to the
2085 .Sy xattr
2086 and
2087 .Sy noxattr
2088 mount options.
2089 .It Sy zoned Ns = Ns Sy on Ns | Ns Sy off
2090 Controls whether the dataset is managed from a non-global zone. Zones are a
2091 Solaris feature and are not relevant on Linux. The default value is
2092 .Sy off .
2093 .El
2094 .Pp
2095 The following three properties cannot be changed after the file system is
2096 created, and therefore, should be set when the file system is created.
2097 If the properties are not set with the
2098 .Nm zfs Cm create
2099 or
2100 .Nm zpool Cm create
2101 commands, these properties are inherited from the parent dataset.
2102 If the parent dataset lacks these properties due to having been created prior to
2103 these features being supported, the new file system will have the default values
2104 for these properties.
2105 .Bl -tag -width ""
2106 .It Xo
2107 .Sy casesensitivity Ns = Ns Sy sensitive Ns | Ns
2108 .Sy insensitive Ns | Ns Sy mixed
2109 .Xc
2110 Indicates whether the file name matching algorithm used by the file system
2111 should be case-sensitive, case-insensitive, or allow a combination of both
2112 styles of matching.
2113 The default value for the
2114 .Sy casesensitivity
2115 property is
2116 .Sy sensitive .
2117 Traditionally,
2118 .Ux
2119 and
2120 .Tn POSIX
2121 file systems have case-sensitive file names.
2122 .Pp
2123 The
2124 .Sy mixed
2125 value for the
2126 .Sy casesensitivity
2127 property indicates that the file system can support requests for both
2128 case-sensitive and case-insensitive matching behavior.
2129 Currently, case-insensitive matching behavior on a file system that supports
2130 mixed behavior is limited to the SMB server product.
2131 For more information about the
2132 .Sy mixed
2133 value behavior, see the "ZFS Administration Guide".
2134 .It Xo
2135 .Sy normalization Ns = Ns Sy none Ns | Ns Sy formC Ns | Ns
2136 .Sy formD Ns | Ns Sy formKC Ns | Ns Sy formKD
2137 .Xc
2138 Indicates whether the file system should perform a
2139 .Sy unicode
2140 normalization of file names whenever two file names are compared, and which
2141 normalization algorithm should be used.
2142 File names are always stored unmodified, names are normalized as part of any
2143 comparison process.
2144 If this property is set to a legal value other than
2145 .Sy none ,
2146 and the
2147 .Sy utf8only
2148 property was left unspecified, the
2149 .Sy utf8only
2150 property is automatically set to
2151 .Sy on .
2152 The default value of the
2153 .Sy normalization
2154 property is
2155 .Sy none .
2156 This property cannot be changed after the file system is created.
2157 .It Sy utf8only Ns = Ns Sy on Ns | Ns Sy off
2158 Indicates whether the file system should reject file names that include
2159 characters that are not present in the
2160 .Sy UTF-8
2161 character code set.
2162 If this property is explicitly set to
2163 .Sy off ,
2164 the normalization property must either not be explicitly set or be set to
2165 .Sy none .
2166 The default value for the
2167 .Sy utf8only
2168 property is
2169 .Sy off .
2170 This property cannot be changed after the file system is created.
2171 .El
2172 .Pp
2173 The
2174 .Sy casesensitivity ,
2175 .Sy normalization ,
2176 and
2177 .Sy utf8only
2178 properties are also new permissions that can be assigned to non-privileged users
2179 by using the ZFS delegated administration feature.
2180 .Ss "Temporary Mount Point Properties"
2181 When a file system is mounted, either through
2182 .Xr mount 8
2183 for legacy mounts or the
2184 .Nm zfs Cm mount
2185 command for normal file systems, its mount options are set according to its
2186 properties.
2187 The correlation between properties and mount options is as follows:
2188 .Bd -literal
2189     PROPERTY                MOUNT OPTION
2190     atime                   atime/noatime
2191     canmount                auto/noauto
2192     devices                 dev/nodev
2193     exec                    exec/noexec
2194     readonly                ro/rw
2195     relatime                relatime/norelatime
2196     setuid                  suid/nosuid
2197     xattr                   xattr/noxattr
2198 .Ed
2199 .Pp
2200 In addition, these options can be set on a per-mount basis using the
2201 .Fl o
2202 option, without affecting the property that is stored on disk.
2203 The values specified on the command line override the values stored in the
2204 dataset.
2205 The
2206 .Sy nosuid
2207 option is an alias for
2208 .Sy nodevices Ns \&, Ns Sy nosetuid .
2209 These properties are reported as
2210 .Qq temporary
2211 by the
2212 .Nm zfs Cm get
2213 command.
2214 If the properties are changed while the dataset is mounted, the new setting
2215 overrides any temporary settings.
2216 .Ss "User Properties"
2217 In addition to the standard native properties, ZFS supports arbitrary user
2218 properties.
2219 User properties have no effect on ZFS behavior, but applications or
2220 administrators can use them to annotate datasets
2221 .Pq file systems, volumes, and snapshots .
2222 .Pp
2223 User property names must contain a colon
2224 .Pq Qq Sy \&:
2225 character to distinguish them from native properties.
2226 They may contain lowercase letters, numbers, and the following punctuation
2227 characters: colon
2228 .Pq Qq Sy \&: ,
2229 dash
2230 .Pq Qq Sy - ,
2231 period
2232 .Pq Qq Sy \&. ,
2233 and underscore
2234 .Pq Qq Sy _ .
2235 The expected convention is that the property name is divided into two portions
2236 such as
2237 .Em module Ns \&: Ns Em property ,
2238 but this namespace is not enforced by ZFS.
2239 User property names can be at most 256 characters, and cannot begin with a dash
2240 .Pq Qq Sy - .
2241 .Pp
2242 When making programmatic use of user properties, it is strongly suggested to use
2243 a reversed
2244 .Sy DNS
2245 domain name for the
2246 .Em module
2247 component of property names to reduce the chance that two
2248 independently-developed packages use the same property name for different
2249 purposes.
2250 .Pp
2251 The values of user properties are arbitrary strings, are always inherited, and
2252 are never validated.
2253 All of the commands that operate on properties
2254 .Po Nm zfs Cm list ,
2255 .Nm zfs Cm get ,
2256 .Nm zfs Cm set ,
2257 and so forth
2258 .Pc
2259 can be used to manipulate both native properties and user properties.
2260 Use the
2261 .Nm zfs Cm inherit
2262 command to clear a user property.
2263 If the property is not defined in any parent dataset, it is removed entirely.
2264 Property values are limited to 8192 bytes.
2265 .Ss ZFS Volumes as Swap
2266 ZFS volumes may be used as swap devices. After creating the volume with the
2267 .Nm zfs Cm create Fl V
2268 command set up and enable the swap area using the
2269 .Xr mkswap 8
2270 and
2271 .Xr swapon 8
2272 commands. Do not swap to a file on a ZFS file system. A ZFS swap file
2273 configuration is not supported.
2274 .Ss Encryption
2275 Enabling the
2276 .Sy encryption
2277 feature allows for the creation of encrypted filesystems and volumes.
2278 .Nm
2279 will encrypt all user data including file and zvol data, file attributes,
2280 ACLs, permission bits, directory listings, FUID mappings, and userused /
2281 groupused data.
2282 .Nm
2283 will not encrypt metadata related to the pool structure, including dataset
2284 names, dataset hierarchy, file size, file holes, and dedup tables. Key rotation
2285 is managed internally by the  kernel module and changing the user's key does not
2286 require re-encrypting the entire dataset. Datasets can be scrubbed, resilvered,
2287 renamed, and deleted without the encryption keys being loaded (see the
2288 .Nm zfs Cm load-key
2289 subcommand for more info on key loading).
2290 .Pp
2291 Creating an encrypted dataset requires specifying the
2292 .Sy encryption
2293 and
2294 .Sy keyformat
2295 properties at creation time, along with an optional
2296 .Sy keylocation
2297 and
2298 .Sy pbkdf2iters .
2299 After entering an encryption key, the
2300 created dataset will become an encryption root. Any descendant datasets will
2301 inherit their encryption key from the encryption root by default, meaning that
2302 loading, unloading, or changing the key for the encryption root will implicitly
2303 do the same for all inheriting datasets. If this inheritance is not desired,
2304 simply supply a
2305 .Sy keyformat
2306 when creating the child dataset or use
2307 .Nm zfs Cm change-key
2308 to break an existing relationship, creating a new encryption root on the child.
2309 Note that the child's
2310 .Sy keyformat
2311 may match that of the parent while still creating a new encryption root, and
2312 that changing the
2313 .Sy encryption
2314 property alone does not create a new encryption root; this would simply use a
2315 different cipher suite with the same key as its encryption root. The one
2316 exception is that clones will always use their origin's encryption key.
2317 As a result of this exception, some encryption-related properties (namely
2318 .Sy keystatus ,
2319 .Sy keyformat ,
2320 .Sy keylocation ,
2321 and
2322 .Sy pbkdf2iters )
2323 do not inherit like other ZFS properties and instead use the value determined
2324 by their encryption root. Encryption root inheritance can be tracked via the
2325 read-only
2326 .Sy encryptionroot
2327 property.
2328 .Pp
2329 Encryption changes the behavior of a few
2330 .Nm
2331 operations. Encryption is applied after compression so compression ratios are
2332 preserved. Normally checksums in ZFS are 256 bits long, but for encrypted data
2333 the checksum is 128 bits of the user-chosen checksum and 128 bits of MAC from
2334 the encryption suite, which provides additional protection against maliciously
2335 altered data. Deduplication is still possible with encryption enabled but for
2336 security, datasets will only dedup against themselves, their snapshots, and
2337 their clones.
2338 .Pp
2339 There are a few limitations on encrypted datasets. Encrypted data cannot be
2340 embedded via the
2341 .Sy embedded_data
2342 feature. Encrypted datasets may not have
2343 .Sy copies Ns = Ns Em 3
2344 since the implementation stores some encryption metadata where the third copy
2345 would normally be. Since compression is applied before encryption datasets may
2346 be vulnerable to a CRIME-like attack if applications accessing the data allow
2347 for it. Deduplication with encryption will leak information about which blocks
2348 are equivalent in a dataset and will incur an extra CPU cost per block written.
2349 .Sh SUBCOMMANDS
2350 All subcommands that modify state are logged persistently to the pool in their
2351 original form.
2352 .Bl -tag -width ""
2353 .It Nm Fl ?
2354 Displays a help message.
2355 .It Xo
2356 .Nm
2357 .Cm create
2358 .Op Fl p
2359 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2360 .Ar filesystem
2361 .Xc
2362 Creates a new ZFS file system.
2363 The file system is automatically mounted according to the
2364 .Sy mountpoint
2365 property inherited from the parent.
2366 .Bl -tag -width "-o"
2367 .It Fl o Ar property Ns = Ns Ar value
2368 Sets the specified property as if the command
2369 .Nm zfs Cm set Ar property Ns = Ns Ar value
2370 was invoked at the same time the dataset was created.
2371 Any editable ZFS property can also be set at creation time.
2372 Multiple
2373 .Fl o
2374 options can be specified.
2375 An error results if the same property is specified in multiple
2376 .Fl o
2377 options.
2378 .It Fl p
2379 Creates all the non-existing parent datasets.
2380 Datasets created in this manner are automatically mounted according to the
2381 .Sy mountpoint
2382 property inherited from their parent.
2383 Any property specified on the command line using the
2384 .Fl o
2385 option is ignored.
2386 If the target filesystem already exists, the operation completes successfully.
2387 .El
2388 .It Xo
2389 .Nm
2390 .Cm create
2391 .Op Fl ps
2392 .Op Fl b Ar blocksize
2393 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2394 .Fl V Ar size Ar volume
2395 .Xc
2396 Creates a volume of the given size.
2397 The volume is exported as a block device in
2398 .Pa /dev/zvol/path ,
2399 where
2400 .Em path
2401 is the name of the volume in the ZFS namespace.
2402 The size represents the logical size as exported by the device.
2403 By default, a reservation of equal size is created.
2404 .Pp
2405 .Ar size
2406 is automatically rounded up to the nearest 128 Kbytes to ensure that the volume
2407 has an integral number of blocks regardless of
2408 .Sy blocksize .
2409 .Bl -tag -width "-b"
2410 .It Fl b Ar blocksize
2411 Equivalent to
2412 .Fl o Sy volblocksize Ns = Ns Ar blocksize .
2413 If this option is specified in conjunction with
2414 .Fl o Sy volblocksize ,
2415 the resulting behavior is undefined.
2416 .It Fl o Ar property Ns = Ns Ar value
2417 Sets the specified property as if the
2418 .Nm zfs Cm set Ar property Ns = Ns Ar value
2419 command was invoked at the same time the dataset was created.
2420 Any editable ZFS property can also be set at creation time.
2421 Multiple
2422 .Fl o
2423 options can be specified.
2424 An error results if the same property is specified in multiple
2425 .Fl o
2426 options.
2427 .It Fl p
2428 Creates all the non-existing parent datasets.
2429 Datasets created in this manner are automatically mounted according to the
2430 .Sy mountpoint
2431 property inherited from their parent.
2432 Any property specified on the command line using the
2433 .Fl o
2434 option is ignored.
2435 If the target filesystem already exists, the operation completes successfully.
2436 .It Fl s
2437 Creates a sparse volume with no reservation.
2438 See
2439 .Sy volsize
2440 in the
2441 .Sx Native Properties
2442 section for more information about sparse volumes.
2443 .El
2444 .It Xo
2445 .Nm
2446 .Cm destroy
2447 .Op Fl Rfnprv
2448 .Ar filesystem Ns | Ns Ar volume
2449 .Xc
2450 Destroys the given dataset.
2451 By default, the command unshares any file systems that are currently shared,
2452 unmounts any file systems that are currently mounted, and refuses to destroy a
2453 dataset that has active dependents
2454 .Pq children or clones .
2455 .Bl -tag -width "-R"
2456 .It Fl R
2457 Recursively destroy all dependents, including cloned file systems outside the
2458 target hierarchy.
2459 .It Fl f
2460 Force an unmount of any file systems using the
2461 .Nm unmount Fl f
2462 command.
2463 This option has no effect on non-file systems or unmounted file systems.
2464 .It Fl n
2465 Do a dry-run
2466 .Pq Qq No-op
2467 deletion.
2468 No data will be deleted.
2469 This is useful in conjunction with the
2470 .Fl v
2471 or
2472 .Fl p
2473 flags to determine what data would be deleted.
2474 .It Fl p
2475 Print machine-parsable verbose information about the deleted data.
2476 .It Fl r
2477 Recursively destroy all children.
2478 .It Fl v
2479 Print verbose information about the deleted data.
2480 .El
2481 .Pp
2482 Extreme care should be taken when applying either the
2483 .Fl r
2484 or the
2485 .Fl R
2486 options, as they can destroy large portions of a pool and cause unexpected
2487 behavior for mounted file systems in use.
2488 .It Xo
2489 .Nm
2490 .Cm destroy
2491 .Op Fl Rdnprv
2492 .Ar filesystem Ns | Ns Ar volume Ns @ Ns Ar snap Ns
2493 .Oo % Ns Ar snap Ns Oo , Ns Ar snap Ns Oo % Ns Ar snap Oc Oc Oc Ns ...
2494 .Xc
2495 The given snapshots are destroyed immediately if and only if the
2496 .Nm zfs Cm destroy
2497 command without the
2498 .Fl d
2499 option would have destroyed it.
2500 Such immediate destruction would occur, for example, if the snapshot had no
2501 clones and the user-initiated reference count were zero.
2502 .Pp
2503 If a snapshot does not qualify for immediate destruction, it is marked for
2504 deferred deletion.
2505 In this state, it exists as a usable, visible snapshot until both of the
2506 preconditions listed above are met, at which point it is destroyed.
2507 .Pp
2508 An inclusive range of snapshots may be specified by separating the first and
2509 last snapshots with a percent sign.
2510 The first and/or last snapshots may be left blank, in which case the
2511 filesystem's oldest or newest snapshot will be implied.
2512 .Pp
2513 Multiple snapshots
2514 .Pq or ranges of snapshots
2515 of the same filesystem or volume may be specified in a comma-separated list of
2516 snapshots.
2517 Only the snapshot's short name
2518 .Po the part after the
2519 .Sy @
2520 .Pc
2521 should be specified when using a range or comma-separated list to identify
2522 multiple snapshots.
2523 .Bl -tag -width "-R"
2524 .It Fl R
2525 Recursively destroy all clones of these snapshots, including the clones,
2526 snapshots, and children.
2527 If this flag is specified, the
2528 .Fl d
2529 flag will have no effect.
2530 .It Fl d
2531 Destroy immediately. If a snapshot cannot be destroyed now, mark it for
2532 deferred destruction.
2533 .It Fl n
2534 Do a dry-run
2535 .Pq Qq No-op
2536 deletion.
2537 No data will be deleted.
2538 This is useful in conjunction with the
2539 .Fl p
2540 or
2541 .Fl v
2542 flags to determine what data would be deleted.
2543 .It Fl p
2544 Print machine-parsable verbose information about the deleted data.
2545 .It Fl r
2546 Destroy
2547 .Pq or mark for deferred deletion
2548 all snapshots with this name in descendent file systems.
2549 .It Fl v
2550 Print verbose information about the deleted data.
2551 .Pp
2552 Extreme care should be taken when applying either the
2553 .Fl r
2554 or the
2555 .Fl R
2556 options, as they can destroy large portions of a pool and cause unexpected
2557 behavior for mounted file systems in use.
2558 .El
2559 .It Xo
2560 .Nm
2561 .Cm destroy
2562 .Ar filesystem Ns | Ns Ar volume Ns # Ns Ar bookmark
2563 .Xc
2564 The given bookmark is destroyed.
2565 .It Xo
2566 .Nm
2567 .Cm snapshot
2568 .Op Fl r
2569 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2570 .Ar filesystem Ns @ Ns Ar snapname Ns | Ns Ar volume Ns @ Ns Ar snapname Ns ...
2571 .Xc
2572 Creates snapshots with the given names.
2573 All previous modifications by successful system calls to the file system are
2574 part of the snapshots.
2575 Snapshots are taken atomically, so that all snapshots correspond to the same
2576 moment in time.
2577 .Nm zfs Cm snap
2578 can be used as an alias for
2579 .Nm zfs Cm snapshot.
2580 See the
2581 .Sx Snapshots
2582 section for details.
2583 .Bl -tag -width "-o"
2584 .It Fl o Ar property Ns = Ns Ar value
2585 Sets the specified property; see
2586 .Nm zfs Cm create
2587 for details.
2588 .It Fl r
2589 Recursively create snapshots of all descendent datasets
2590 .El
2591 .It Xo
2592 .Nm
2593 .Cm rollback
2594 .Op Fl Rfr
2595 .Ar snapshot
2596 .Xc
2597 Roll back the given dataset to a previous snapshot.
2598 When a dataset is rolled back, all data that has changed since the snapshot is
2599 discarded, and the dataset reverts to the state at the time of the snapshot.
2600 By default, the command refuses to roll back to a snapshot other than the most
2601 recent one.
2602 In order to do so, all intermediate snapshots and bookmarks must be destroyed by
2603 specifying the
2604 .Fl r
2605 option.
2606 .Pp
2607 The
2608 .Fl rR
2609 options do not recursively destroy the child snapshots of a recursive snapshot.
2610 Only direct snapshots of the specified filesystem are destroyed by either of
2611 these options.
2612 To completely roll back a recursive snapshot, you must rollback the individual
2613 child snapshots.
2614 .Bl -tag -width "-R"
2615 .It Fl R
2616 Destroy any more recent snapshots and bookmarks, as well as any clones of those
2617 snapshots.
2618 .It Fl f
2619 Used with the
2620 .Fl R
2621 option to force an unmount of any clone file systems that are to be destroyed.
2622 .It Fl r
2623 Destroy any snapshots and bookmarks more recent than the one specified.
2624 .El
2625 .It Xo
2626 .Nm
2627 .Cm clone
2628 .Op Fl p
2629 .Oo Fl o Ar property Ns = Ns Ar value Oc Ns ...
2630 .Ar snapshot Ar filesystem Ns | Ns Ar volume
2631 .Xc
2632 Creates a clone of the given snapshot.
2633 See the
2634 .Sx Clones
2635 section for details.
2636 The target dataset can be located anywhere in the ZFS hierarchy, and is created
2637 as the same type as the original.
2638 .Bl -tag -width "-o"
2639 .It Fl o Ar property Ns = Ns Ar value
2640 Sets the specified property; see
2641 .Nm zfs Cm create
2642 for details.
2643 .It Fl p
2644 Creates all the non-existing parent datasets.
2645 Datasets created in this manner are automatically mounted according to the
2646 .Sy mountpoint
2647 property inherited from their parent.
2648 If the target filesystem or volume already exists, the operation completes
2649 successfully.
2650 .El
2651 .It Xo
2652 .Nm
2653 .Cm promote
2654 .Ar clone-filesystem
2655 .Xc
2656 Promotes a clone file system to no longer be dependent on its
2657 .Qq origin
2658 snapshot.
2659 This makes it possible to destroy the file system that the clone was created
2660 from.
2661 The clone parent-child dependency relationship is reversed, so that the origin
2662 file system becomes a clone of the specified file system.
2663 .Pp
2664 The snapshot that was cloned, and any snapshots previous to this snapshot, are
2665 now owned by the promoted clone.
2666 The space they use moves from the origin file system to the promoted clone, so
2667 enough space must be available to accommodate these snapshots.
2668 No new space is consumed by this operation, but the space accounting is
2669 adjusted.
2670 The promoted clone must not have any conflicting snapshot names of its own.
2671 The
2672 .Cm rename
2673 subcommand can be used to rename any conflicting snapshots.
2674 .It Xo
2675 .Nm
2676 .Cm rename
2677 .Op Fl f
2678 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2679 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
2680 .Xc
2681 .It Xo
2682 .Nm
2683 .Cm rename
2684 .Op Fl fp
2685 .Ar filesystem Ns | Ns Ar volume
2686 .Ar filesystem Ns | Ns Ar volume
2687 .Xc
2688 Renames the given dataset.
2689 The new target can be located anywhere in the ZFS hierarchy, with the exception
2690 of snapshots.
2691 Snapshots can only be renamed within the parent file system or volume.
2692 When renaming a snapshot, the parent file system of the snapshot does not need
2693 to be specified as part of the second argument.
2694 Renamed file systems can inherit new mount points, in which case they are
2695 unmounted and remounted at the new mount point.
2696 .Bl -tag -width "-a"
2697 .It Fl f
2698 Force unmount any filesystems that need to be unmounted in the process.
2699 .It Fl p
2700 Creates all the nonexistent parent datasets.
2701 Datasets created in this manner are automatically mounted according to the
2702 .Sy mountpoint
2703 property inherited from their parent.
2704 .El
2705 .It Xo
2706 .Nm
2707 .Cm rename
2708 .Fl r
2709 .Ar snapshot Ar snapshot
2710 .Xc
2711 Recursively rename the snapshots of all descendent datasets.
2712 Snapshots are the only dataset that can be renamed recursively.
2713 .It Xo
2714 .Nm
2715 .Cm list
2716 .Op Fl r Ns | Ns Fl d Ar depth
2717 .Op Fl Hp
2718 .Oo Fl o Ar property Ns Oo , Ns Ar property Oc Ns ... Oc
2719 .Oo Fl s Ar property Oc Ns ...
2720 .Oo Fl S Ar property Oc Ns ...
2721 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2722 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Oc Ns ...
2723 .Xc
2724 Lists the property information for the given datasets in tabular form.
2725 If specified, you can list property information by the absolute pathname or the
2726 relative pathname.
2727 By default, all file systems and volumes are displayed.
2728 Snapshots are displayed if the
2729 .Sy listsnaps
2730 property is
2731 .Sy on
2732 .Po the default is
2733 .Sy off
2734 .Pc .
2735 The following fields are displayed,
2736 .Sy name Ns \&, Ns Sy used Ns \&, Ns Sy available Ns \&, Ns Sy referenced Ns \&, Ns
2737 .Sy mountpoint .
2738 .Bl -tag -width "-H"
2739 .It Fl H
2740 Used for scripting mode.
2741 Do not print headers and separate fields by a single tab instead of arbitrary
2742 white space.
2743 .It Fl S Ar property
2744 Same as the
2745 .Fl s
2746 option, but sorts by property in descending order.
2747 .It Fl d Ar depth
2748 Recursively display any children of the dataset, limiting the recursion to
2749 .Ar depth .
2750 A
2751 .Ar depth
2752 of
2753 .Sy 1
2754 will display only the dataset and its direct children.
2755 .It Fl o Ar property
2756 A comma-separated list of properties to display.
2757 The property must be:
2758 .Bl -bullet
2759 .It
2760 One of the properties described in the
2761 .Sx Native Properties
2762 section
2763 .It
2764 A user property
2765 .It
2766 The value
2767 .Sy name
2768 to display the dataset name
2769 .It
2770 The value
2771 .Sy space
2772 to display space usage properties on file systems and volumes.
2773 This is a shortcut for specifying
2774 .Fl o Sy name Ns \&, Ns Sy avail Ns \&, Ns Sy used Ns \&, Ns Sy usedsnap Ns \&, Ns
2775 .Sy usedds Ns \&, Ns Sy usedrefreserv Ns \&, Ns Sy usedchild Fl t
2776 .Sy filesystem Ns \&, Ns Sy volume
2777 syntax.
2778 .El
2779 .It Fl p
2780 Display numbers in parsable
2781 .Pq exact
2782 values.
2783 .It Fl r
2784 Recursively display any children of the dataset on the command line.
2785 .It Fl s Ar property
2786 A property for sorting the output by column in ascending order based on the
2787 value of the property.
2788 The property must be one of the properties described in the
2789 .Sx Properties
2790 section, or the special value
2791 .Sy name
2792 to sort by the dataset name.
2793 Multiple properties can be specified at one time using multiple
2794 .Fl s
2795 property options.
2796 Multiple
2797 .Fl s
2798 options are evaluated from left to right in decreasing order of importance.
2799 The following is a list of sorting criteria:
2800 .Bl -bullet
2801 .It
2802 Numeric types sort in numeric order.
2803 .It
2804 String types sort in alphabetical order.
2805 .It
2806 Types inappropriate for a row sort that row to the literal bottom, regardless of
2807 the specified ordering.
2808 .El
2809 .Pp
2810 If no sorting options are specified the existing behavior of
2811 .Nm zfs Cm list
2812 is preserved.
2813 .It Fl t Ar type
2814 A comma-separated list of types to display, where
2815 .Ar type
2816 is one of
2817 .Sy filesystem ,
2818 .Sy snapshot ,
2819 .Sy volume ,
2820 .Sy bookmark ,
2821 or
2822 .Sy all .
2823 For example, specifying
2824 .Fl t Sy snapshot
2825 displays only snapshots.
2826 .El
2827 .It Xo
2828 .Nm
2829 .Cm set
2830 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
2831 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2832 .Xc
2833 Sets the property or list of properties to the given value(s) for each dataset.
2834 Only some properties can be edited.
2835 See the
2836 .Sx Properties
2837 section for more information on what properties can be set and acceptable
2838 values.
2839 Numeric values can be specified as exact values, or in a human-readable form
2840 with a suffix of
2841 .Sy B , K , M , G , T , P , E , Z
2842 .Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
2843 or zettabytes, respectively
2844 .Pc .
2845 User properties can be set on snapshots.
2846 For more information, see the
2847 .Sx User Properties
2848 section.
2849 .It Xo
2850 .Nm
2851 .Cm get
2852 .Op Fl r Ns | Ns Fl d Ar depth
2853 .Op Fl Hp
2854 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
2855 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
2856 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
2857 .Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
2858 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Ns ...
2859 .Xc
2860 Displays properties for the given datasets.
2861 If no datasets are specified, then the command displays properties for all
2862 datasets on the system.
2863 For each property, the following columns are displayed:
2864 .Bd -literal
2865     name      Dataset name
2866     property  Property name
2867     value     Property value
2868     source    Property source.  Can either be local, default,
2869               temporary, inherited, or none (-).
2870 .Ed
2871 .Pp
2872 All columns are displayed by default, though this can be controlled by using the
2873 .Fl o
2874 option.
2875 This command takes a comma-separated list of properties as described in the
2876 .Sx Native Properties
2877 and
2878 .Sx User Properties
2879 sections.
2880 .Pp
2881 The special value
2882 .Sy all
2883 can be used to display all properties that apply to the given dataset's type
2884 .Pq filesystem, volume, snapshot, or bookmark .
2885 .Bl -tag -width "-H"
2886 .It Fl H
2887 Display output in a form more easily parsed by scripts.
2888 Any headers are omitted, and fields are explicitly separated by a single tab
2889 instead of an arbitrary amount of space.
2890 .It Fl d Ar depth
2891 Recursively display any children of the dataset, limiting the recursion to
2892 .Ar depth .
2893 A depth of
2894 .Sy 1
2895 will display only the dataset and its direct children.
2896 .It Fl o Ar field
2897 A comma-separated list of columns to display.
2898 .Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
2899 is the default value.
2900 .It Fl p
2901 Display numbers in parsable
2902 .Pq exact
2903 values.
2904 .It Fl r
2905 Recursively display properties for any children.
2906 .It Fl s Ar source
2907 A comma-separated list of sources to display.
2908 Those properties coming from a source other than those in this list are ignored.
2909 Each source must be one of the following:
2910 .Sy local ,
2911 .Sy default ,
2912 .Sy inherited ,
2913 .Sy temporary ,
2914 and
2915 .Sy none .
2916 The default value is all sources.
2917 .It Fl t Ar type
2918 A comma-separated list of types to display, where
2919 .Ar type
2920 is one of
2921 .Sy filesystem ,
2922 .Sy snapshot ,
2923 .Sy volume ,
2924 .Sy bookmark ,
2925 or
2926 .Sy all .
2927 .El
2928 .It Xo
2929 .Nm
2930 .Cm inherit
2931 .Op Fl rS
2932 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
2933 .Xc
2934 Clears the specified property, causing it to be inherited from an ancestor,
2935 restored to default if no ancestor has the property set, or with the
2936 .Fl S
2937 option reverted to the received value if one exists.
2938 See the
2939 .Sx Properties
2940 section for a listing of default values, and details on which properties can be
2941 inherited.
2942 .Bl -tag -width "-r"
2943 .It Fl r
2944 Recursively inherit the given property for all children.
2945 .It Fl S
2946 Revert the property to the received value if one exists; otherwise operate as
2947 if the
2948 .Fl S
2949 option was not specified.
2950 .El
2951 .It Xo
2952 .Nm
2953 .Cm upgrade
2954 .Xc
2955 Displays a list of file systems that are not the most recent version.
2956 .It Xo
2957 .Nm
2958 .Cm upgrade
2959 .Fl v
2960 .Xc
2961 Displays a list of currently supported file system versions.
2962 .It Xo
2963 .Nm
2964 .Cm upgrade
2965 .Op Fl r
2966 .Op Fl V Ar version
2967 .Fl a | Ar filesystem
2968 .Xc
2969 Upgrades file systems to a new on-disk version.
2970 Once this is done, the file systems will no longer be accessible on systems
2971 running older versions of the software.
2972 .Nm zfs Cm send
2973 streams generated from new snapshots of these file systems cannot be accessed on
2974 systems running older versions of the software.
2975 .Pp
2976 In general, the file system version is independent of the pool version.
2977 See
2978 .Xr zpool 8
2979 for information on the
2980 .Nm zpool Cm upgrade
2981 command.
2982 .Pp
2983 In some cases, the file system version and the pool version are interrelated and
2984 the pool version must be upgraded before the file system version can be
2985 upgraded.
2986 .Bl -tag -width "-V"
2987 .It Fl V Ar version
2988 Upgrade to the specified
2989 .Ar version .
2990 If the
2991 .Fl V
2992 flag is not specified, this command upgrades to the most recent version.
2993 This
2994 option can only be used to increase the version number, and only up to the most
2995 recent version supported by this software.
2996 .It Fl a
2997 Upgrade all file systems on all imported pools.
2998 .It Ar filesystem
2999 Upgrade the specified file system.
3000 .It Fl r
3001 Upgrade the specified file system and all descendent file systems.
3002 .El
3003 .It Xo
3004 .Nm
3005 .Cm userspace
3006 .Op Fl Hinp
3007 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3008 .Oo Fl s Ar field Oc Ns ...
3009 .Oo Fl S Ar field Oc Ns ...
3010 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3011 .Ar filesystem Ns | Ns Ar snapshot
3012 .Xc
3013 Displays space consumed by, and quotas on, each user in the specified filesystem
3014 or snapshot.
3015 This corresponds to the
3016 .Sy userused@ Ns Em user ,
3017 .Sy userobjused@ Ns Em user ,
3018 .Sy userquota@ Ns Em user,
3019 and
3020 .Sy userobjquota@ Ns Em user
3021 properties.
3022 .Bl -tag -width "-H"
3023 .It Fl H
3024 Do not print headers, use tab-delimited output.
3025 .It Fl S Ar field
3026 Sort by this field in reverse order.
3027 See
3028 .Fl s .
3029 .It Fl i
3030 Translate SID to POSIX ID.
3031 The POSIX ID may be ephemeral if no mapping exists.
3032 Normal POSIX interfaces
3033 .Po for example,
3034 .Xr stat 2 ,
3035 .Nm ls Fl l
3036 .Pc
3037 perform this translation, so the
3038 .Fl i
3039 option allows the output from
3040 .Nm zfs Cm userspace
3041 to be compared directly with those utilities.
3042 However,
3043 .Fl i
3044 may lead to confusion if some files were created by an SMB user before a
3045 SMB-to-POSIX name mapping was established.
3046 In such a case, some files will be owned by the SMB entity and some by the POSIX
3047 entity.
3048 However, the
3049 .Fl i
3050 option will report that the POSIX entity has the total usage and quota for both.
3051 .It Fl n
3052 Print numeric ID instead of user/group name.
3053 .It Fl o Ar field Ns Oo , Ns Ar field Oc Ns ...
3054 Display only the specified fields from the following set:
3055 .Sy type ,
3056 .Sy name ,
3057 .Sy used ,
3058 .Sy quota .
3059 The default is to display all fields.
3060 .It Fl p
3061 Use exact
3062 .Pq parsable
3063 numeric output.
3064 .It Fl s Ar field
3065 Sort output by this field.
3066 The
3067 .Fl s
3068 and
3069 .Fl S
3070 flags may be specified multiple times to sort first by one field, then by
3071 another.
3072 The default is
3073 .Fl s Sy type Fl s Sy name .
3074 .It Fl t Ar type Ns Oo , Ns Ar type Oc Ns ...
3075 Print only the specified types from the following set:
3076 .Sy all ,
3077 .Sy posixuser ,
3078 .Sy smbuser ,
3079 .Sy posixgroup ,
3080 .Sy smbgroup .
3081 The default is
3082 .Fl t Sy posixuser Ns \&, Ns Sy smbuser .
3083 The default can be changed to include group types.
3084 .El
3085 .It Xo
3086 .Nm
3087 .Cm groupspace
3088 .Op Fl Hinp
3089 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3090 .Oo Fl s Ar field Oc Ns ...
3091 .Oo Fl S Ar field Oc Ns ...
3092 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
3093 .Ar filesystem Ns | Ns Ar snapshot
3094 .Xc
3095 Displays space consumed by, and quotas on, each group in the specified
3096 filesystem or snapshot.
3097 This subcommand is identical to
3098 .Nm zfs Cm userspace ,
3099 except that the default types to display are
3100 .Fl t Sy posixgroup Ns \&, Ns Sy smbgroup .
3101 .It Xo
3102 .Nm
3103 .Cm projectspace
3104 .Op Fl Hp
3105 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
3106 .Oo Fl s Ar field Oc Ns ...
3107 .Oo Fl S Ar field Oc Ns ...
3108 .Ar filesystem Ns | Ns Ar snapshot
3109 .Xc
3110 Displays space consumed by, and quotas on, each project in the specified
3111 filesystem or snapshot. This subcommand is identical to
3112 .Nm zfs Cm userspace ,
3113 except that the project identifier is numeral, not name. So need neither
3114 the option
3115 .Sy -i
3116 for SID to POSIX ID nor
3117 .Sy -n
3118 for numeric ID, nor
3119 .Sy -t
3120 for types.
3121 .It Xo
3122 .Nm
3123 .Cm project
3124 .Oo Fl d Ns | Ns Fl r Ns Oc
3125 .Ar file Ns | Ns Ar directory Ns ...
3126 .Xc
3127 List project identifier (ID) and inherit flag of file(s) or directories.
3128 .Bl -tag -width "-d"
3129 .It Fl d
3130 Show the directory project ID and inherit flag, not its childrens. It will
3131 overwrite the former specified
3132 .Fl r
3133 option.
3134 .It Fl r
3135 Show on subdirectories recursively. It will overwrite the former specified
3136 .Fl d
3137 option.
3138 .El
3139 .It Xo
3140 .Nm
3141 .Cm project
3142 .Fl C
3143 .Oo Fl kr Ns Oc
3144 .Ar file Ns | Ns Ar directory Ns ...
3145 .Xc
3146 Clear project inherit flag and/or ID on the file(s) or directories.
3147 .Bl -tag -width "-k"
3148 .It Fl k
3149 Keep the project ID unchanged. If not specified, the project ID will be reset
3150 as zero.
3151 .It Fl r
3152 Clear on subdirectories recursively.
3153 .El
3154 .It Xo
3155 .Nm
3156 .Cm project
3157 .Fl c
3158 .Oo Fl 0 Ns Oc
3159 .Oo Fl d Ns | Ns Fl r Ns Oc
3160 .Op Fl p Ar id
3161 .Ar file Ns | Ns Ar directory Ns ...
3162 .Xc
3163 Check project ID and inherit flag on the file(s) or directories, report the
3164 entries without project inherit flag or with different project IDs from the
3165 specified (via
3166 .Fl p
3167 option) value or the target directory's project ID.
3168 .Bl -tag -width "-0"
3169 .It Fl 0
3170 Print file name with a trailing NUL instead of newline (by default), like
3171 "find -print0".
3172 .It Fl d
3173 Check the directory project ID and inherit flag, not its childrens. It will
3174 overwrite the former specified
3175 .Fl r
3176 option.
3177 .It Fl p
3178 Specify the referenced ID for comparing with the target file(s) or directories'
3179 project IDs. If not specified, the target (top) directory's project ID will be
3180 used as the referenced one.
3181 .It Fl r
3182 Check on subdirectories recursively. It will overwrite the former specified
3183 .Fl d
3184 option.
3185 .El
3186 .It Xo
3187 .Nm
3188 .Cm project
3189 .Op Fl p Ar id
3190 .Oo Fl rs Ns Oc
3191 .Ar file Ns | Ns Ar directory Ns ...
3192 .Xc
3193 .Bl -tag -width "-p"
3194 Set project ID and/or inherit flag on the file(s) or directories.
3195 .It Fl p
3196 Set the file(s)' or directories' project ID with the given value.
3197 .It Fl r
3198 Set on subdirectories recursively.
3199 .It Fl s
3200 Set project inherit flag on the given file(s) or directories. It is usually used
3201 for setup tree quota on the directory target with
3202 .Fl r
3203 option specified together. When setup tree quota, by default the directory's
3204 project ID will be set to all its descendants unless you specify the project
3205 ID via
3206 .Fl p
3207 option explicitly.
3208 .El
3209 .It Xo
3210 .Nm
3211 .Cm mount
3212 .Xc
3213 Displays all ZFS file systems currently mounted.
3214 .It Xo
3215 .Nm
3216 .Cm mount
3217 .Op Fl Olv
3218 .Op Fl o Ar options
3219 .Fl a | Ar filesystem
3220 .Xc
3221 Mounts ZFS file systems.
3222 .Bl -tag -width "-O"
3223 .It Fl O
3224 Perform an overlay mount.
3225 See
3226 .Xr mount 8
3227 for more information.
3228 .It Fl a
3229 Mount all available ZFS file systems.
3230 Invoked automatically as part of the boot process.
3231 .It Ar filesystem
3232 Mount the specified filesystem.
3233 .It Fl o Ar options
3234 An optional, comma-separated list of mount options to use temporarily for the
3235 duration of the mount.
3236 See the
3237 .Sx Temporary Mount Point Properties
3238 section for details.
3239 .It Fl l
3240 Load keys for encrypted filesystems as they are being mounted. This is
3241 equivalent to executing
3242 .Nm zfs Cm load-key
3243 on each encryption root before mounting it. Note that if a filesystem has a
3244 .Sy keylocation
3245 of
3246 .Sy prompt
3247 this will cause the terminal to interactively block after asking for the key.
3248 .It Fl v
3249 Report mount progress.
3250 .El
3251 .It Xo
3252 .Nm
3253 .Cm unmount
3254 .Op Fl f
3255 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
3256 .Xc
3257 Unmounts currently mounted ZFS file systems.
3258 .Bl -tag -width "-a"
3259 .It Fl a
3260 Unmount all available ZFS file systems.
3261 Invoked automatically as part of the shutdown process.
3262 .It Ar filesystem Ns | Ns Ar mountpoint
3263 Unmount the specified filesystem.
3264 The command can also be given a path to a ZFS file system mount point on the
3265 system.
3266 .It Fl f
3267 Forcefully unmount the file system, even if it is currently in use.
3268 .El
3269 .It Xo
3270 .Nm
3271 .Cm share
3272 .Fl a | Ar filesystem
3273 .Xc
3274 Shares available ZFS file systems.
3275 .Bl -tag -width "-a"
3276 .It Fl a
3277 Share all available ZFS file systems.
3278 Invoked automatically as part of the boot process.
3279 .It Ar filesystem
3280 Share the specified filesystem according to the
3281 .Sy sharenfs
3282 and
3283 .Sy sharesmb
3284 properties.
3285 File systems are shared when the
3286 .Sy sharenfs
3287 or
3288 .Sy sharesmb
3289 property is set.
3290 .El
3291 .It Xo
3292 .Nm
3293 .Cm unshare
3294 .Fl a | Ar filesystem Ns | Ns Ar mountpoint
3295 .Xc
3296 Unshares currently shared ZFS file systems.
3297 .Bl -tag -width "-a"
3298 .It Fl a
3299 Unshare all available ZFS file systems.
3300 Invoked automatically as part of the shutdown process.
3301 .It Ar filesystem Ns | Ns Ar mountpoint
3302 Unshare the specified filesystem.
3303 The command can also be given a path to a ZFS file system shared on the system.
3304 .El
3305 .It Xo
3306 .Nm
3307 .Cm bookmark
3308 .Ar snapshot bookmark
3309 .Xc
3310 Creates a bookmark of the given snapshot.
3311 Bookmarks mark the point in time when the snapshot was created, and can be used
3312 as the incremental source for a
3313 .Nm zfs Cm send
3314 command.
3315 .Pp
3316 This feature must be enabled to be used.
3317 See
3318 .Xr zpool-features 5
3319 for details on ZFS feature flags and the
3320 .Sy bookmarks
3321 feature.
3322 .It Xo
3323 .Nm
3324 .Cm send
3325 .Op Fl DLPRbcenpvw
3326 .Op Oo Fl I Ns | Ns Fl i Oc Ar snapshot
3327 .Ar snapshot
3328 .Xc
3329 Creates a stream representation of the second
3330 .Ar snapshot ,
3331 which is written to standard output.
3332 The output can be redirected to a file or to a different system
3333 .Po for example, using
3334 .Xr ssh 1
3335 .Pc .
3336 By default, a full stream is generated.
3337 .Bl -tag -width "-D"
3338 .It Fl D, -dedup
3339 Generate a deduplicated stream.
3340 Blocks which would have been sent multiple times in the send stream will only be
3341 sent once.
3342 The receiving system must also support this feature to receive a deduplicated
3343 stream.
3344 This flag can be used regardless of the dataset's
3345 .Sy dedup
3346 property, but performance will be much better if the filesystem uses a
3347 dedup-capable checksum
3348 .Po for example,
3349 .Sy sha256
3350 .Pc .
3351 .It Fl I Ar snapshot
3352 Generate a stream package that sends all intermediary snapshots from the first
3353 snapshot to the second snapshot.
3354 For example,
3355 .Fl I Em @a Em fs@d
3356 is similar to
3357 .Fl i Em @a Em fs@b Ns \&; Fl i Em @b Em fs@c Ns \&; Fl i Em @c Em fs@d .
3358 The incremental source may be specified as with the
3359 .Fl i
3360 option.
3361 .It Fl L, -large-block
3362 Generate a stream which may contain blocks larger than 128KB.
3363 This flag has no effect if the
3364 .Sy large_blocks
3365 pool feature is disabled, or if the
3366 .Sy recordsize
3367 property of this filesystem has never been set above 128KB.
3368 The receiving system must have the
3369 .Sy large_blocks
3370 pool feature enabled as well.
3371 See
3372 .Xr zpool-features 5
3373 for details on ZFS feature flags and the
3374 .Sy large_blocks
3375 feature.
3376 .It Fl P, -parsable
3377 Print machine-parsable verbose information about the stream package generated.
3378 .It Fl R, -replicate
3379 Generate a replication stream package, which will replicate the specified
3380 file system, and all descendent file systems, up to the named snapshot.
3381 When received, all properties, snapshots, descendent file systems, and clones
3382 are preserved.
3383 .Pp
3384 If the
3385 .Fl i
3386 or
3387 .Fl I
3388 flags are used in conjunction with the
3389 .Fl R
3390 flag, an incremental replication stream is generated.
3391 The current values of properties, and current snapshot and file system names are
3392 set when the stream is received.
3393 If the
3394 .Fl F
3395 flag is specified when this stream is received, snapshots and file systems that
3396 do not exist on the sending side are destroyed.
3397 .It Fl e, -embed
3398 Generate a more compact stream by using
3399 .Sy WRITE_EMBEDDED
3400 records for blocks which are stored more compactly on disk by the
3401 .Sy embedded_data
3402 pool feature.
3403 This flag has no effect if the
3404 .Sy embedded_data
3405 feature is disabled.
3406 The receiving system must have the
3407 .Sy embedded_data
3408 feature enabled.
3409 If the
3410 .Sy lz4_compress
3411 feature is active on the sending system, then the receiving system must have
3412 that feature enabled as well. Datasets that are sent with this flag may not be
3413 received as an encrypted dataset, since encrypted datasets cannot use the
3414 .Sy embedded_data
3415 feature.
3416 See
3417 .Xr zpool-features 5
3418 for details on ZFS feature flags and the
3419 .Sy embedded_data
3420 feature.
3421 .It Fl b, -backup
3422 Sends only received property values whether or not they are overridden by local
3423 settings, but only if the dataset has ever been received. Use this option when
3424 you want
3425 .Nm zfs Cm receive
3426 to restore received properties backed up on the sent dataset and to avoid
3427 sending local settings that may have nothing to do with the source dataset,
3428 but only with how the data is backed up.
3429 .It Fl c, -compressed
3430 Generate a more compact stream by using compressed WRITE records for blocks
3431 which are compressed on disk and in memory
3432 .Po see the
3433 .Sy compression
3434 property for details
3435 .Pc .
3436 If the
3437 .Sy lz4_compress
3438 feature is active on the sending system, then the receiving system must have
3439 that feature enabled as well.
3440 If the
3441 .Sy large_blocks
3442 feature is enabled on the sending system but the
3443 .Fl L
3444 option is not supplied in conjunction with
3445 .Fl c ,
3446 then the data will be decompressed before sending so it can be split into
3447 smaller block sizes.
3448 .It Fl w, -raw
3449 For encrypted datasets, send data exactly as it exists on disk. This allows
3450 backups to be taken even if encryption keys are not currently loaded. The
3451 backup may then be received on an untrusted machine since that machine will
3452 not have the encryption keys to read the protected data or alter it without
3453 being detected. Upon being received, the dataset will have the same encryption
3454 keys as it did on the send side, although the
3455 .Sy keylocation
3456 property will be defaulted to
3457 .Sy prompt
3458 if not otherwise provided. For unencrypted datasets, this flag will be
3459 equivalent to
3460 .Fl Lec .
3461 Note that if you do not use this flag for sending encrypted datasets, data will
3462 be sent unencrypted and may be re-encrypted with a different encryption key on
3463 the receiving system, which will disable the ability to do a raw send to that
3464 system for incrementals.
3465 .It Fl i Ar snapshot
3466 Generate an incremental stream from the first
3467 .Ar snapshot
3468 .Pq the incremental source
3469 to the second
3470 .Ar snapshot
3471 .Pq the incremental target .
3472 The incremental source can be specified as the last component of the snapshot
3473 name
3474 .Po the
3475 .Sy @
3476 character and following
3477 .Pc
3478 and it is assumed to be from the same file system as the incremental target.
3479 .Pp
3480 If the destination is a clone, the source may be the origin snapshot, which must
3481 be fully specified
3482 .Po for example,
3483 .Em pool/fs@origin ,
3484 not just
3485 .Em @origin
3486 .Pc .
3487 .It Fl n, -dryrun
3488 Do a dry-run
3489 .Pq Qq No-op
3490 send.
3491 Do not generate any actual send data.
3492 This is useful in conjunction with the
3493 .Fl v
3494 or
3495 .Fl P
3496 flags to determine what data will be sent.
3497 In this case, the verbose output will be written to standard output
3498 .Po contrast with a non-dry-run, where the stream is written to standard output
3499 and the verbose output goes to standard error
3500 .Pc .
3501 .It Fl p, -props
3502 Include the dataset's properties in the stream.
3503 This flag is implicit when
3504 .Fl R
3505 is specified.
3506 The receiving system must also support this feature. Sends of encrypted datasets
3507 must use
3508 .Fl w
3509 when using this flag.
3510 .It Fl v, -verbose
3511 Print verbose information about the stream package generated.
3512 This information includes a per-second report of how much data has been sent.
3513 .Pp
3514 The format of the stream is committed.
3515 You will be able to receive your streams on future versions of ZFS.
3516 .El
3517 .It Xo
3518 .Nm
3519 .Cm send
3520 .Op Fl LPcenvw
3521 .Op Fl i Ar snapshot Ns | Ns Ar bookmark
3522 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3523 .Xc
3524 Generate a send stream, which may be of a filesystem, and may be incremental
3525 from a bookmark.
3526 If the destination is a filesystem or volume, the pool must be read-only, or the
3527 filesystem must not be mounted.
3528 When the stream generated from a filesystem or volume is received, the default
3529 snapshot name will be
3530 .Qq --head-- .
3531 .Bl -tag -width "-L"
3532 .It Fl L, -large-block
3533 Generate a stream which may contain blocks larger than 128KB.
3534 This flag has no effect if the
3535 .Sy large_blocks
3536 pool feature is disabled, or if the
3537 .Sy recordsize
3538 property of this filesystem has never been set above 128KB.
3539 The receiving system must have the
3540 .Sy large_blocks
3541 pool feature enabled as well.
3542 See
3543 .Xr zpool-features 5
3544 for details on ZFS feature flags and the
3545 .Sy large_blocks
3546 feature.
3547 .It Fl P, -parsable
3548 Print machine-parsable verbose information about the stream package generated.
3549 .It Fl c, -compressed
3550 Generate a more compact stream by using compressed WRITE records for blocks
3551 which are compressed on disk and in memory
3552 .Po see the
3553 .Sy compression
3554 property for details
3555 .Pc .
3556 If the
3557 .Sy lz4_compress
3558 feature is active on the sending system, then the receiving system must have
3559 that feature enabled as well.
3560 If the
3561 .Sy large_blocks
3562 feature is enabled on the sending system but the
3563 .Fl L
3564 option is not supplied in conjunction with
3565 .Fl c ,
3566 then the data will be decompressed before sending so it can be split into
3567 smaller block sizes.
3568 .It Fl w, -raw
3569 For encrypted datasets, send data exactly as it exists on disk. This allows
3570 backups to be taken even if encryption keys are not currently loaded. The
3571 backup may then be received on an untrusted machine since that machine will
3572 not have the encryption keys to read the protected data or alter it without
3573 being detected. Upon being received, the dataset will have the same encryption
3574 keys as it did on the send side, although the
3575 .Sy keylocation
3576 property will be defaulted to
3577 .Sy prompt
3578 if not otherwise provided. For unencrypted datasets, this flag will be
3579 equivalent to
3580 .Fl Lec .
3581 Note that if you do not use this flag for sending encrypted datasets, data will
3582 be sent unencrypted and may be re-encrypted with a different encryption key on
3583 the receiving system, which will disable the ability to do a raw send to that
3584 system for incrementals.
3585 .It Fl e, -embed
3586 Generate a more compact stream by using
3587 .Sy WRITE_EMBEDDED
3588 records for blocks which are stored more compactly on disk by the
3589 .Sy embedded_data
3590 pool feature.
3591 This flag has no effect if the
3592 .Sy embedded_data
3593 feature is disabled.
3594 The receiving system must have the
3595 .Sy embedded_data
3596 feature enabled.
3597 If the
3598 .Sy lz4_compress
3599 feature is active on the sending system, then the receiving system must have
3600 that feature enabled as well. Datasets that are sent with this flag may not be
3601 received as an encrypted dataset, since encrypted datasets cannot use the
3602 .Sy embedded_data
3603 feature.
3604 See
3605 .Xr zpool-features 5
3606 for details on ZFS feature flags and the
3607 .Sy embedded_data
3608 feature.
3609 .It Fl i Ar snapshot Ns | Ns Ar bookmark
3610 Generate an incremental send stream.
3611 The incremental source must be an earlier snapshot in the destination's history.
3612 It will commonly be an earlier snapshot in the destination's file system, in
3613 which case it can be specified as the last component of the name
3614 .Po the
3615 .Sy #
3616 or
3617 .Sy @
3618 character and following
3619 .Pc .
3620 .Pp
3621 If the incremental target is a clone, the incremental source can be the origin
3622 snapshot, or an earlier snapshot in the origin's filesystem, or the origin's
3623 origin, etc.
3624 .It Fl n, -dryrun
3625 Do a dry-run
3626 .Pq Qq No-op
3627 send.
3628 Do not generate any actual send data.
3629 This is useful in conjunction with the
3630 .Fl v
3631 or
3632 .Fl P
3633 flags to determine what data will be sent.
3634 In this case, the verbose output will be written to standard output
3635 .Po contrast with a non-dry-run, where the stream is written to standard output
3636 and the verbose output goes to standard error
3637 .Pc .
3638 .It Fl v, -verbose
3639 Print verbose information about the stream package generated.
3640 This information includes a per-second report of how much data has been sent.
3641 .El
3642 .It Xo
3643 .Nm
3644 .Cm send
3645 .Op Fl Penv
3646 .Fl t
3647 .Ar receive_resume_token
3648 .Xc
3649 Creates a send stream which resumes an interrupted receive.
3650 The
3651 .Ar receive_resume_token
3652 is the value of this property on the filesystem or volume that was being
3653 received into.
3654 See the documentation for
3655 .Sy zfs receive -s
3656 for more details.
3657 .It Xo
3658 .Nm
3659 .Cm receive
3660 .Op Fl Fnsuv
3661 .Op Fl o Sy origin Ns = Ns Ar snapshot
3662 .Op Fl o Ar property Ns = Ns Ar value
3663 .Op Fl x Ar property
3664 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot
3665 .Xc
3666 .It Xo
3667 .Nm
3668 .Cm receive
3669 .Op Fl Fnsuv
3670 .Op Fl d Ns | Ns Fl e
3671 .Op Fl o Sy origin Ns = Ns Ar snapshot
3672 .Op Fl o Ar property Ns = Ns Ar value
3673 .Op Fl x Ar property
3674 .Ar filesystem
3675 .Xc
3676 Creates a snapshot whose contents are as specified in the stream provided on
3677 standard input.
3678 If a full stream is received, then a new file system is created as well.
3679 Streams are created using the
3680 .Nm zfs Cm send
3681 subcommand, which by default creates a full stream.
3682 .Nm zfs Cm recv
3683 can be used as an alias for
3684 .Nm zfs Cm receive.
3685 .Pp
3686 If an incremental stream is received, then the destination file system must
3687 already exist, and its most recent snapshot must match the incremental stream's
3688 source.
3689 For
3690 .Sy zvols ,
3691 the destination device link is destroyed and recreated, which means the
3692 .Sy zvol
3693 cannot be accessed during the
3694 .Cm receive
3695 operation.
3696 .Pp
3697 When a snapshot replication package stream that is generated by using the
3698 .Nm zfs Cm send Fl R
3699 command is received, any snapshots that do not exist on the sending location are
3700 destroyed by using the
3701 .Nm zfs Cm destroy Fl d
3702 command.
3703 .Pp
3704 If
3705 .Fl o Em property Ns = Ns Ar value
3706 or
3707 .Fl x Em property
3708 is specified, it applies to the effective value of the property throughout
3709 the entire subtree of replicated datasets. Effective property values will be
3710 set (
3711 .Fl o
3712 ) or inherited (
3713 .Fl x
3714 ) on the topmost in the replicated subtree. In descendant datasets, if the
3715 property is set by the send stream, it will be overridden by forcing the
3716 property to be inherited from the top‐most file system. Received properties
3717 are retained in spite of being overridden and may be restored with
3718 .Nm zfs Cm inherit Fl S .
3719 Specifying
3720 .Fl o Sy origin Ns = Ns Em snapshot
3721 is a special case because, even if
3722 .Sy origin
3723 is a read-only property and cannot be set, it's allowed to receive the send
3724 stream as a clone of the given snapshot.
3725 .Pp
3726 Raw encrypted send streams (created with
3727 .Nm zfs Cm send Fl w
3728 ) may only be received as is, and cannot be re-encrypted, decrypted, or
3729 recompressed by the receive process. Unencrypted streams can be received as
3730 encrypted datasets, either through inheritance or by specifying encryption
3731 parameters with the
3732 .Fl o
3733 options.
3734 .Pp
3735 The name of the snapshot
3736 .Pq and file system, if a full stream is received
3737 that this subcommand creates depends on the argument type and the use of the
3738 .Fl d
3739 or
3740 .Fl e
3741 options.
3742 .Pp
3743 If the argument is a snapshot name, the specified
3744 .Ar snapshot
3745 is created.
3746 If the argument is a file system or volume name, a snapshot with the same name
3747 as the sent snapshot is created within the specified
3748 .Ar filesystem
3749 or
3750 .Ar volume .
3751 If neither of the
3752 .Fl d
3753 or
3754 .Fl e
3755 options are specified, the provided target snapshot name is used exactly as
3756 provided.
3757 .Pp
3758 The
3759 .Fl d
3760 and
3761 .Fl e
3762 options cause the file system name of the target snapshot to be determined by
3763 appending a portion of the sent snapshot's name to the specified target
3764 .Ar filesystem .
3765 If the
3766 .Fl d
3767 option is specified, all but the first element of the sent snapshot's file
3768 system path
3769 .Pq usually the pool name
3770 is used and any required intermediate file systems within the specified one are
3771 created.
3772 If the
3773 .Fl e
3774 option is specified, then only the last element of the sent snapshot's file
3775 system name
3776 .Pq i.e. the name of the source file system itself
3777 is used as the target file system name.
3778 .Bl -tag -width "-F"
3779 .It Fl F
3780 Force a rollback of the file system to the most recent snapshot before
3781 performing the receive operation.
3782 If receiving an incremental replication stream
3783 .Po for example, one generated by
3784 .Nm zfs Cm send Fl R Op Fl i Ns | Ns Fl I
3785 .Pc ,
3786 destroy snapshots and file systems that do not exist on the sending side.
3787 .It Fl d
3788 Discard the first element of the sent snapshot's file system name, using the
3789 remaining elements to determine the name of the target file system for the new
3790 snapshot as described in the paragraph above.
3791 .It Fl e
3792 Discard all but the last element of the sent snapshot's file system name, using
3793 that element to determine the name of the target file system for the new
3794 snapshot as described in the paragraph above.
3795 .It Fl n
3796 Do not actually receive the stream.
3797 This can be useful in conjunction with the
3798 .Fl v
3799 option to verify the name the receive operation would use.
3800 .It Fl o Sy origin Ns = Ns Ar snapshot
3801 Forces the stream to be received as a clone of the given snapshot.
3802 If the stream is a full send stream, this will create the filesystem
3803 described by the stream as a clone of the specified snapshot.
3804 Which snapshot was specified will not affect the success or failure of the
3805 receive, as long as the snapshot does exist.
3806 If the stream is an incremental send stream, all the normal verification will be
3807 performed.
3808 .It Fl o Em property Ns = Ns Ar value
3809 Sets the specified property as if the command
3810 .Nm zfs Cm set Em property Ns = Ns Ar value
3811 was invoked immediately before the receive. When receiving a stream from
3812 .Nm zfs Cm send Fl R ,
3813 causes the property to be inherited by all descendant datasets, as through
3814 .Nm zfs Cm inherit Em property
3815 was run on any descendant datasets that have this property set on the
3816 sending system.
3817 .Pp
3818 Any editable property can be set at receive time. Set-once properties bound
3819 to the received data, such as
3820 .Sy normalization
3821 and
3822 .Sy casesensitivity ,
3823 cannot be set at receive time even when the datasets are newly created by
3824 .Nm zfs Cm receive .
3825 Additionally both settable properties
3826 .Sy version
3827 and
3828 .Sy volsize
3829 cannot be set at receive time.
3830 .Pp
3831 The
3832 .Fl o
3833 option may be specified multiple times, for different properties. An error
3834 results if the same property is specified in multiple
3835 .Fl o
3836 or
3837 .Fl x
3838 options.
3839 .It Fl s
3840 If the receive is interrupted, save the partially received state, rather
3841 than deleting it.
3842 Interruption may be due to premature termination of the stream
3843 .Po e.g. due to network failure or failure of the remote system
3844 if the stream is being read over a network connection
3845 .Pc ,
3846 a checksum error in the stream, termination of the
3847 .Nm zfs Cm receive
3848 process, or unclean shutdown of the system.
3849 .Pp
3850 The receive can be resumed with a stream generated by
3851 .Nm zfs Cm send Fl t Ar token ,
3852 where the
3853 .Ar token
3854 is the value of the
3855 .Sy receive_resume_token
3856 property of the filesystem or volume which is received into.
3857 .Pp
3858 To use this flag, the storage pool must have the
3859 .Sy extensible_dataset
3860 feature enabled.
3861 See
3862 .Xr zpool-features 5
3863 for details on ZFS feature flags.
3864 .It Fl u
3865 File system that is associated with the received stream is not mounted.
3866 .It Fl v
3867 Print verbose information about the stream and the time required to perform the
3868 receive operation.
3869 .It Fl x Em property
3870 Ensures that the effective value of the specified property after the
3871 receive is unaffected by the value of that property in the send stream (if any),
3872 as if the property had been excluded from the send stream.
3873 .Pp
3874 If the specified property is not present in the send stream, this option does
3875 nothing.
3876 .Pp
3877 If a received property needs to be overridden, the effective value will be
3878 set or inherited, depending on whether the property is inheritable or not.
3879 .Pp
3880 In the case of an incremental update,
3881 .Fl x
3882 leaves any existing local setting or explicit inheritance unchanged.
3883 .Pp
3884 All
3885 .Fl o
3886 restrictions on set-once and special properties apply equally to
3887 .Fl x .
3888 .El
3889 .It Xo
3890 .Nm
3891 .Cm receive
3892 .Fl A
3893 .Ar filesystem Ns | Ns Ar volume
3894 .Xc
3895 Abort an interrupted
3896 .Nm zfs Cm receive Fl s ,
3897 deleting its saved partially received state.
3898 .It Xo
3899 .Nm
3900 .Cm allow
3901 .Ar filesystem Ns | Ns Ar volume
3902 .Xc
3903 Displays permissions that have been delegated on the specified filesystem or
3904 volume.
3905 See the other forms of
3906 .Nm zfs Cm allow
3907 for more information.
3908 .Pp
3909 Delegations are supported under Linux with the exception of
3910 .Sy mount ,
3911 .Sy unmount ,
3912 .Sy mountpoint ,
3913 .Sy canmount ,
3914 .Sy rename ,
3915 and
3916 .Sy share .
3917 These permissions cannot be delegated because the Linux
3918 .Xr mount 8
3919 command restricts modifications of the global namespace to the root user.
3920 .It Xo
3921 .Nm
3922 .Cm allow
3923 .Op Fl dglu
3924 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3925 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3926 .Ar setname Oc Ns ...
3927 .Ar filesystem Ns | Ns Ar volume
3928 .br
3929 .Nm
3930 .Cm allow
3931 .Op Fl dl
3932 .Fl e Ns | Ns Sy everyone
3933 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3934 .Ar setname Oc Ns ...
3935 .Ar filesystem Ns | Ns Ar volume
3936 .Xc
3937 Delegates ZFS administration permission for the file systems to non-privileged
3938 users.
3939 .Bl -tag -width "-d"
3940 .It Fl d
3941 Allow only for the descendent file systems.
3942 .It Fl e Ns | Ns Sy everyone
3943 Specifies that the permissions be delegated to everyone.
3944 .It Fl g Ar group Ns Oo , Ns Ar group Oc Ns ...
3945 Explicitly specify that permissions are delegated to the group.
3946 .It Fl l
3947 Allow
3948 .Qq locally
3949 only for the specified file system.
3950 .It Fl u Ar user Ns Oo , Ns Ar user Oc Ns ...
3951 Explicitly specify that permissions are delegated to the user.
3952 .It Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
3953 Specifies to whom the permissions are delegated.
3954 Multiple entities can be specified as a comma-separated list.
3955 If neither of the
3956 .Fl gu
3957 options are specified, then the argument is interpreted preferentially as the
3958 keyword
3959 .Sy everyone ,
3960 then as a user name, and lastly as a group name.
3961 To specify a user or group named
3962 .Qq everyone ,
3963 use the
3964 .Fl g
3965 or
3966 .Fl u
3967 options.
3968 To specify a group with the same name as a user, use the
3969 .Fl g
3970 options.
3971 .It Xo
3972 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
3973 .Ar setname Oc Ns ...
3974 .Xc
3975 The permissions to delegate.
3976 Multiple permissions may be specified as a comma-separated list.
3977 Permission names are the same as ZFS subcommand and property names.
3978 See the property list below.
3979 Property set names, which begin with
3980 .Sy @ ,
3981 may be specified.
3982 See the
3983 .Fl s
3984 form below for details.
3985 .El
3986 .Pp
3987 If neither of the
3988 .Fl dl
3989 options are specified, or both are, then the permissions are allowed for the
3990 file system or volume, and all of its descendents.
3991 .Pp
3992 Permissions are generally the ability to use a ZFS subcommand or change a ZFS
3993 property.
3994 The following permissions are available:
3995 .Bd -literal
3996 NAME             TYPE           NOTES
3997 allow            subcommand     Must also have the permission that is
3998                                 being allowed
3999 clone            subcommand     Must also have the 'create' ability and
4000                                 'mount' ability in the origin file system
4001 create           subcommand     Must also have the 'mount' ability
4002 destroy          subcommand     Must also have the 'mount' ability
4003 diff             subcommand     Allows lookup of paths within a dataset
4004                                 given an object number, and the ability
4005                                 to create snapshots necessary to
4006                                 'zfs diff'.
4007 load-key         subcommand     Allows loading and unloading of encryption key
4008                                 (see 'zfs load-key' and 'zfs unload-key').
4009 change-key       subcommand     Allows changing an encryption key via
4010                                 'zfs change-key'.
4011 mount            subcommand     Allows mount/umount of ZFS datasets
4012 promote          subcommand     Must also have the 'mount' and 'promote'
4013                                 ability in the origin file system
4014 receive          subcommand     Must also have the 'mount' and 'create'
4015                                 ability
4016 rename           subcommand     Must also have the 'mount' and 'create'
4017                                 ability in the new parent
4018 rollback         subcommand     Must also have the 'mount' ability
4019 send             subcommand
4020 share            subcommand     Allows sharing file systems over NFS
4021                                 or SMB protocols
4022 snapshot         subcommand     Must also have the 'mount' ability
4023
4024 groupquota       other          Allows accessing any groupquota@...
4025                                 property
4026 groupused        other          Allows reading any groupused@... property
4027 userprop         other          Allows changing any user property
4028 userquota        other          Allows accessing any userquota@...
4029                                 property
4030 userused         other          Allows reading any userused@... property
4031 projectobjquota  other          Allows accessing any projectobjquota@...
4032                                 property
4033 projectquota     other          Allows accessing any projectquota@... property
4034 projectobjused   other          Allows reading any projectobjused@... property
4035 projectused      other          Allows reading any projectused@... property
4036
4037 aclinherit       property
4038 acltype          property
4039 atime            property
4040 canmount         property
4041 casesensitivity  property
4042 checksum         property
4043 compression      property
4044 copies           property
4045 devices          property
4046 exec             property
4047 filesystem_limit property
4048 mountpoint       property
4049 nbmand           property
4050 normalization    property
4051 primarycache     property
4052 quota            property
4053 readonly         property
4054 recordsize       property
4055 refquota         property
4056 refreservation   property
4057 reservation      property
4058 secondarycache   property
4059 setuid           property
4060 sharenfs         property
4061 sharesmb         property
4062 snapdir          property
4063 snapshot_limit   property
4064 utf8only         property
4065 version          property
4066 volblocksize     property
4067 volsize          property
4068 vscan            property
4069 xattr            property
4070 zoned            property
4071 .Ed
4072 .It Xo
4073 .Nm
4074 .Cm allow
4075 .Fl c
4076 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4077 .Ar setname Oc Ns ...
4078 .Ar filesystem Ns | Ns Ar volume
4079 .Xc
4080 Sets
4081 .Qq create time
4082 permissions.
4083 These permissions are granted
4084 .Pq locally
4085 to the creator of any newly-created descendent file system.
4086 .It Xo
4087 .Nm
4088 .Cm allow
4089 .Fl s No @ Ns Ar setname
4090 .Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4091 .Ar setname Oc Ns ...
4092 .Ar filesystem Ns | Ns Ar volume
4093 .Xc
4094 Defines or adds permissions to a permission set.
4095 The set can be used by other
4096 .Nm zfs Cm allow
4097 commands for the specified file system and its descendents.
4098 Sets are evaluated dynamically, so changes to a set are immediately reflected.
4099 Permission sets follow the same naming restrictions as ZFS file systems, but the
4100 name must begin with
4101 .Sy @ ,
4102 and can be no more than 64 characters long.
4103 .It Xo
4104 .Nm
4105 .Cm unallow
4106 .Op Fl dglru
4107 .Ar user Ns | Ns Ar group Ns Oo , Ns Ar user Ns | Ns Ar group Oc Ns ...
4108 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4109 .Ar setname Oc Ns ... Oc
4110 .Ar filesystem Ns | Ns Ar volume
4111 .br
4112 .Nm
4113 .Cm unallow
4114 .Op Fl dlr
4115 .Fl e Ns | Ns Sy everyone
4116 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4117 .Ar setname Oc Ns ... Oc
4118 .Ar filesystem Ns | Ns Ar volume
4119 .br
4120 .Nm
4121 .Cm unallow
4122 .Op Fl r
4123 .Fl c
4124 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4125 .Ar setname Oc Ns ... Oc
4126 .Ar filesystem Ns | Ns Ar volume
4127 .Xc
4128 Removes permissions that were granted with the
4129 .Nm zfs Cm allow
4130 command.
4131 No permissions are explicitly denied, so other permissions granted are still in
4132 effect.
4133 For example, if the permission is granted by an ancestor.
4134 If no permissions are specified, then all permissions for the specified
4135 .Ar user ,
4136 .Ar group ,
4137 or
4138 .Sy everyone
4139 are removed.
4140 Specifying
4141 .Sy everyone
4142 .Po or using the
4143 .Fl e
4144 option
4145 .Pc
4146 only removes the permissions that were granted to everyone, not all permissions
4147 for every user and group.
4148 See the
4149 .Nm zfs Cm allow
4150 command for a description of the
4151 .Fl ldugec
4152 options.
4153 .Bl -tag -width "-r"
4154 .It Fl r
4155 Recursively remove the permissions from this file system and all descendents.
4156 .El
4157 .It Xo
4158 .Nm
4159 .Cm unallow
4160 .Op Fl r
4161 .Fl s No @ Ns Ar setname
4162 .Oo Ar perm Ns | Ns @ Ns Ar setname Ns Oo , Ns Ar perm Ns | Ns @ Ns
4163 .Ar setname Oc Ns ... Oc
4164 .Ar filesystem Ns | Ns Ar volume
4165 .Xc
4166 Removes permissions from a permission set.
4167 If no permissions are specified, then all permissions are removed, thus removing
4168 the set entirely.
4169 .It Xo
4170 .Nm
4171 .Cm hold
4172 .Op Fl r
4173 .Ar tag Ar snapshot Ns ...
4174 .Xc
4175 Adds a single reference, named with the
4176 .Ar tag
4177 argument, to the specified snapshot or snapshots.
4178 Each snapshot has its own tag namespace, and tags must be unique within that
4179 space.
4180 .Pp
4181 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4182 .Nm zfs Cm destroy
4183 command return
4184 .Er EBUSY .
4185 .Bl -tag -width "-r"
4186 .It Fl r
4187 Specifies that a hold with the given tag is applied recursively to the snapshots
4188 of all descendent file systems.
4189 .El
4190 .It Xo
4191 .Nm
4192 .Cm holds
4193 .Op Fl r
4194 .Ar snapshot Ns ...
4195 .Xc
4196 Lists all existing user references for the given snapshot or snapshots.
4197 .Bl -tag -width "-r"
4198 .It Fl r
4199 Lists the holds that are set on the named descendent snapshots, in addition to
4200 listing the holds on the named snapshot.
4201 .El
4202 .It Xo
4203 .Nm
4204 .Cm release
4205 .Op Fl r
4206 .Ar tag Ar snapshot Ns ...
4207 .Xc
4208 Removes a single reference, named with the
4209 .Ar tag
4210 argument, from the specified snapshot or snapshots.
4211 The tag must already exist for each snapshot.
4212 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
4213 .Nm zfs Cm destroy
4214 command return
4215 .Er EBUSY .
4216 .Bl -tag -width "-r"
4217 .It Fl r
4218 Recursively releases a hold with the given tag on the snapshots of all
4219 descendent file systems.
4220 .El
4221 .It Xo
4222 .Nm
4223 .Cm diff
4224 .Op Fl FHt
4225 .Ar snapshot Ar snapshot Ns | Ns Ar filesystem
4226 .Xc
4227 Display the difference between a snapshot of a given filesystem and another
4228 snapshot of that filesystem from a later time or the current contents of the
4229 filesystem.
4230 The first column is a character indicating the type of change, the other columns
4231 indicate pathname, new pathname
4232 .Pq in case of rename ,
4233 change in link count, and optionally file type and/or change time.
4234 The types of change are:
4235 .Bd -literal
4236 -       The path has been removed
4237 +       The path has been created
4238 M       The path has been modified
4239 R       The path has been renamed
4240 .Ed
4241 .Bl -tag -width "-F"
4242 .It Fl F
4243 Display an indication of the type of file, in a manner similar to the
4244 .Fl
4245 option of
4246 .Xr ls 1 .
4247 .Bd -literal
4248 B       Block device
4249 C       Character device
4250 /       Directory
4251 >       Door
4252 |       Named pipe
4253 @       Symbolic link
4254 P       Event port
4255 =       Socket
4256 F       Regular file
4257 .Ed
4258 .It Fl H
4259 Give more parsable tab-separated output, without header lines and without
4260 arrows.
4261 .It Fl t
4262 Display the path's inode change time as the first column of output.
4263 .El
4264 .It Xo
4265 .Nm
4266 .Cm program
4267 .Op Fl n
4268 .Op Fl t Ar timeout
4269 .Op Fl m Ar memory_limit
4270 .Ar pool script
4271 .Op Ar arg1 No ...
4272 .Xc
4273 Executes
4274 .Ar script
4275 as a ZFS channel program on
4276 .Ar pool .
4277 The ZFS channel
4278 program interface allows ZFS administrative operations to be run
4279 programmatically via a Lua script.
4280 The entire script is executed atomically, with no other administrative
4281 operations taking effect concurrently.
4282 A library of ZFS calls is made available to channel program scripts.
4283 Channel programs may only be run with root privileges.
4284 .sp
4285 For full documentation of the ZFS channel program interface, see the manual
4286 page for
4287 .Xr zfs-program 8 .
4288 .Bl -tag -width ""
4289 .It Fl n
4290 Executes a read-only channel program, which runs faster.
4291 The program cannot change on-disk state by calling functions from
4292 the zfs.sync submodule.
4293 The program can be used to gather information such as properties and
4294 determining if changes would succeed (zfs.check.*).
4295 Without this flag, all pending changes must be synced to disk before
4296 a channel program can complete.
4297 .It Fl t Ar timeout
4298 Execution time limit, in milliseconds.
4299 If a channel program executes for longer than the provided timeout, it will
4300 be stopped and an error will be returned.
4301 The default timeout is 1000 ms, and can be set to a maximum of 10000 ms.
4302 .It Fl m Ar memory-limit
4303 Memory limit, in bytes.
4304 If a channel program attempts to allocate more memory than the given limit,
4305 it will be stopped and an error returned.
4306 The default memory limit is 10 MB, and can be set to a maximum of 100 MB.
4307 .sp
4308 All remaining argument strings are passed directly to the channel program as
4309 arguments.
4310 See
4311 .Xr zfs-program 8
4312 for more information.
4313 .El
4314 .It Xo
4315 .Nm
4316 .Cm load-key
4317 .Op Fl nr
4318 .Op Fl L Ar keylocation
4319 .Fl a | Ar filesystem
4320 .Xc
4321 Load the key for
4322 .Ar filesystem ,
4323 allowing it and all children that inherit the
4324 .Sy keylocation
4325 property to be accessed. The key will be expected in the format specified by the
4326 .Sy keyformat
4327 and location specified by the
4328 .Sy keylocation
4329 property. Note that if the
4330 .Sy keylocation
4331 is set to
4332 .Sy prompt
4333 the terminal will interactively wait for the key to be entered. Loading a key
4334 will not automatically mount the dataset. If that functionality is desired,
4335 .Nm zfs Cm mount Sy -l
4336 will ask for the key and mount the dataset. Once the key is loaded the
4337 .Sy keystatus
4338 property will become
4339 .Sy available .
4340 .Bl -tag -width "-r"
4341 .It Fl r
4342 Recursively loads the keys for the specified filesystem and all descendent
4343 encryption roots.
4344 .It Fl a
4345 Loads the keys for all encryption roots in all imported pools.
4346 .It Fl n
4347 Do a dry-run
4348 .Pq Qq No-op
4349 load-key. This will cause zfs to simply check that the
4350 provided key is correct. This command may be run even if the key is already
4351 loaded.
4352 .It Fl L Ar keylocation
4353 Use
4354 .Ar keylocation
4355 instead of the
4356 .Sy keylocation
4357 property. This will not change the value of the property on the dataset. Note
4358 that if used with either
4359 .Fl r
4360 or
4361 .Fl a ,
4362 .Ar keylocation
4363 may only be given as
4364 .Sy prompt .
4365 .El
4366 .It Xo
4367 .Nm
4368 .Cm unload-key
4369 .Op Fl r
4370 .Fl a | Ar filesystem
4371 .Xc
4372 Unloads a key from ZFS, removing the ability to access the dataset and all of
4373 its children that inherit the
4374 .Sy keylocation
4375 property. This requires that the dataset is not currently open or mounted. Once
4376 the key is unloaded the
4377 .Sy keystatus
4378 property will become
4379 .Sy unavailable .
4380 .Bl -tag -width "-r"
4381 .It Fl r
4382 Recursively unloads the keys for the specified filesystem and all descendent
4383 encryption roots.
4384 .It Fl a
4385 Unloads the keys for all encryption roots in all imported pools.
4386 .El
4387 .It Xo
4388 .Nm
4389 .Cm change-key
4390 .Op Fl l
4391 .Op Fl o Ar keylocation Ns = Ns Ar value
4392 .Op Fl o Ar keyformat Ns = Ns Ar value
4393 .Op Fl o Ar pbkdf2iters Ns = Ns Ar value
4394 .Ar filesystem
4395 .Xc
4396 .It Xo
4397 .Nm
4398 .Cm change-key
4399 .Fl i
4400 .Op Fl l
4401 .Ar filesystem
4402 .Xc
4403 Allows a user to change the encryption key used to access a dataset. This
4404 command requires that the existing key for the dataset is already loaded into
4405 ZFS. This command may also be used to change the
4406 .Sy keylocation ,
4407 .Sy keyformat ,
4408 and
4409 .Sy pbkdf2iters
4410 properties as needed. If the dataset was not previously an encryption root it
4411 will become one. Alternatively, the
4412 .Fl i
4413 flag may be provided to cause an encryption root to inherit the parent's key
4414 instead.
4415 .Bl -tag -width "-r"
4416 .It Fl l
4417 Ensures the key is loaded before attempting to change the key. This is
4418 effectively equivalent to
4419 .Qq Nm zfs Cm load-key Ar filesystem ; Nm zfs Cm change-key Ar filesystem
4420 .It Fl o Ar property Ns = Ns Ar value
4421 Allows the user to set encryption key properties (
4422 .Sy keyformat ,
4423 .Sy keylocation ,
4424 and
4425 .Sy pbkdf2iters
4426 ) while changing the key. This is the only way to alter
4427 .Sy keyformat
4428 and
4429 .Sy pbkdf2iters
4430 after the dataset has been created.
4431 .It Fl i
4432 Indicates that zfs should make
4433 .Ar filesystem
4434 inherit the key of its parent. Note that this command can only be run on an
4435 encryption root that has an encrypted parent.
4436 .El
4437 .El
4438 .Sh EXIT STATUS
4439 The
4440 .Nm
4441 utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
4442 options were specified.
4443 .Sh EXAMPLES
4444 .Bl -tag -width ""
4445 .It Sy Example 1 No Creating a ZFS File System Hierarchy
4446 The following commands create a file system named
4447 .Em pool/home
4448 and a file system named
4449 .Em pool/home/bob .
4450 The mount point
4451 .Pa /export/home
4452 is set for the parent file system, and is automatically inherited by the child
4453 file system.
4454 .Bd -literal
4455 # zfs create pool/home
4456 # zfs set mountpoint=/export/home pool/home
4457 # zfs create pool/home/bob
4458 .Ed
4459 .It Sy Example 2 No Creating a ZFS Snapshot
4460 The following command creates a snapshot named
4461 .Sy yesterday .
4462 This snapshot is mounted on demand in the
4463 .Pa .zfs/snapshot
4464 directory at the root of the
4465 .Em pool/home/bob
4466 file system.
4467 .Bd -literal
4468 # zfs snapshot pool/home/bob@yesterday
4469 .Ed
4470 .It Sy Example 3 No Creating and Destroying Multiple Snapshots
4471 The following command creates snapshots named
4472 .Sy yesterday
4473 of
4474 .Em pool/home
4475 and all of its descendent file systems.
4476 Each snapshot is mounted on demand in the
4477 .Pa .zfs/snapshot
4478 directory at the root of its file system.
4479 The second command destroys the newly created snapshots.
4480 .Bd -literal
4481 # zfs snapshot -r pool/home@yesterday
4482 # zfs destroy -r pool/home@yesterday
4483 .Ed
4484 .It Sy Example 4 No Disabling and Enabling File System Compression
4485 The following command disables the
4486 .Sy compression
4487 property for all file systems under
4488 .Em pool/home .
4489 The next command explicitly enables
4490 .Sy compression
4491 for
4492 .Em pool/home/anne .
4493 .Bd -literal
4494 # zfs set compression=off pool/home
4495 # zfs set compression=on pool/home/anne
4496 .Ed
4497 .It Sy Example 5 No Listing ZFS Datasets
4498 The following command lists all active file systems and volumes in the system.
4499 Snapshots are displayed if the
4500 .Sy listsnaps
4501 property is
4502 .Sy on .
4503 The default is
4504 .Sy off .
4505 See
4506 .Xr zpool 8
4507 for more information on pool properties.
4508 .Bd -literal
4509 # zfs list
4510 NAME                      USED  AVAIL  REFER  MOUNTPOINT
4511 pool                      450K   457G    18K  /pool
4512 pool/home                 315K   457G    21K  /export/home
4513 pool/home/anne             18K   457G    18K  /export/home/anne
4514 pool/home/bob             276K   457G   276K  /export/home/bob
4515 .Ed
4516 .It Sy Example 6 No Setting a Quota on a ZFS File System
4517 The following command sets a quota of 50 Gbytes for
4518 .Em pool/home/bob .
4519 .Bd -literal
4520 # zfs set quota=50G pool/home/bob
4521 .Ed
4522 .It Sy Example 7 No Listing ZFS Properties
4523 The following command lists all properties for
4524 .Em pool/home/bob .
4525 .Bd -literal
4526 # zfs get all pool/home/bob
4527 NAME           PROPERTY              VALUE                  SOURCE
4528 pool/home/bob  type                  filesystem             -
4529 pool/home/bob  creation              Tue Jul 21 15:53 2009  -
4530 pool/home/bob  used                  21K                    -
4531 pool/home/bob  available             20.0G                  -
4532 pool/home/bob  referenced            21K                    -
4533 pool/home/bob  compressratio         1.00x                  -
4534 pool/home/bob  mounted               yes                    -
4535 pool/home/bob  quota                 20G                    local
4536 pool/home/bob  reservation           none                   default
4537 pool/home/bob  recordsize            128K                   default
4538 pool/home/bob  mountpoint            /pool/home/bob         default
4539 pool/home/bob  sharenfs              off                    default
4540 pool/home/bob  checksum              on                     default
4541 pool/home/bob  compression           on                     local
4542 pool/home/bob  atime                 on                     default
4543 pool/home/bob  devices               on                     default
4544 pool/home/bob  exec                  on                     default
4545 pool/home/bob  setuid                on                     default
4546 pool/home/bob  readonly              off                    default
4547 pool/home/bob  zoned                 off                    default
4548 pool/home/bob  snapdir               hidden                 default
4549 pool/home/bob  acltype               off                    default
4550 pool/home/bob  aclinherit            restricted             default
4551 pool/home/bob  canmount              on                     default
4552 pool/home/bob  xattr                 on                     default
4553 pool/home/bob  copies                1                      default
4554 pool/home/bob  version               4                      -
4555 pool/home/bob  utf8only              off                    -
4556 pool/home/bob  normalization         none                   -
4557 pool/home/bob  casesensitivity       sensitive              -
4558 pool/home/bob  vscan                 off                    default
4559 pool/home/bob  nbmand                off                    default
4560 pool/home/bob  sharesmb              off                    default
4561 pool/home/bob  refquota              none                   default
4562 pool/home/bob  refreservation        none                   default
4563 pool/home/bob  primarycache          all                    default
4564 pool/home/bob  secondarycache        all                    default
4565 pool/home/bob  usedbysnapshots       0                      -
4566 pool/home/bob  usedbydataset         21K                    -
4567 pool/home/bob  usedbychildren        0                      -
4568 pool/home/bob  usedbyrefreservation  0                      -
4569 .Ed
4570 .Pp
4571 The following command gets a single property value.
4572 .Bd -literal
4573 # zfs get -H -o value compression pool/home/bob
4574 on
4575 .Ed
4576 The following command lists all properties with local settings for
4577 .Em pool/home/bob .
4578 .Bd -literal
4579 # zfs get -r -s local -o name,property,value all pool/home/bob
4580 NAME           PROPERTY              VALUE
4581 pool/home/bob  quota                 20G
4582 pool/home/bob  compression           on
4583 .Ed
4584 .It Sy Example 8 No Rolling Back a ZFS File System
4585 The following command reverts the contents of
4586 .Em pool/home/anne
4587 to the snapshot named
4588 .Sy yesterday ,
4589 deleting all intermediate snapshots.
4590 .Bd -literal
4591 # zfs rollback -r pool/home/anne@yesterday
4592 .Ed
4593 .It Sy Example 9 No Creating a ZFS Clone
4594 The following command creates a writable file system whose initial contents are
4595 the same as
4596 .Em pool/home/bob@yesterday .
4597 .Bd -literal
4598 # zfs clone pool/home/bob@yesterday pool/clone
4599 .Ed
4600 .It Sy Example 10 No Promoting a ZFS Clone
4601 The following commands illustrate how to test out changes to a file system, and
4602 then replace the original file system with the changed one, using clones, clone
4603 promotion, and renaming:
4604 .Bd -literal
4605 # zfs create pool/project/production
4606   populate /pool/project/production with data
4607 # zfs snapshot pool/project/production@today
4608 # zfs clone pool/project/production@today pool/project/beta
4609   make changes to /pool/project/beta and test them
4610 # zfs promote pool/project/beta
4611 # zfs rename pool/project/production pool/project/legacy
4612 # zfs rename pool/project/beta pool/project/production
4613   once the legacy version is no longer needed, it can be destroyed
4614 # zfs destroy pool/project/legacy
4615 .Ed
4616 .It Sy Example 11 No Inheriting ZFS Properties
4617 The following command causes
4618 .Em pool/home/bob
4619 and
4620 .Em pool/home/anne
4621 to inherit the
4622 .Sy checksum
4623 property from their parent.
4624 .Bd -literal
4625 # zfs inherit checksum pool/home/bob pool/home/anne
4626 .Ed
4627 .It Sy Example 12 No Remotely Replicating ZFS Data
4628 The following commands send a full stream and then an incremental stream to a
4629 remote machine, restoring them into
4630 .Em poolB/received/fs@a
4631 and
4632 .Em poolB/received/fs@b ,
4633 respectively.
4634 .Em poolB
4635 must contain the file system
4636 .Em poolB/received ,
4637 and must not initially contain
4638 .Em poolB/received/fs .
4639 .Bd -literal
4640 # zfs send pool/fs@a | \e
4641   ssh host zfs receive poolB/received/fs@a
4642 # zfs send -i a pool/fs@b | \e
4643   ssh host zfs receive poolB/received/fs
4644 .Ed
4645 .It Sy Example 13 No Using the zfs receive -d Option
4646 The following command sends a full stream of
4647 .Em poolA/fsA/fsB@snap
4648 to a remote machine, receiving it into
4649 .Em poolB/received/fsA/fsB@snap .
4650 The
4651 .Em fsA/fsB@snap
4652 portion of the received snapshot's name is determined from the name of the sent
4653 snapshot.
4654 .Em poolB
4655 must contain the file system
4656 .Em poolB/received .
4657 If
4658 .Em poolB/received/fsA
4659 does not exist, it is created as an empty file system.
4660 .Bd -literal
4661 # zfs send poolA/fsA/fsB@snap | \e
4662   ssh host zfs receive -d poolB/received
4663 .Ed
4664 .It Sy Example 14 No Setting User Properties
4665 The following example sets the user-defined
4666 .Sy com.example:department
4667 property for a dataset.
4668 .Bd -literal
4669 # zfs set com.example:department=12345 tank/accounting
4670 .Ed
4671 .It Sy Example 15 No Performing a Rolling Snapshot
4672 The following example shows how to maintain a history of snapshots with a
4673 consistent naming scheme.
4674 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
4675 renames the remaining snapshots, and then creates a new snapshot, as follows:
4676 .Bd -literal
4677 # zfs destroy -r pool/users@7daysago
4678 # zfs rename -r pool/users@6daysago @7daysago
4679 # zfs rename -r pool/users@5daysago @6daysago
4680 # zfs rename -r pool/users@yesterday @5daysago
4681 # zfs rename -r pool/users@yesterday @4daysago
4682 # zfs rename -r pool/users@yesterday @3daysago
4683 # zfs rename -r pool/users@yesterday @2daysago
4684 # zfs rename -r pool/users@today @yesterday
4685 # zfs snapshot -r pool/users@today
4686 .Ed
4687 .It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
4688 The following commands show how to set
4689 .Sy sharenfs
4690 property options to enable
4691 .Sy rw
4692 access for a set of
4693 .Sy IP
4694 addresses and to enable root access for system
4695 .Sy neo
4696 on the
4697 .Em tank/home
4698 file system.
4699 .Bd -literal
4700 # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
4701 .Ed
4702 .Pp
4703 If you are using
4704 .Sy DNS
4705 for host name resolution, specify the fully qualified hostname.
4706 .It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
4707 The following example shows how to set permissions so that user
4708 .Sy cindys
4709 can create, destroy, mount, and take snapshots on
4710 .Em tank/cindys .
4711 The permissions on
4712 .Em tank/cindys
4713 are also displayed.
4714 .Bd -literal
4715 # zfs allow cindys create,destroy,mount,snapshot tank/cindys
4716 # zfs allow tank/cindys
4717 ---- Permissions on tank/cindys --------------------------------------
4718 Local+Descendent permissions:
4719         user cindys create,destroy,mount,snapshot
4720 .Ed
4721 .Pp
4722 Because the
4723 .Em tank/cindys
4724 mount point permission is set to 755 by default, user
4725 .Sy cindys
4726 will be unable to mount file systems under
4727 .Em tank/cindys .
4728 Add an ACE similar to the following syntax to provide mount point access:
4729 .Bd -literal
4730 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
4731 .Ed
4732 .It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
4733 The following example shows how to grant anyone in the group
4734 .Sy staff
4735 to create file systems in
4736 .Em tank/users .
4737 This syntax also allows staff members to destroy their own file systems, but not
4738 destroy anyone else's file system.
4739 The permissions on
4740 .Em tank/users
4741 are also displayed.
4742 .Bd -literal
4743 # zfs allow staff create,mount tank/users
4744 # zfs allow -c destroy tank/users
4745 # zfs allow tank/users
4746 ---- Permissions on tank/users ---------------------------------------
4747 Permission sets:
4748         destroy
4749 Local+Descendent permissions:
4750         group staff create,mount
4751 .Ed
4752 .It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
4753 The following example shows how to define and grant a permission set on the
4754 .Em tank/users
4755 file system.
4756 The permissions on
4757 .Em tank/users
4758 are also displayed.
4759 .Bd -literal
4760 # zfs allow -s @pset create,destroy,snapshot,mount tank/users
4761 # zfs allow staff @pset tank/users
4762 # zfs allow tank/users
4763 ---- Permissions on tank/users ---------------------------------------
4764 Permission sets:
4765         @pset create,destroy,mount,snapshot
4766 Local+Descendent permissions:
4767         group staff @pset
4768 .Ed
4769 .It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
4770 The following example shows to grant the ability to set quotas and reservations
4771 on the
4772 .Em users/home
4773 file system.
4774 The permissions on
4775 .Em users/home
4776 are also displayed.
4777 .Bd -literal
4778 # zfs allow cindys quota,reservation users/home
4779 # zfs allow users/home
4780 ---- Permissions on users/home ---------------------------------------
4781 Local+Descendent permissions:
4782         user cindys quota,reservation
4783 cindys% zfs set quota=10G users/home/marks
4784 cindys% zfs get quota users/home/marks
4785 NAME              PROPERTY  VALUE  SOURCE
4786 users/home/marks  quota     10G    local
4787 .Ed
4788 .It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
4789 The following example shows how to remove the snapshot permission from the
4790 .Sy staff
4791 group on the
4792 .Em tank/users
4793 file system.
4794 The permissions on
4795 .Em tank/users
4796 are also displayed.
4797 .Bd -literal
4798 # zfs unallow staff snapshot tank/users
4799 # zfs allow tank/users
4800 ---- Permissions on tank/users ---------------------------------------
4801 Permission sets:
4802         @pset create,destroy,mount,snapshot
4803 Local+Descendent permissions:
4804         group staff @pset
4805 .Ed
4806 .It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
4807 The following example shows how to see what has changed between a prior
4808 snapshot of a ZFS dataset and its current state.
4809 The
4810 .Fl F
4811 option is used to indicate type information for the files affected.
4812 .Bd -literal
4813 # zfs diff -F tank/test@before tank/test
4814 M       /       /tank/test/
4815 M       F       /tank/test/linked      (+1)
4816 R       F       /tank/test/oldname -> /tank/test/newname
4817 -       F       /tank/test/deleted
4818 +       F       /tank/test/created
4819 M       F       /tank/test/modified
4820 .Ed
4821 .It Sy Example 23 No Creating a bookmark
4822 The following example create a bookmark to a snapshot. This bookmark
4823 can then be used instead of snapshot in send streams.
4824 .Bd -literal
4825 # zfs bookmark rpool@snapshot rpool#bookmark
4826 .Ed
4827 .It Sy Example 24 No Setting sharesmb Property Options on a ZFS File System
4828 The following example show how to share SMB filesystem through ZFS. Note that
4829 that a user and his/her password must be given.
4830 .Bd -literal
4831 # smbmount //127.0.0.1/share_tmp /mnt/tmp \\
4832   -o user=workgroup/turbo,password=obrut,uid=1000
4833 .Ed
4834 .Pp
4835 Minimal
4836 .Em /etc/samba/smb.conf
4837 configuration required:
4838 .Pp
4839 Samba will need to listen to 'localhost' (127.0.0.1) for the ZFS utilities to
4840 communicate with Samba. This is the default behavior for most Linux
4841 distributions.
4842 .Pp
4843 Samba must be able to authenticate a user. This can be done in a number of
4844 ways, depending on if using the system password file, LDAP or the Samba
4845 specific smbpasswd file. How to do this is outside the scope of this manual.
4846 Please refer to the
4847 .Xr smb.conf 5
4848 man page for more information.
4849 .Pp
4850 See the
4851 .Sy USERSHARE section
4852 of the
4853 .Xr smb.conf 5
4854 man page for all configuration options in case you need to modify any options
4855 to the share afterwards. Do note that any changes done with the
4856 .Xr net 8
4857 command will be undone if the share is ever unshared (such as at a reboot etc).
4858 .El
4859 .Sh INTERFACE STABILITY
4860 .Sy Committed .
4861 .Sh SEE ALSO
4862 .Xr attr 1 ,
4863 .Xr gzip 1 ,
4864 .Xr ssh 1 ,
4865 .Xr chmod 2 ,
4866 .Xr fsync 2 ,
4867 .Xr stat 2 ,
4868 .Xr write 2 ,
4869 .Xr acl 5 ,
4870 .Xr attributes 5 ,
4871 .Xr exports 5 ,
4872 .Xr exportfs 8 ,
4873 .Xr mount 8 ,
4874 .Xr net 8 ,
4875 .Xr selinux 8 ,
4876 .Xr zpool 8