]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sys/contrib/openzfs/man/man8/zfs.8
ZFS: MFV 2.0-rc1-ga00c61
[FreeBSD/FreeBSD.git] / sys / contrib / openzfs / man / man8 / zfs.8
1 .\"
2 .\" CDDL HEADER START
3 .\"
4 .\" The contents of this file are subject to the terms of the
5 .\" Common Development and Distribution License (the "License").
6 .\" You may not use this file except in compliance with the License.
7 .\"
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 .\" or http://www.opensolaris.org/os/licensing.
10 .\" See the License for the specific language governing permissions
11 .\" and limitations under the License.
12 .\"
13 .\" When distributing Covered Code, include this CDDL HEADER in each
14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 .\" If applicable, add the following below this CDDL HEADER, with the
16 .\" fields enclosed by brackets "[]" replaced with your own identifying
17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
18 .\"
19 .\" CDDL HEADER END
20 .\"
21 .\"
22 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23 .\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24 .\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25 .\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org>
26 .\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org>
27 .\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org>
28 .\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org>
29 .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
30 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
31 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
32 .\" Copyright (c) 2014 Integros [integros.com]
33 .\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org>
34 .\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved.
35 .\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved.
36 .\" Copyright 2019 Richard Laager. All rights reserved.
37 .\" Copyright 2018 Nexenta Systems, Inc.
38 .\" Copyright 2019 Joyent, Inc.
39 .\"
40 .Dd June 30, 2019
41 .Dt ZFS 8
42 .Os
43 .Sh NAME
44 .Nm zfs
45 .Nd configures ZFS file systems
46 .Sh SYNOPSIS
47 .Nm
48 .Fl ?V
49 .Nm
50 .Cm version
51 .Nm
52 .Cm <subcommand>
53 .Op Ar <args>
54 .Sh DESCRIPTION
55 The
56 .Nm
57 command configures ZFS datasets within a ZFS storage pool, as described in
58 .Xr zpool 8 .
59 A dataset is identified by a unique path within the ZFS namespace.
60 For example:
61 .Bd -literal
62 pool/{filesystem,volume,snapshot}
63 .Ed
64 .Pp
65 where the maximum length of a dataset name is
66 .Dv MAXNAMELEN
67 .Pq 256 bytes
68 and the maximum amount of nesting allowed in a path is 50 levels deep.
69 .Pp
70 A dataset can be one of the following:
71 .Bl -tag -width "file system"
72 .It Sy file system
73 A ZFS dataset of type
74 .Sy filesystem
75 can be mounted within the standard system namespace and behaves like other file
76 systems.
77 While ZFS file systems are designed to be POSIX compliant, known issues exist
78 that prevent compliance in some cases.
79 Applications that depend on standards conformance might fail due to non-standard
80 behavior when checking file system free space.
81 .It Sy volume
82 A logical volume exported as a raw or block device.
83 This type of dataset should only be used when a block device is required.
84 File systems are typically used in most environments.
85 .It Sy snapshot
86 A read-only version of a file system or volume at a given point in time.
87 It is specified as
88 .Ar filesystem Ns @ Ns Ar name
89 or
90 .Ar volume Ns @ Ns Ar name .
91 .It Sy bookmark
92 Much like a
93 .Sy snapshot ,
94 but without the hold on on-disk data.
95 It can be used as the source of a send (but not for a receive). It is specified as
96 .Ar filesystem Ns # Ns Ar name
97 or
98 .Ar volume Ns # Ns Ar name .
99 .El
100 .Pp
101 For details see
102 .Xr zfsconcepts 8 .
103 .Ss Properties
104 Properties are divided into two types, native properties and user-defined
105 .Po or
106 .Qq user
107 .Pc
108 properties.
109 Native properties either export internal statistics or control ZFS behavior.
110 In addition, native properties are either editable or read-only.
111 User properties have no effect on ZFS behavior, but you can use them to annotate
112 datasets in a way that is meaningful in your environment.
113 For more information about properties, see the
114 .Xr zfsprops 8 man page.
115 .Ss Encryption
116 Enabling the
117 .Sy encryption
118 feature allows for the creation of encrypted filesystems and volumes.
119 ZFS will encrypt file and zvol data, file attributes, ACLs, permission bits,
120 directory listings, FUID mappings, and
121 .Sy userused
122 /
123 .Sy groupused
124 data.
125 For an overview of encryption see the
126 .Xr zfs-load-key 8 command manual.
127 .Sh SUBCOMMANDS
128 All subcommands that modify state are logged persistently to the pool in their
129 original form.
130 .Bl -tag -width ""
131 .It Nm Fl ?
132 Displays a help message.
133 .It Xo
134 .Nm
135 .Fl V , -version
136 .Xc
137 An alias for the
138 .Nm zfs Cm version
139 subcommand.
140 .It Xo
141 .Nm
142 .Cm version
143 .Xc
144 Displays the software version of the
145 .Nm
146 userland utility and the zfs kernel module.
147 .El
148 .Ss Dataset Management
149 .Bl -tag -width ""
150 .It Xr zfs-list 8
151 Lists the property information for the given datasets in tabular form.
152 .It Xr zfs-create 8
153 Creates a new ZFS file system or volume.
154 .It Xr zfs-destroy 8
155 Destroys the given dataset(s), snapshot(s), or bookmark.
156 .It Xr zfs-rename 8
157 Renames the given dataset (filesystem or snapshot).
158 .It Xr zfs-upgrade 8
159 Manage upgrading the on-disk version of filesystems.
160 .El
161 .Ss Snapshots
162 .Bl -tag -width ""
163 .It Xr zfs-snapshot 8
164 Creates snapshots with the given names.
165 .It Xr zfs-rollback 8
166 Roll back the given dataset to a previous snapshot.
167 .It Xo
168 .Xr zfs-hold 8 /
169 .Xr zfs-release 8
170 .Xc
171 Add or remove a hold reference to the specified snapshot or snapshots.
172 If a hold exists on a snapshot, attempts to destroy that snapshot by using the
173 .Nm zfs Cm destroy
174 command return
175 .Er EBUSY .
176 .It Xr zfs-diff 8
177 Display the difference between a snapshot of a given filesystem and another
178 snapshot of that filesystem from a later time or the current contents of the
179 filesystem.
180 .El
181 .Ss Clones
182 .Bl -tag -width ""
183 .It Xr zfs-clone 8
184 Creates a clone of the given snapshot.
185 .It Xr zfs-promote 8
186 Promotes a clone file system to no longer be dependent on its
187 .Qq origin
188 snapshot.
189 .El
190 .Ss Send & Receive
191 .Bl -tag -width ""
192 .It Xr zfs-send 8
193 Generate a send stream, which may be of a filesystem, and may be incremental
194 from a bookmark.
195 .It Xr zfs-receive 8
196 Creates a snapshot whose contents are as specified in the stream provided on
197 standard input.
198 If a full stream is received, then a new file system is created as well.
199 Streams are created using the
200 .Xr zfs-send 8
201 subcommand, which by default creates a full stream.
202 .It Xr zfs-bookmark 8
203 Creates a new bookmark of the given snapshot or bookmark.
204 Bookmarks mark the point in time when the snapshot was created, and can be used
205 as the incremental source for a
206 .Nm zfs Cm send
207 command.
208 .It Xr zfs-redact 8
209 Generate a new redaction bookmark.
210 This feature can be used to allow clones of a filesystem to be made available on
211 a remote system, in the case where their parent need not (or needs to not) be
212 usable.
213 .El
214 .Ss Properties
215 .Bl -tag -width ""
216 .It Xr zfs-get 8
217 Displays properties for the given datasets.
218 .It Xr zfs-set 8
219 Sets the property or list of properties to the given value(s) for each dataset.
220 .It Xr zfs-inherit 8
221 Clears the specified property, causing it to be inherited from an ancestor,
222 restored to default if no ancestor has the property set, or with the
223 .Fl S
224 option reverted to the received value if one exists.
225 .El
226 .Ss Quotas
227 .Bl -tag -width ""
228 .It Xo
229 .Xr zfs-userspace 8 /
230 .Xr zfs-groupspace 8 /
231 .Xr zfs-projectspace 8
232 .Xc
233 Displays space consumed by, and quotas on, each user, group, or project
234 in the specified filesystem or snapshot.
235 .It Xr zfs-project 8
236 List, set, or clear project ID and/or inherit flag on the file(s) or directories.
237 .El
238 .Ss Mountpoints
239 .Bl -tag -width ""
240 .It Xr zfs-mount 8
241 Displays all ZFS file systems currently mounted, or mount ZFS filesystem
242 on a path described by its
243 .Sy mountpoint
244 property.
245 .It Xr zfs-unmount 8
246 Unmounts currently mounted ZFS file systems.
247 .El
248 .Ss Shares
249 .Bl -tag -width ""
250 .It Xr zfs-share 8
251 Shares available ZFS file systems.
252 .It Xr zfs-unshare 8
253 Unshares currently shared ZFS file systems.
254 .El
255 .Ss Delegated Administration
256 .Bl -tag -width ""
257 .It Xr zfs-allow 8
258 Delegate permissions on the specified filesystem or volume.
259 .It Xr zfs-unallow 8
260 Remove delegated permissions on the specified filesystem or volume.
261 .El
262 .Ss Encryption
263 .Bl -tag -width ""
264 .It Xr zfs-change-key 8
265 Add or change an encryption key on the specified dataset.
266 .It Xr zfs-load-key 8
267 Load the key for the specified encrypted dataset, enabling access.
268 .It Xr zfs-unload-key 8
269 Unload a key for the specified dataset, removing the ability to access the dataset.
270 .El
271 .Ss Channel Programs
272 .Bl -tag -width ""
273 .It Xr zfs-program 8
274 Execute ZFS administrative operations
275 programmatically via a Lua script-language channel program.
276 .El
277 .Ss Jails
278 .Bl -tag -width ""
279 .It Xr zfs-jail 8
280 Attaches a filesystem to a jail.
281 .It Xr zfs-unjail 8
282 Detaches a filesystem from a jail.
283 .El
284 .Ss Waiting
285 .Bl -tag -width ""
286 .It Xr zfs-wait 8
287 Wait for background activity in a filesystem to complete.
288 .El
289 .Sh EXIT STATUS
290 The
291 .Nm
292 utility exits 0 on success, 1 if an error occurs, and 2 if invalid command line
293 options were specified.
294 .Sh EXAMPLES
295 .Bl -tag -width ""
296 .It Sy Example 1 No Creating a ZFS File System Hierarchy
297 The following commands create a file system named
298 .Em pool/home
299 and a file system named
300 .Em pool/home/bob .
301 The mount point
302 .Pa /export/home
303 is set for the parent file system, and is automatically inherited by the child
304 file system.
305 .Bd -literal
306 # zfs create pool/home
307 # zfs set mountpoint=/export/home pool/home
308 # zfs create pool/home/bob
309 .Ed
310 .It Sy Example 2 No Creating a ZFS Snapshot
311 The following command creates a snapshot named
312 .Sy yesterday .
313 This snapshot is mounted on demand in the
314 .Pa .zfs/snapshot
315 directory at the root of the
316 .Em pool/home/bob
317 file system.
318 .Bd -literal
319 # zfs snapshot pool/home/bob@yesterday
320 .Ed
321 .It Sy Example 3 No Creating and Destroying Multiple Snapshots
322 The following command creates snapshots named
323 .Sy yesterday
324 of
325 .Em pool/home
326 and all of its descendent file systems.
327 Each snapshot is mounted on demand in the
328 .Pa .zfs/snapshot
329 directory at the root of its file system.
330 The second command destroys the newly created snapshots.
331 .Bd -literal
332 # zfs snapshot -r pool/home@yesterday
333 # zfs destroy -r pool/home@yesterday
334 .Ed
335 .It Sy Example 4 No Disabling and Enabling File System Compression
336 The following command disables the
337 .Sy compression
338 property for all file systems under
339 .Em pool/home .
340 The next command explicitly enables
341 .Sy compression
342 for
343 .Em pool/home/anne .
344 .Bd -literal
345 # zfs set compression=off pool/home
346 # zfs set compression=on pool/home/anne
347 .Ed
348 .It Sy Example 5 No Listing ZFS Datasets
349 The following command lists all active file systems and volumes in the system.
350 Snapshots are displayed if the
351 .Sy listsnaps
352 property is
353 .Sy on .
354 The default is
355 .Sy off .
356 See
357 .Xr zpool 8
358 for more information on pool properties.
359 .Bd -literal
360 # zfs list
361 NAME                      USED  AVAIL  REFER  MOUNTPOINT
362 pool                      450K   457G    18K  /pool
363 pool/home                 315K   457G    21K  /export/home
364 pool/home/anne             18K   457G    18K  /export/home/anne
365 pool/home/bob             276K   457G   276K  /export/home/bob
366 .Ed
367 .It Sy Example 6 No Setting a Quota on a ZFS File System
368 The following command sets a quota of 50 Gbytes for
369 .Em pool/home/bob .
370 .Bd -literal
371 # zfs set quota=50G pool/home/bob
372 .Ed
373 .It Sy Example 7 No Listing ZFS Properties
374 The following command lists all properties for
375 .Em pool/home/bob .
376 .Bd -literal
377 # zfs get all pool/home/bob
378 NAME           PROPERTY              VALUE                  SOURCE
379 pool/home/bob  type                  filesystem             -
380 pool/home/bob  creation              Tue Jul 21 15:53 2009  -
381 pool/home/bob  used                  21K                    -
382 pool/home/bob  available             20.0G                  -
383 pool/home/bob  referenced            21K                    -
384 pool/home/bob  compressratio         1.00x                  -
385 pool/home/bob  mounted               yes                    -
386 pool/home/bob  quota                 20G                    local
387 pool/home/bob  reservation           none                   default
388 pool/home/bob  recordsize            128K                   default
389 pool/home/bob  mountpoint            /pool/home/bob         default
390 pool/home/bob  sharenfs              off                    default
391 pool/home/bob  checksum              on                     default
392 pool/home/bob  compression           on                     local
393 pool/home/bob  atime                 on                     default
394 pool/home/bob  devices               on                     default
395 pool/home/bob  exec                  on                     default
396 pool/home/bob  setuid                on                     default
397 pool/home/bob  readonly              off                    default
398 pool/home/bob  zoned                 off                    default
399 pool/home/bob  snapdir               hidden                 default
400 pool/home/bob  acltype               off                    default
401 pool/home/bob  aclmode               discard                default
402 pool/home/bob  aclinherit            restricted             default
403 pool/home/bob  canmount              on                     default
404 pool/home/bob  xattr                 on                     default
405 pool/home/bob  copies                1                      default
406 pool/home/bob  version               4                      -
407 pool/home/bob  utf8only              off                    -
408 pool/home/bob  normalization         none                   -
409 pool/home/bob  casesensitivity       sensitive              -
410 pool/home/bob  vscan                 off                    default
411 pool/home/bob  nbmand                off                    default
412 pool/home/bob  sharesmb              off                    default
413 pool/home/bob  refquota              none                   default
414 pool/home/bob  refreservation        none                   default
415 pool/home/bob  primarycache          all                    default
416 pool/home/bob  secondarycache        all                    default
417 pool/home/bob  usedbysnapshots       0                      -
418 pool/home/bob  usedbydataset         21K                    -
419 pool/home/bob  usedbychildren        0                      -
420 pool/home/bob  usedbyrefreservation  0                      -
421 .Ed
422 .Pp
423 The following command gets a single property value.
424 .Bd -literal
425 # zfs get -H -o value compression pool/home/bob
426 on
427 .Ed
428 The following command lists all properties with local settings for
429 .Em pool/home/bob .
430 .Bd -literal
431 # zfs get -r -s local -o name,property,value all pool/home/bob
432 NAME           PROPERTY              VALUE
433 pool/home/bob  quota                 20G
434 pool/home/bob  compression           on
435 .Ed
436 .It Sy Example 8 No Rolling Back a ZFS File System
437 The following command reverts the contents of
438 .Em pool/home/anne
439 to the snapshot named
440 .Sy yesterday ,
441 deleting all intermediate snapshots.
442 .Bd -literal
443 # zfs rollback -r pool/home/anne@yesterday
444 .Ed
445 .It Sy Example 9 No Creating a ZFS Clone
446 The following command creates a writable file system whose initial contents are
447 the same as
448 .Em pool/home/bob@yesterday .
449 .Bd -literal
450 # zfs clone pool/home/bob@yesterday pool/clone
451 .Ed
452 .It Sy Example 10 No Promoting a ZFS Clone
453 The following commands illustrate how to test out changes to a file system, and
454 then replace the original file system with the changed one, using clones, clone
455 promotion, and renaming:
456 .Bd -literal
457 # zfs create pool/project/production
458   populate /pool/project/production with data
459 # zfs snapshot pool/project/production@today
460 # zfs clone pool/project/production@today pool/project/beta
461   make changes to /pool/project/beta and test them
462 # zfs promote pool/project/beta
463 # zfs rename pool/project/production pool/project/legacy
464 # zfs rename pool/project/beta pool/project/production
465   once the legacy version is no longer needed, it can be destroyed
466 # zfs destroy pool/project/legacy
467 .Ed
468 .It Sy Example 11 No Inheriting ZFS Properties
469 The following command causes
470 .Em pool/home/bob
471 and
472 .Em pool/home/anne
473 to inherit the
474 .Sy checksum
475 property from their parent.
476 .Bd -literal
477 # zfs inherit checksum pool/home/bob pool/home/anne
478 .Ed
479 .It Sy Example 12 No Remotely Replicating ZFS Data
480 The following commands send a full stream and then an incremental stream to a
481 remote machine, restoring them into
482 .Em poolB/received/fs@a
483 and
484 .Em poolB/received/fs@b ,
485 respectively.
486 .Em poolB
487 must contain the file system
488 .Em poolB/received ,
489 and must not initially contain
490 .Em poolB/received/fs .
491 .Bd -literal
492 # zfs send pool/fs@a | \e
493   ssh host zfs receive poolB/received/fs@a
494 # zfs send -i a pool/fs@b | \e
495   ssh host zfs receive poolB/received/fs
496 .Ed
497 .It Sy Example 13 No Using the zfs receive -d Option
498 The following command sends a full stream of
499 .Em poolA/fsA/fsB@snap
500 to a remote machine, receiving it into
501 .Em poolB/received/fsA/fsB@snap .
502 The
503 .Em fsA/fsB@snap
504 portion of the received snapshot's name is determined from the name of the sent
505 snapshot.
506 .Em poolB
507 must contain the file system
508 .Em poolB/received .
509 If
510 .Em poolB/received/fsA
511 does not exist, it is created as an empty file system.
512 .Bd -literal
513 # zfs send poolA/fsA/fsB@snap | \e
514   ssh host zfs receive -d poolB/received
515 .Ed
516 .It Sy Example 14 No Setting User Properties
517 The following example sets the user-defined
518 .Sy com.example:department
519 property for a dataset.
520 .Bd -literal
521 # zfs set com.example:department=12345 tank/accounting
522 .Ed
523 .It Sy Example 15 No Performing a Rolling Snapshot
524 The following example shows how to maintain a history of snapshots with a
525 consistent naming scheme.
526 To keep a week's worth of snapshots, the user destroys the oldest snapshot,
527 renames the remaining snapshots, and then creates a new snapshot, as follows:
528 .Bd -literal
529 # zfs destroy -r pool/users@7daysago
530 # zfs rename -r pool/users@6daysago @7daysago
531 # zfs rename -r pool/users@5daysago @6daysago
532 # zfs rename -r pool/users@4daysago @5daysago
533 # zfs rename -r pool/users@3daysago @4daysago
534 # zfs rename -r pool/users@2daysago @3daysago
535 # zfs rename -r pool/users@yesterday @2daysago
536 # zfs rename -r pool/users@today @yesterday
537 # zfs snapshot -r pool/users@today
538 .Ed
539 .It Sy Example 16 No Setting sharenfs Property Options on a ZFS File System
540 The following commands show how to set
541 .Sy sharenfs
542 property options to enable
543 .Sy rw
544 access for a set of
545 .Sy IP
546 addresses and to enable root access for system
547 .Sy neo
548 on the
549 .Em tank/home
550 file system.
551 .Bd -literal
552 # zfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home
553 .Ed
554 .Pp
555 If you are using
556 .Sy DNS
557 for host name resolution, specify the fully qualified hostname.
558 .It Sy Example 17 No Delegating ZFS Administration Permissions on a ZFS Dataset
559 The following example shows how to set permissions so that user
560 .Sy cindys
561 can create, destroy, mount, and take snapshots on
562 .Em tank/cindys .
563 The permissions on
564 .Em tank/cindys
565 are also displayed.
566 .Bd -literal
567 # zfs allow cindys create,destroy,mount,snapshot tank/cindys
568 # zfs allow tank/cindys
569 ---- Permissions on tank/cindys --------------------------------------
570 Local+Descendent permissions:
571         user cindys create,destroy,mount,snapshot
572 .Ed
573 .Pp
574 Because the
575 .Em tank/cindys
576 mount point permission is set to 755 by default, user
577 .Sy cindys
578 will be unable to mount file systems under
579 .Em tank/cindys .
580 Add an ACE similar to the following syntax to provide mount point access:
581 .Bd -literal
582 # chmod A+user:cindys:add_subdirectory:allow /tank/cindys
583 .Ed
584 .It Sy Example 18 No Delegating Create Time Permissions on a ZFS Dataset
585 The following example shows how to grant anyone in the group
586 .Sy staff
587 to create file systems in
588 .Em tank/users .
589 This syntax also allows staff members to destroy their own file systems, but not
590 destroy anyone else's file system.
591 The permissions on
592 .Em tank/users
593 are also displayed.
594 .Bd -literal
595 # zfs allow staff create,mount tank/users
596 # zfs allow -c destroy tank/users
597 # zfs allow tank/users
598 ---- Permissions on tank/users ---------------------------------------
599 Permission sets:
600         destroy
601 Local+Descendent permissions:
602         group staff create,mount
603 .Ed
604 .It Sy Example 19 No Defining and Granting a Permission Set on a ZFS Dataset
605 The following example shows how to define and grant a permission set on the
606 .Em tank/users
607 file system.
608 The permissions on
609 .Em tank/users
610 are also displayed.
611 .Bd -literal
612 # zfs allow -s @pset create,destroy,snapshot,mount tank/users
613 # zfs allow staff @pset tank/users
614 # zfs allow tank/users
615 ---- Permissions on tank/users ---------------------------------------
616 Permission sets:
617         @pset create,destroy,mount,snapshot
618 Local+Descendent permissions:
619         group staff @pset
620 .Ed
621 .It Sy Example 20 No Delegating Property Permissions on a ZFS Dataset
622 The following example shows to grant the ability to set quotas and reservations
623 on the
624 .Em users/home
625 file system.
626 The permissions on
627 .Em users/home
628 are also displayed.
629 .Bd -literal
630 # zfs allow cindys quota,reservation users/home
631 # zfs allow users/home
632 ---- Permissions on users/home ---------------------------------------
633 Local+Descendent permissions:
634         user cindys quota,reservation
635 cindys% zfs set quota=10G users/home/marks
636 cindys% zfs get quota users/home/marks
637 NAME              PROPERTY  VALUE  SOURCE
638 users/home/marks  quota     10G    local
639 .Ed
640 .It Sy Example 21 No Removing ZFS Delegated Permissions on a ZFS Dataset
641 The following example shows how to remove the snapshot permission from the
642 .Sy staff
643 group on the
644 .Em tank/users
645 file system.
646 The permissions on
647 .Em tank/users
648 are also displayed.
649 .Bd -literal
650 # zfs unallow staff snapshot tank/users
651 # zfs allow tank/users
652 ---- Permissions on tank/users ---------------------------------------
653 Permission sets:
654         @pset create,destroy,mount,snapshot
655 Local+Descendent permissions:
656         group staff @pset
657 .Ed
658 .It Sy Example 22 No Showing the differences between a snapshot and a ZFS Dataset
659 The following example shows how to see what has changed between a prior
660 snapshot of a ZFS dataset and its current state.
661 The
662 .Fl F
663 option is used to indicate type information for the files affected.
664 .Bd -literal
665 # zfs diff -F tank/test@before tank/test
666 M       /       /tank/test/
667 M       F       /tank/test/linked      (+1)
668 R       F       /tank/test/oldname -> /tank/test/newname
669 -       F       /tank/test/deleted
670 +       F       /tank/test/created
671 M       F       /tank/test/modified
672 .Ed
673 .It Sy Example 23 No Creating a bookmark
674 The following example create a bookmark to a snapshot.
675 This bookmark can then be used instead of snapshot in send streams.
676 .Bd -literal
677 # zfs bookmark rpool@snapshot rpool#bookmark
678 .Ed
679 .It Sy Example 24 No Setting sharesmb Property Options on a ZFS File System
680 The following example show how to share SMB filesystem through ZFS.
681 Note that that a user and his/her password must be given.
682 .Bd -literal
683 # smbmount //127.0.0.1/share_tmp /mnt/tmp \\
684   -o user=workgroup/turbo,password=obrut,uid=1000
685 .Ed
686 .Pp
687 Minimal
688 .Em /etc/samba/smb.conf
689 configuration required:
690 .Pp
691 Samba will need to listen to 'localhost' (127.0.0.1) for the ZFS utilities to
692 communicate with Samba.
693 This is the default behavior for most Linux distributions.
694 .Pp
695 Samba must be able to authenticate a user.
696 This can be done in a number of ways, depending on if using the system password file, LDAP or the Samba
697 specific smbpasswd file.
698 How to do this is outside the scope of this manual.
699 Please refer to the
700 .Xr smb.conf 5
701 man page for more information.
702 .Pp
703 See the
704 .Sy USERSHARE section
705 of the
706 .Xr smb.conf 5
707 man page for all configuration options in case you need to modify any options
708 to the share afterwards.
709 Do note that any changes done with the
710 .Xr net 8
711 command will be undone if the share is ever unshared (such as at a reboot etc).
712 .El
713 .Sh ENVIRONMENT VARIABLES
714 .Bl -tag -width "ZFS_MOUNT_HELPER"
715 .It Ev ZFS_MOUNT_HELPER
716 Cause
717 .Nm zfs mount
718 to use
719 .Em /bin/mount
720 to mount zfs datasets. This option is provided for backwards compatibility with older zfs versions.
721 .El
722 .Sh INTERFACE STABILITY
723 .Sy Committed .
724 .Sh SEE ALSO
725 .Xr attr 1 ,
726 .Xr gzip 1 ,
727 .Xr ssh 1 ,
728 .Xr chmod 2 ,
729 .Xr fsync 2 ,
730 .Xr stat 2 ,
731 .Xr write 2 ,
732 .Xr acl 5 ,
733 .Xr attributes 5 ,
734 .Xr exports 5 ,
735 .Xr exportfs 8 ,
736 .Xr mount 8 ,
737 .Xr net 8 ,
738 .Xr selinux 8 ,
739 .Xr zfs-allow 8 ,
740 .Xr zfs-bookmark 8 ,
741 .Xr zfs-change-key 8 ,
742 .Xr zfs-clone 8 ,
743 .Xr zfs-create 8 ,
744 .Xr zfs-destroy 8 ,
745 .Xr zfs-diff 8 ,
746 .Xr zfs-get 8 ,
747 .Xr zfs-groupspace 8 ,
748 .Xr zfs-hold 8 ,
749 .Xr zfs-inherit 8 ,
750 .Xr zfs-jail 8 ,
751 .Xr zfs-list 8 ,
752 .Xr zfs-load-key 8 ,
753 .Xr zfs-mount 8 ,
754 .Xr zfs-program 8 ,
755 .Xr zfs-project 8 ,
756 .Xr zfs-projectspace 8 ,
757 .Xr zfs-promote 8 ,
758 .Xr zfs-receive 8 ,
759 .Xr zfs-redact 8 ,
760 .Xr zfs-release 8 ,
761 .Xr zfs-rename 8 ,
762 .Xr zfs-rollback 8 ,
763 .Xr zfs-send 8 ,
764 .Xr zfs-set 8 ,
765 .Xr zfs-share 8 ,
766 .Xr zfs-snapshot 8 ,
767 .Xr zfs-unallow 8 ,
768 .Xr zfs-unjail 8 ,
769 .Xr zfs-unload-key 8 ,
770 .Xr zfs-unmount 8 ,
771 .Xr zfs-unshare 8 ,
772 .Xr zfs-upgrade 8 ,
773 .Xr zfs-userspace 8 ,
774 .Xr zfs-wait 8 ,
775 .Xr zfsconcepts 8 ,
776 .Xr zfsprops 8 ,
777 .Xr zpool 8