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