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