1eda14cbcSMatt Macy.\" 2eda14cbcSMatt Macy.\" CDDL HEADER START 3eda14cbcSMatt Macy.\" 4eda14cbcSMatt Macy.\" The contents of this file are subject to the terms of the 5eda14cbcSMatt Macy.\" Common Development and Distribution License (the "License"). 6eda14cbcSMatt Macy.\" You may not use this file except in compliance with the License. 7eda14cbcSMatt Macy.\" 8eda14cbcSMatt Macy.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9271171e0SMartin Matuska.\" or https://opensource.org/licenses/CDDL-1.0. 10eda14cbcSMatt Macy.\" See the License for the specific language governing permissions 11eda14cbcSMatt Macy.\" and limitations under the License. 12eda14cbcSMatt Macy.\" 13eda14cbcSMatt Macy.\" When distributing Covered Code, include this CDDL HEADER in each 14eda14cbcSMatt Macy.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15eda14cbcSMatt Macy.\" If applicable, add the following below this CDDL HEADER, with the 16eda14cbcSMatt Macy.\" fields enclosed by brackets "[]" replaced with your own identifying 17eda14cbcSMatt Macy.\" information: Portions Copyright [yyyy] [name of copyright owner] 18eda14cbcSMatt Macy.\" 19eda14cbcSMatt Macy.\" CDDL HEADER END 20eda14cbcSMatt Macy.\" 21eda14cbcSMatt Macy.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved. 22eda14cbcSMatt Macy.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org> 23eda14cbcSMatt Macy.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved. 24eda14cbcSMatt Macy.\" Copyright (c) 2011, Pawel Jakub Dawidek <pjd@FreeBSD.org> 25eda14cbcSMatt Macy.\" Copyright (c) 2012, Glen Barber <gjb@FreeBSD.org> 26eda14cbcSMatt Macy.\" Copyright (c) 2012, Bryan Drewery <bdrewery@FreeBSD.org> 27eda14cbcSMatt Macy.\" Copyright (c) 2013, Steven Hartland <smh@FreeBSD.org> 28eda14cbcSMatt Macy.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. 29eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. 30eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved. 31eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com] 32eda14cbcSMatt Macy.\" Copyright (c) 2014, Xin LI <delphij@FreeBSD.org> 33eda14cbcSMatt Macy.\" Copyright (c) 2014-2015, The FreeBSD Foundation, All Rights Reserved. 34eda14cbcSMatt Macy.\" Copyright (c) 2016 Nexenta Systems, Inc. All Rights Reserved. 35eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved. 36eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc. 37eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc. 38eda14cbcSMatt Macy.\" 39716fd348SMartin Matuska.Dd May 12, 2022 40eda14cbcSMatt Macy.Dt ZFS 8 41eda14cbcSMatt Macy.Os 4216038816SMartin Matuska. 43eda14cbcSMatt Macy.Sh NAME 44eda14cbcSMatt Macy.Nm zfs 4516038816SMartin Matuska.Nd configure ZFS datasets 46eda14cbcSMatt Macy.Sh SYNOPSIS 47eda14cbcSMatt Macy.Nm 48eda14cbcSMatt Macy.Fl ?V 49eda14cbcSMatt Macy.Nm 50eda14cbcSMatt Macy.Cm version 51ce4dcb97SMartin Matuska.Op Fl j 52eda14cbcSMatt Macy.Nm 5316038816SMartin Matuska.Cm subcommand 5416038816SMartin Matuska.Op Ar arguments 5516038816SMartin Matuska. 56eda14cbcSMatt Macy.Sh DESCRIPTION 57eda14cbcSMatt MacyThe 58eda14cbcSMatt Macy.Nm 59eda14cbcSMatt Macycommand configures ZFS datasets within a ZFS storage pool, as described in 60eda14cbcSMatt Macy.Xr zpool 8 . 61716fd348SMartin MatuskaA dataset is identified by a unique path within the ZFS namespace: 62eda14cbcSMatt Macy.Pp 63716fd348SMartin Matuska.D1 Ar pool Ns Oo Sy / Ns Ar component Oc Ns Sy / Ns Ar component 64716fd348SMartin Matuska.Pp 65716fd348SMartin Matuskafor example: 66716fd348SMartin Matuska.Pp 67716fd348SMartin Matuska.Dl rpool/var/log 68716fd348SMartin Matuska.Pp 69716fd348SMartin MatuskaThe maximum length of a dataset name is 70716fd348SMartin Matuska.Sy ZFS_MAX_DATASET_NAME_LEN No - 1 71716fd348SMartin MatuskaASCII characters (currently 255) satisfying 72716fd348SMartin Matuska.Sy [A-Za-z_.:/ -] . 73716fd348SMartin MatuskaAdditionally snapshots are allowed to contain a single 74716fd348SMartin Matuska.Sy @ 75716fd348SMartin Matuskacharacter, while bookmarks are allowed to contain a single 76716fd348SMartin Matuska.Sy # 77716fd348SMartin Matuskacharacter. 78716fd348SMartin Matuska.Sy / 79716fd348SMartin Matuskais used as separator between components. 80716fd348SMartin MatuskaThe maximum amount of nesting allowed in a path is 81716fd348SMartin Matuska.Sy zfs_max_dataset_nesting 82716fd348SMartin Matuskalevels deep. 83716fd348SMartin MatuskaZFS tunables 84716fd348SMartin Matuska.Pq Sy zfs_* 85716fd348SMartin Matuskaare explained in 86716fd348SMartin Matuska.Xr zfs 4 . 87eda14cbcSMatt Macy.Pp 88eda14cbcSMatt MacyA dataset can be one of the following: 8916038816SMartin Matuska.Bl -tag -offset Ds -width "file system" 90eda14cbcSMatt Macy.It Sy file system 9116038816SMartin MatuskaCan be mounted within the standard system namespace and behaves like other file 92eda14cbcSMatt Macysystems. 9316038816SMartin MatuskaWhile ZFS file systems are designed to be POSIX-compliant, known issues exist 94eda14cbcSMatt Macythat prevent compliance in some cases. 95eda14cbcSMatt MacyApplications that depend on standards conformance might fail due to non-standard 96eda14cbcSMatt Macybehavior when checking file system free space. 97eda14cbcSMatt Macy.It Sy volume 98eda14cbcSMatt MacyA logical volume exported as a raw or block device. 99eda14cbcSMatt MacyThis type of dataset should only be used when a block device is required. 100eda14cbcSMatt MacyFile systems are typically used in most environments. 101eda14cbcSMatt Macy.It Sy snapshot 102eda14cbcSMatt MacyA read-only version of a file system or volume at a given point in time. 103eda14cbcSMatt MacyIt is specified as 104eda14cbcSMatt Macy.Ar filesystem Ns @ Ns Ar name 105eda14cbcSMatt Macyor 106eda14cbcSMatt Macy.Ar volume Ns @ Ns Ar name . 107eda14cbcSMatt Macy.It Sy bookmark 108eda14cbcSMatt MacyMuch like a 109eda14cbcSMatt Macy.Sy snapshot , 110eda14cbcSMatt Macybut without the hold on on-disk data. 11116038816SMartin MatuskaIt can be used as the source of a send (but not for a receive). 11216038816SMartin MatuskaIt is specified as 113eda14cbcSMatt Macy.Ar filesystem Ns # Ns Ar name 114eda14cbcSMatt Macyor 115eda14cbcSMatt Macy.Ar volume Ns # Ns Ar name . 116eda14cbcSMatt Macy.El 117eda14cbcSMatt Macy.Pp 11816038816SMartin MatuskaSee 1193ff01b23SMartin Matuska.Xr zfsconcepts 7 12016038816SMartin Matuskafor details. 12116038816SMartin Matuska. 122eda14cbcSMatt Macy.Ss Properties 12316038816SMartin MatuskaProperties are divided into two types: native properties and user-defined 12416038816SMartin Matuska.Pq or Qq user 125eda14cbcSMatt Macyproperties. 126eda14cbcSMatt MacyNative properties either export internal statistics or control ZFS behavior. 127eda14cbcSMatt MacyIn addition, native properties are either editable or read-only. 128eda14cbcSMatt MacyUser properties have no effect on ZFS behavior, but you can use them to annotate 129eda14cbcSMatt Macydatasets in a way that is meaningful in your environment. 13016038816SMartin MatuskaFor more information about properties, see 1313ff01b23SMartin Matuska.Xr zfsprops 7 . 13216038816SMartin Matuska. 133eda14cbcSMatt Macy.Ss Encryption 134eda14cbcSMatt MacyEnabling the 135eda14cbcSMatt Macy.Sy encryption 136eda14cbcSMatt Macyfeature allows for the creation of encrypted filesystems and volumes. 137eda14cbcSMatt MacyZFS will encrypt file and zvol data, file attributes, ACLs, permission bits, 138eda14cbcSMatt Macydirectory listings, FUID mappings, and 13916038816SMartin Matuska.Sy userused Ns / Ns Sy groupused Ns / Ns Sy projectused 140eda14cbcSMatt Macydata. 14116038816SMartin MatuskaFor an overview of encryption, see 14216038816SMartin Matuska.Xr zfs-load-key 8 . 14316038816SMartin Matuska. 144eda14cbcSMatt Macy.Sh SUBCOMMANDS 145eda14cbcSMatt MacyAll subcommands that modify state are logged persistently to the pool in their 146eda14cbcSMatt Macyoriginal form. 147eda14cbcSMatt Macy.Bl -tag -width "" 148eda14cbcSMatt Macy.It Nm Fl ? 149eda14cbcSMatt MacyDisplays a help message. 150eda14cbcSMatt Macy.It Xo 151eda14cbcSMatt Macy.Nm 152eda14cbcSMatt Macy.Fl V , -version 153eda14cbcSMatt Macy.Xc 154eda14cbcSMatt Macy.It Xo 155eda14cbcSMatt Macy.Nm 156eda14cbcSMatt Macy.Cm version 157ce4dcb97SMartin Matuska.Op Fl j 158eda14cbcSMatt Macy.Xc 159eda14cbcSMatt MacyDisplays the software version of the 160eda14cbcSMatt Macy.Nm 161eda14cbcSMatt Macyuserland utility and the zfs kernel module. 162ce4dcb97SMartin MatuskaUse 163ce4dcb97SMartin Matuska.Fl j 164ce4dcb97SMartin Matuskaoption to output in JSON format. 165eda14cbcSMatt Macy.El 16616038816SMartin Matuska. 167eda14cbcSMatt Macy.Ss Dataset Management 168eda14cbcSMatt Macy.Bl -tag -width "" 169eda14cbcSMatt Macy.It Xr zfs-list 8 170eda14cbcSMatt MacyLists the property information for the given datasets in tabular form. 171eda14cbcSMatt Macy.It Xr zfs-create 8 172eda14cbcSMatt MacyCreates a new ZFS file system or volume. 173eda14cbcSMatt Macy.It Xr zfs-destroy 8 174eda14cbcSMatt MacyDestroys the given dataset(s), snapshot(s), or bookmark. 175eda14cbcSMatt Macy.It Xr zfs-rename 8 176eda14cbcSMatt MacyRenames the given dataset (filesystem or snapshot). 177eda14cbcSMatt Macy.It Xr zfs-upgrade 8 178eda14cbcSMatt MacyManage upgrading the on-disk version of filesystems. 179eda14cbcSMatt Macy.El 18016038816SMartin Matuska. 181eda14cbcSMatt Macy.Ss Snapshots 182eda14cbcSMatt Macy.Bl -tag -width "" 183eda14cbcSMatt Macy.It Xr zfs-snapshot 8 184eda14cbcSMatt MacyCreates snapshots with the given names. 185eda14cbcSMatt Macy.It Xr zfs-rollback 8 186eda14cbcSMatt MacyRoll back the given dataset to a previous snapshot. 18716038816SMartin Matuska.It Xr zfs-hold 8 Ns / Ns Xr zfs-release 8 188eda14cbcSMatt MacyAdd or remove a hold reference to the specified snapshot or snapshots. 189eda14cbcSMatt MacyIf a hold exists on a snapshot, attempts to destroy that snapshot by using the 190eda14cbcSMatt Macy.Nm zfs Cm destroy 191eda14cbcSMatt Macycommand return 19216038816SMartin Matuska.Sy EBUSY . 193eda14cbcSMatt Macy.It Xr zfs-diff 8 194eda14cbcSMatt MacyDisplay the difference between a snapshot of a given filesystem and another 195eda14cbcSMatt Macysnapshot of that filesystem from a later time or the current contents of the 196eda14cbcSMatt Macyfilesystem. 197eda14cbcSMatt Macy.El 19816038816SMartin Matuska. 199eda14cbcSMatt Macy.Ss Clones 200eda14cbcSMatt Macy.Bl -tag -width "" 201eda14cbcSMatt Macy.It Xr zfs-clone 8 202eda14cbcSMatt MacyCreates a clone of the given snapshot. 203eda14cbcSMatt Macy.It Xr zfs-promote 8 204eda14cbcSMatt MacyPromotes a clone file system to no longer be dependent on its 205eda14cbcSMatt Macy.Qq origin 206eda14cbcSMatt Macysnapshot. 207eda14cbcSMatt Macy.El 20816038816SMartin Matuska. 209eda14cbcSMatt Macy.Ss Send & Receive 210eda14cbcSMatt Macy.Bl -tag -width "" 211eda14cbcSMatt Macy.It Xr zfs-send 8 212eda14cbcSMatt MacyGenerate a send stream, which may be of a filesystem, and may be incremental 213eda14cbcSMatt Macyfrom a bookmark. 214eda14cbcSMatt Macy.It Xr zfs-receive 8 215eda14cbcSMatt MacyCreates a snapshot whose contents are as specified in the stream provided on 216eda14cbcSMatt Macystandard input. 217eda14cbcSMatt MacyIf a full stream is received, then a new file system is created as well. 218eda14cbcSMatt MacyStreams are created using the 219eda14cbcSMatt Macy.Xr zfs-send 8 220eda14cbcSMatt Macysubcommand, which by default creates a full stream. 221eda14cbcSMatt Macy.It Xr zfs-bookmark 8 222eda14cbcSMatt MacyCreates a new bookmark of the given snapshot or bookmark. 223eda14cbcSMatt MacyBookmarks mark the point in time when the snapshot was created, and can be used 224eda14cbcSMatt Macyas the incremental source for a 225eda14cbcSMatt Macy.Nm zfs Cm send 226eda14cbcSMatt Macycommand. 227eda14cbcSMatt Macy.It Xr zfs-redact 8 228eda14cbcSMatt MacyGenerate a new redaction bookmark. 229eda14cbcSMatt MacyThis feature can be used to allow clones of a filesystem to be made available on 230eda14cbcSMatt Macya remote system, in the case where their parent need not (or needs to not) be 231eda14cbcSMatt Macyusable. 232eda14cbcSMatt Macy.El 23316038816SMartin Matuska. 234eda14cbcSMatt Macy.Ss Properties 235eda14cbcSMatt Macy.Bl -tag -width "" 236eda14cbcSMatt Macy.It Xr zfs-get 8 237eda14cbcSMatt MacyDisplays properties for the given datasets. 238eda14cbcSMatt Macy.It Xr zfs-set 8 239eda14cbcSMatt MacySets the property or list of properties to the given value(s) for each dataset. 240eda14cbcSMatt Macy.It Xr zfs-inherit 8 241eda14cbcSMatt MacyClears the specified property, causing it to be inherited from an ancestor, 242eda14cbcSMatt Macyrestored to default if no ancestor has the property set, or with the 243eda14cbcSMatt Macy.Fl S 244eda14cbcSMatt Macyoption reverted to the received value if one exists. 245eda14cbcSMatt Macy.El 24616038816SMartin Matuska. 247eda14cbcSMatt Macy.Ss Quotas 248eda14cbcSMatt Macy.Bl -tag -width "" 24916038816SMartin Matuska.It Xr zfs-userspace 8 Ns / Ns Xr zfs-groupspace 8 Ns / Ns Xr zfs-projectspace 8 250eda14cbcSMatt MacyDisplays space consumed by, and quotas on, each user, group, or project 251eda14cbcSMatt Macyin the specified filesystem or snapshot. 252eda14cbcSMatt Macy.It Xr zfs-project 8 253716fd348SMartin MatuskaList, set, or clear project ID and/or inherit flag on the files or directories. 254eda14cbcSMatt Macy.El 25516038816SMartin Matuska. 256eda14cbcSMatt Macy.Ss Mountpoints 257eda14cbcSMatt Macy.Bl -tag -width "" 258eda14cbcSMatt Macy.It Xr zfs-mount 8 259eda14cbcSMatt MacyDisplays all ZFS file systems currently mounted, or mount ZFS filesystem 260eda14cbcSMatt Macyon a path described by its 261eda14cbcSMatt Macy.Sy mountpoint 262eda14cbcSMatt Macyproperty. 263eda14cbcSMatt Macy.It Xr zfs-unmount 8 264eda14cbcSMatt MacyUnmounts currently mounted ZFS file systems. 265eda14cbcSMatt Macy.El 26616038816SMartin Matuska. 267eda14cbcSMatt Macy.Ss Shares 268eda14cbcSMatt Macy.Bl -tag -width "" 269eda14cbcSMatt Macy.It Xr zfs-share 8 270eda14cbcSMatt MacyShares available ZFS file systems. 271eda14cbcSMatt Macy.It Xr zfs-unshare 8 272eda14cbcSMatt MacyUnshares currently shared ZFS file systems. 273eda14cbcSMatt Macy.El 27416038816SMartin Matuska. 275eda14cbcSMatt Macy.Ss Delegated Administration 276eda14cbcSMatt Macy.Bl -tag -width "" 277eda14cbcSMatt Macy.It Xr zfs-allow 8 278eda14cbcSMatt MacyDelegate permissions on the specified filesystem or volume. 279eda14cbcSMatt Macy.It Xr zfs-unallow 8 280eda14cbcSMatt MacyRemove delegated permissions on the specified filesystem or volume. 281eda14cbcSMatt Macy.El 28216038816SMartin Matuska. 283eda14cbcSMatt Macy.Ss Encryption 284eda14cbcSMatt Macy.Bl -tag -width "" 285eda14cbcSMatt Macy.It Xr zfs-change-key 8 286eda14cbcSMatt MacyAdd or change an encryption key on the specified dataset. 287eda14cbcSMatt Macy.It Xr zfs-load-key 8 288eda14cbcSMatt MacyLoad the key for the specified encrypted dataset, enabling access. 289eda14cbcSMatt Macy.It Xr zfs-unload-key 8 290716fd348SMartin MatuskaUnload a key for the specified dataset, 291716fd348SMartin Matuskaremoving the ability to access the dataset. 292eda14cbcSMatt Macy.El 29316038816SMartin Matuska. 294eda14cbcSMatt Macy.Ss Channel Programs 295eda14cbcSMatt Macy.Bl -tag -width "" 296eda14cbcSMatt Macy.It Xr zfs-program 8 297eda14cbcSMatt MacyExecute ZFS administrative operations 298eda14cbcSMatt Macyprogrammatically via a Lua script-language channel program. 299eda14cbcSMatt Macy.El 30016038816SMartin Matuska. 301eda14cbcSMatt Macy.Ss Jails 302eda14cbcSMatt Macy.Bl -tag -width "" 303eda14cbcSMatt Macy.It Xr zfs-jail 8 304eda14cbcSMatt MacyAttaches a filesystem to a jail. 305eda14cbcSMatt Macy.It Xr zfs-unjail 8 306eda14cbcSMatt MacyDetaches a filesystem from a jail. 307eda14cbcSMatt Macy.El 30816038816SMartin Matuska. 309eda14cbcSMatt Macy.Ss Waiting 310eda14cbcSMatt Macy.Bl -tag -width "" 311eda14cbcSMatt Macy.It Xr zfs-wait 8 312eda14cbcSMatt MacyWait for background activity in a filesystem to complete. 313eda14cbcSMatt Macy.El 31416038816SMartin Matuska. 315eda14cbcSMatt Macy.Sh EXIT STATUS 316eda14cbcSMatt MacyThe 317eda14cbcSMatt Macy.Nm 31816038816SMartin Matuskautility exits 31916038816SMartin Matuska.Sy 0 32016038816SMartin Matuskaon success, 32116038816SMartin Matuska.Sy 1 32216038816SMartin Matuskaif an error occurs, and 32316038816SMartin Matuska.Sy 2 32416038816SMartin Matuskaif invalid command line options were specified. 32516038816SMartin Matuska. 326eda14cbcSMatt Macy.Sh EXAMPLES 327da5137abSMartin Matuska.\" Examples 1, 4, 6, 7, 11, 14, 16 are shared with zfs-set.8. 328da5137abSMartin Matuska.\" Examples 1, 10 are shared with zfs-create.8. 329da5137abSMartin Matuska.\" Examples 2, 3, 10, 15 are also shared with zfs-snapshot.8. 330da5137abSMartin Matuska.\" Examples 3, 10, 15 are shared with zfs-destroy.8. 331da5137abSMartin Matuska.\" Examples 5 are shared with zfs-list.8. 332da5137abSMartin Matuska.\" Examples 8 are shared with zfs-rollback.8. 333da5137abSMartin Matuska.\" Examples 9, 10 are shared with zfs-clone.8. 334da5137abSMartin Matuska.\" Examples 10 are also shared with zfs-promote.8. 335da5137abSMartin Matuska.\" Examples 10, 15 also are shared with zfs-rename.8. 336da5137abSMartin Matuska.\" Examples 12, 13 are shared with zfs-send.8. 337da5137abSMartin Matuska.\" Examples 12, 13 are also shared with zfs-receive.8. 338da5137abSMartin Matuska.\" Examples 17, 18, 19, 20, 21 are shared with zfs-allow.8. 339da5137abSMartin Matuska.\" Examples 22 are shared with zfs-diff.8. 340da5137abSMartin Matuska.\" Examples 23 are shared with zfs-bookmark.8. 341da5137abSMartin Matuska.\" Make sure to update them omnidirectionally 342da5137abSMartin Matuska.Ss Example 1 : No Creating a ZFS File System Hierarchy 343eda14cbcSMatt MacyThe following commands create a file system named 34416038816SMartin Matuska.Ar pool/home 345eda14cbcSMatt Macyand a file system named 34616038816SMartin Matuska.Ar pool/home/bob . 347eda14cbcSMatt MacyThe mount point 348eda14cbcSMatt Macy.Pa /export/home 349eda14cbcSMatt Macyis set for the parent file system, and is automatically inherited by the child 350eda14cbcSMatt Macyfile system. 35116038816SMartin Matuska.Dl # Nm zfs Cm create Ar pool/home 35216038816SMartin Matuska.Dl # Nm zfs Cm set Sy mountpoint Ns = Ns Ar /export/home pool/home 35316038816SMartin Matuska.Dl # Nm zfs Cm create Ar pool/home/bob 35416038816SMartin Matuska. 355da5137abSMartin Matuska.Ss Example 2 : No Creating a ZFS Snapshot 356eda14cbcSMatt MacyThe following command creates a snapshot named 35716038816SMartin Matuska.Ar yesterday . 358eda14cbcSMatt MacyThis snapshot is mounted on demand in the 359eda14cbcSMatt Macy.Pa .zfs/snapshot 360eda14cbcSMatt Macydirectory at the root of the 36116038816SMartin Matuska.Ar pool/home/bob 362eda14cbcSMatt Macyfile system. 36316038816SMartin Matuska.Dl # Nm zfs Cm snapshot Ar pool/home/bob Ns @ Ns Ar yesterday 36416038816SMartin Matuska. 365da5137abSMartin Matuska.Ss Example 3 : No Creating and Destroying Multiple Snapshots 366eda14cbcSMatt MacyThe following command creates snapshots named 36716038816SMartin Matuska.Ar yesterday No of Ar pool/home 368eda14cbcSMatt Macyand all of its descendent file systems. 369eda14cbcSMatt MacyEach snapshot is mounted on demand in the 370eda14cbcSMatt Macy.Pa .zfs/snapshot 371eda14cbcSMatt Macydirectory at the root of its file system. 372eda14cbcSMatt MacyThe second command destroys the newly created snapshots. 37316038816SMartin Matuska.Dl # Nm zfs Cm snapshot Fl r Ar pool/home Ns @ Ns Ar yesterday 37416038816SMartin Matuska.Dl # Nm zfs Cm destroy Fl r Ar pool/home Ns @ Ns Ar yesterday 37516038816SMartin Matuska. 376da5137abSMartin Matuska.Ss Example 4 : No Disabling and Enabling File System Compression 377eda14cbcSMatt MacyThe following command disables the 378eda14cbcSMatt Macy.Sy compression 379eda14cbcSMatt Macyproperty for all file systems under 38016038816SMartin Matuska.Ar pool/home . 381eda14cbcSMatt MacyThe next command explicitly enables 382eda14cbcSMatt Macy.Sy compression 383eda14cbcSMatt Macyfor 38416038816SMartin Matuska.Ar pool/home/anne . 38516038816SMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy off Ar pool/home 38616038816SMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy on Ar pool/home/anne 38716038816SMartin Matuska. 388da5137abSMartin Matuska.Ss Example 5 : No Listing ZFS Datasets 389eda14cbcSMatt MacyThe following command lists all active file systems and volumes in the system. 39016038816SMartin MatuskaSnapshots are displayed if 39116038816SMartin Matuska.Sy listsnaps Ns = Ns Sy on . 392eda14cbcSMatt MacyThe default is 393eda14cbcSMatt Macy.Sy off . 394eda14cbcSMatt MacySee 3953ff01b23SMartin Matuska.Xr zpoolprops 7 396eda14cbcSMatt Macyfor more information on pool properties. 39716038816SMartin Matuska.Bd -literal -compact -offset Ds 39816038816SMartin Matuska.No # Nm zfs Cm list 399eda14cbcSMatt MacyNAME USED AVAIL REFER MOUNTPOINT 400eda14cbcSMatt Macypool 450K 457G 18K /pool 401eda14cbcSMatt Macypool/home 315K 457G 21K /export/home 402eda14cbcSMatt Macypool/home/anne 18K 457G 18K /export/home/anne 403eda14cbcSMatt Macypool/home/bob 276K 457G 276K /export/home/bob 404eda14cbcSMatt Macy.Ed 40516038816SMartin Matuska. 406da5137abSMartin Matuska.Ss Example 6 : No Setting a Quota on a ZFS File System 407eda14cbcSMatt MacyThe following command sets a quota of 50 Gbytes for 40816038816SMartin Matuska.Ar pool/home/bob : 40916038816SMartin Matuska.Dl # Nm zfs Cm set Sy quota Ns = Ns Ar 50G pool/home/bob 41016038816SMartin Matuska. 411da5137abSMartin Matuska.Ss Example 7 : No Listing ZFS Properties 412eda14cbcSMatt MacyThe following command lists all properties for 41316038816SMartin Matuska.Ar pool/home/bob : 41416038816SMartin Matuska.Bd -literal -compact -offset Ds 41516038816SMartin Matuska.No # Nm zfs Cm get Sy all Ar pool/home/bob 416eda14cbcSMatt MacyNAME PROPERTY VALUE SOURCE 417eda14cbcSMatt Macypool/home/bob type filesystem - 418eda14cbcSMatt Macypool/home/bob creation Tue Jul 21 15:53 2009 - 419eda14cbcSMatt Macypool/home/bob used 21K - 420eda14cbcSMatt Macypool/home/bob available 20.0G - 421eda14cbcSMatt Macypool/home/bob referenced 21K - 422eda14cbcSMatt Macypool/home/bob compressratio 1.00x - 423eda14cbcSMatt Macypool/home/bob mounted yes - 424eda14cbcSMatt Macypool/home/bob quota 20G local 425eda14cbcSMatt Macypool/home/bob reservation none default 426eda14cbcSMatt Macypool/home/bob recordsize 128K default 427eda14cbcSMatt Macypool/home/bob mountpoint /pool/home/bob default 428eda14cbcSMatt Macypool/home/bob sharenfs off default 429eda14cbcSMatt Macypool/home/bob checksum on default 430eda14cbcSMatt Macypool/home/bob compression on local 431eda14cbcSMatt Macypool/home/bob atime on default 432eda14cbcSMatt Macypool/home/bob devices on default 433eda14cbcSMatt Macypool/home/bob exec on default 434eda14cbcSMatt Macypool/home/bob setuid on default 435eda14cbcSMatt Macypool/home/bob readonly off default 436eda14cbcSMatt Macypool/home/bob zoned off default 437eda14cbcSMatt Macypool/home/bob snapdir hidden default 438eda14cbcSMatt Macypool/home/bob acltype off default 439eda14cbcSMatt Macypool/home/bob aclmode discard default 440eda14cbcSMatt Macypool/home/bob aclinherit restricted default 441eda14cbcSMatt Macypool/home/bob canmount on default 442eda14cbcSMatt Macypool/home/bob xattr on default 443eda14cbcSMatt Macypool/home/bob copies 1 default 444eda14cbcSMatt Macypool/home/bob version 4 - 445eda14cbcSMatt Macypool/home/bob utf8only off - 446eda14cbcSMatt Macypool/home/bob normalization none - 447eda14cbcSMatt Macypool/home/bob casesensitivity sensitive - 448eda14cbcSMatt Macypool/home/bob vscan off default 449eda14cbcSMatt Macypool/home/bob nbmand off default 450eda14cbcSMatt Macypool/home/bob sharesmb off default 451eda14cbcSMatt Macypool/home/bob refquota none default 452eda14cbcSMatt Macypool/home/bob refreservation none default 453eda14cbcSMatt Macypool/home/bob primarycache all default 454eda14cbcSMatt Macypool/home/bob secondarycache all default 455eda14cbcSMatt Macypool/home/bob usedbysnapshots 0 - 456eda14cbcSMatt Macypool/home/bob usedbydataset 21K - 457eda14cbcSMatt Macypool/home/bob usedbychildren 0 - 458eda14cbcSMatt Macypool/home/bob usedbyrefreservation 0 - 459eda14cbcSMatt Macy.Ed 460eda14cbcSMatt Macy.Pp 46116038816SMartin MatuskaThe following command gets a single property value: 46216038816SMartin Matuska.Bd -literal -compact -offset Ds 46316038816SMartin Matuska.No # Nm zfs Cm get Fl H o Sy value compression Ar pool/home/bob 464eda14cbcSMatt Macyon 465eda14cbcSMatt Macy.Ed 46616038816SMartin Matuska.Pp 467eda14cbcSMatt MacyThe following command lists all properties with local settings for 46816038816SMartin Matuska.Ar pool/home/bob : 46916038816SMartin Matuska.Bd -literal -compact -offset Ds 47016038816SMartin Matuska.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 471eda14cbcSMatt MacyNAME PROPERTY VALUE 472eda14cbcSMatt Macypool/home/bob quota 20G 473eda14cbcSMatt Macypool/home/bob compression on 474eda14cbcSMatt Macy.Ed 47516038816SMartin Matuska. 476da5137abSMartin Matuska.Ss Example 8 : No Rolling Back a ZFS File System 477eda14cbcSMatt MacyThe following command reverts the contents of 47816038816SMartin Matuska.Ar pool/home/anne 479eda14cbcSMatt Macyto the snapshot named 48016038816SMartin Matuska.Ar yesterday , 48116038816SMartin Matuskadeleting all intermediate snapshots: 48216038816SMartin Matuska.Dl # Nm zfs Cm rollback Fl r Ar pool/home/anne Ns @ Ns Ar yesterday 48316038816SMartin Matuska. 484da5137abSMartin Matuska.Ss Example 9 : No Creating a ZFS Clone 485eda14cbcSMatt MacyThe following command creates a writable file system whose initial contents are 486eda14cbcSMatt Macythe same as 48716038816SMartin Matuska.Ar pool/home/bob@yesterday . 48816038816SMartin Matuska.Dl # Nm zfs Cm clone Ar pool/home/bob@yesterday pool/clone 48916038816SMartin Matuska. 490da5137abSMartin Matuska.Ss Example 10 : No Promoting a ZFS Clone 491eda14cbcSMatt MacyThe following commands illustrate how to test out changes to a file system, and 492eda14cbcSMatt Macythen replace the original file system with the changed one, using clones, clone 493eda14cbcSMatt Macypromotion, and renaming: 49416038816SMartin Matuska.Bd -literal -compact -offset Ds 49516038816SMartin Matuska.No # Nm zfs Cm create Ar pool/project/production 496eda14cbcSMatt Macy populate /pool/project/production with data 49716038816SMartin Matuska.No # Nm zfs Cm snapshot Ar pool/project/production Ns @ Ns Ar today 49816038816SMartin Matuska.No # Nm zfs Cm clone Ar pool/project/production@today pool/project/beta 499eda14cbcSMatt Macy make changes to /pool/project/beta and test them 50016038816SMartin Matuska.No # Nm zfs Cm promote Ar pool/project/beta 50116038816SMartin Matuska.No # Nm zfs Cm rename Ar pool/project/production pool/project/legacy 50216038816SMartin Matuska.No # Nm zfs Cm rename Ar pool/project/beta pool/project/production 503eda14cbcSMatt Macy once the legacy version is no longer needed, it can be destroyed 50416038816SMartin Matuska.No # Nm zfs Cm destroy Ar pool/project/legacy 505eda14cbcSMatt Macy.Ed 50616038816SMartin Matuska. 507da5137abSMartin Matuska.Ss Example 11 : No Inheriting ZFS Properties 508eda14cbcSMatt MacyThe following command causes 50916038816SMartin Matuska.Ar pool/home/bob No and Ar pool/home/anne 510eda14cbcSMatt Macyto inherit the 511eda14cbcSMatt Macy.Sy checksum 512eda14cbcSMatt Macyproperty from their parent. 51316038816SMartin Matuska.Dl # Nm zfs Cm inherit Sy checksum Ar pool/home/bob pool/home/anne 51416038816SMartin Matuska. 515da5137abSMartin Matuska.Ss Example 12 : No Remotely Replicating ZFS Data 516eda14cbcSMatt MacyThe following commands send a full stream and then an incremental stream to a 517eda14cbcSMatt Macyremote machine, restoring them into 518eda14cbcSMatt Macy.Em poolB/received/fs@a 519eda14cbcSMatt Macyand 520eda14cbcSMatt Macy.Em poolB/received/fs@b , 521eda14cbcSMatt Macyrespectively. 522eda14cbcSMatt Macy.Em poolB 523eda14cbcSMatt Macymust contain the file system 524eda14cbcSMatt Macy.Em poolB/received , 525eda14cbcSMatt Macyand must not initially contain 526eda14cbcSMatt Macy.Em poolB/received/fs . 52716038816SMartin Matuska.Bd -literal -compact -offset Ds 52816038816SMartin Matuska.No # Nm zfs Cm send Ar pool/fs@a | 52916038816SMartin Matuska.No " " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs Ns @ Ns Ar a 53016038816SMartin Matuska.No # Nm zfs Cm send Fl i Ar a pool/fs@b | 53116038816SMartin Matuska.No " " Nm ssh Ar host Nm zfs Cm receive Ar poolB/received/fs 532eda14cbcSMatt Macy.Ed 53316038816SMartin Matuska. 534da5137abSMartin Matuska.Ss Example 13 : No Using the Nm zfs Cm receive Fl d No Option 535eda14cbcSMatt MacyThe following command sends a full stream of 53616038816SMartin Matuska.Ar poolA/fsA/fsB@snap 537eda14cbcSMatt Macyto a remote machine, receiving it into 53816038816SMartin Matuska.Ar poolB/received/fsA/fsB@snap . 539eda14cbcSMatt MacyThe 54016038816SMartin Matuska.Ar fsA/fsB@snap 541eda14cbcSMatt Macyportion of the received snapshot's name is determined from the name of the sent 542eda14cbcSMatt Macysnapshot. 54316038816SMartin Matuska.Ar poolB 544eda14cbcSMatt Macymust contain the file system 54516038816SMartin Matuska.Ar poolB/received . 546eda14cbcSMatt MacyIf 54716038816SMartin Matuska.Ar poolB/received/fsA 548eda14cbcSMatt Macydoes not exist, it is created as an empty file system. 54916038816SMartin Matuska.Bd -literal -compact -offset Ds 55016038816SMartin Matuska.No # Nm zfs Cm send Ar poolA/fsA/fsB@snap | 55116038816SMartin Matuska.No " " Nm ssh Ar host Nm zfs Cm receive Fl d Ar poolB/received 552eda14cbcSMatt Macy.Ed 55316038816SMartin Matuska. 554da5137abSMartin Matuska.Ss Example 14 : No Setting User Properties 555eda14cbcSMatt MacyThe following example sets the user-defined 55616038816SMartin Matuska.Ar com.example : Ns Ar department 55716038816SMartin Matuskaproperty for a dataset: 55816038816SMartin Matuska.Dl # Nm zfs Cm set Ar com.example : Ns Ar department Ns = Ns Ar 12345 tank/accounting 55916038816SMartin Matuska. 560da5137abSMartin Matuska.Ss Example 15 : No Performing a Rolling Snapshot 561eda14cbcSMatt MacyThe following example shows how to maintain a history of snapshots with a 562eda14cbcSMatt Macyconsistent naming scheme. 563eda14cbcSMatt MacyTo keep a week's worth of snapshots, the user destroys the oldest snapshot, 564eda14cbcSMatt Macyrenames the remaining snapshots, and then creates a new snapshot, as follows: 56516038816SMartin Matuska.Bd -literal -compact -offset Ds 56616038816SMartin Matuska.No # Nm zfs Cm destroy Fl r Ar pool/users@7daysago 56716038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@6daysago No @ Ns Ar 7daysago 56816038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@5daysago No @ Ns Ar 6daysago 56916038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@4daysago No @ Ns Ar 5daysago 57016038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@3daysago No @ Ns Ar 4daysago 57116038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@2daysago No @ Ns Ar 3daysago 57216038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@yesterday No @ Ns Ar 2daysago 57316038816SMartin Matuska.No # Nm zfs Cm rename Fl r Ar pool/users@today No @ Ns Ar yesterday 57416038816SMartin Matuska.No # Nm zfs Cm snapshot Fl r Ar pool/users Ns @ Ns Ar today 575eda14cbcSMatt Macy.Ed 57616038816SMartin Matuska. 577da5137abSMartin Matuska.Ss Example 16 : No Setting sharenfs Property Options on a ZFS File System 578eda14cbcSMatt MacyThe following commands show how to set 579eda14cbcSMatt Macy.Sy sharenfs 58016038816SMartin Matuskaproperty options to enable read-write 58116038816SMartin Matuskaaccess for a set of IP addresses and to enable root access for system 58216038816SMartin Matuska.Qq neo 583eda14cbcSMatt Macyon the 58416038816SMartin Matuska.Ar tank/home 58516038816SMartin Matuskafile system: 5866ba2210eSMartin Matuska.Dl # Nm zfs Cm set Sy sharenfs Ns = Ns ' Ns Ar rw Ns =@123.123.0.0/16:[::1],root= Ns Ar neo Ns ' tank/home 587eda14cbcSMatt Macy.Pp 58816038816SMartin MatuskaIf you are using DNS for host name resolution, 58916038816SMartin Matuskaspecify the fully-qualified hostname. 59016038816SMartin Matuska. 591da5137abSMartin Matuska.Ss Example 17 : No Delegating ZFS Administration Permissions on a ZFS Dataset 592eda14cbcSMatt MacyThe following example shows how to set permissions so that user 59316038816SMartin Matuska.Ar cindys 594eda14cbcSMatt Macycan create, destroy, mount, and take snapshots on 59516038816SMartin Matuska.Ar tank/cindys . 596eda14cbcSMatt MacyThe permissions on 59716038816SMartin Matuska.Ar tank/cindys 598eda14cbcSMatt Macyare also displayed. 59916038816SMartin Matuska.Bd -literal -compact -offset Ds 60016038816SMartin Matuska.No # Nm zfs Cm allow Sy cindys create , Ns Sy destroy , Ns Sy mount , Ns Sy snapshot Ar tank/cindys 60116038816SMartin Matuska.No # Nm zfs Cm allow Ar tank/cindys 602eda14cbcSMatt Macy---- Permissions on tank/cindys -------------------------------------- 603eda14cbcSMatt MacyLocal+Descendent permissions: 604eda14cbcSMatt Macy user cindys create,destroy,mount,snapshot 605eda14cbcSMatt Macy.Ed 606eda14cbcSMatt Macy.Pp 607eda14cbcSMatt MacyBecause the 60816038816SMartin Matuska.Ar tank/cindys 609eda14cbcSMatt Macymount point permission is set to 755 by default, user 61016038816SMartin Matuska.Ar cindys 611eda14cbcSMatt Macywill be unable to mount file systems under 61216038816SMartin Matuska.Ar tank/cindys . 613eda14cbcSMatt MacyAdd an ACE similar to the following syntax to provide mount point access: 61416038816SMartin Matuska.Dl # Cm chmod No A+user : Ns Ar cindys Ns :add_subdirectory:allow Ar /tank/cindys 61516038816SMartin Matuska. 616da5137abSMartin Matuska.Ss Example 18 : No Delegating Create Time Permissions on a ZFS Dataset 617eda14cbcSMatt MacyThe following example shows how to grant anyone in the group 61816038816SMartin Matuska.Ar staff 619eda14cbcSMatt Macyto create file systems in 62016038816SMartin Matuska.Ar tank/users . 621eda14cbcSMatt MacyThis syntax also allows staff members to destroy their own file systems, but not 622eda14cbcSMatt Macydestroy anyone else's file system. 623eda14cbcSMatt MacyThe permissions on 62416038816SMartin Matuska.Ar tank/users 625eda14cbcSMatt Macyare also displayed. 62616038816SMartin Matuska.Bd -literal -compact -offset Ds 62716038816SMartin Matuska.No # Nm zfs Cm allow Ar staff Sy create , Ns Sy mount Ar tank/users 62816038816SMartin Matuska.No # Nm zfs Cm allow Fl c Sy destroy Ar tank/users 62916038816SMartin Matuska.No # Nm zfs Cm allow Ar tank/users 630eda14cbcSMatt Macy---- Permissions on tank/users --------------------------------------- 631eda14cbcSMatt MacyPermission sets: 632eda14cbcSMatt Macy destroy 633eda14cbcSMatt MacyLocal+Descendent permissions: 634eda14cbcSMatt Macy group staff create,mount 635eda14cbcSMatt Macy.Ed 63616038816SMartin Matuska. 637da5137abSMartin Matuska.Ss Example 19 : No Defining and Granting a Permission Set on a ZFS Dataset 638eda14cbcSMatt MacyThe following example shows how to define and grant a permission set on the 63916038816SMartin Matuska.Ar tank/users 640eda14cbcSMatt Macyfile system. 641eda14cbcSMatt MacyThe permissions on 64216038816SMartin Matuska.Ar tank/users 643eda14cbcSMatt Macyare also displayed. 64416038816SMartin Matuska.Bd -literal -compact -offset Ds 64516038816SMartin Matuska.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 64616038816SMartin Matuska.No # Nm zfs Cm allow staff No @ Ns Ar pset tank/users 64716038816SMartin Matuska.No # Nm zfs Cm allow Ar tank/users 648eda14cbcSMatt Macy---- Permissions on tank/users --------------------------------------- 649eda14cbcSMatt MacyPermission sets: 650eda14cbcSMatt Macy @pset create,destroy,mount,snapshot 651eda14cbcSMatt MacyLocal+Descendent permissions: 652eda14cbcSMatt Macy group staff @pset 653eda14cbcSMatt Macy.Ed 65416038816SMartin Matuska. 655da5137abSMartin Matuska.Ss Example 20 : No Delegating Property Permissions on a ZFS Dataset 656eda14cbcSMatt MacyThe following example shows to grant the ability to set quotas and reservations 657eda14cbcSMatt Macyon the 65816038816SMartin Matuska.Ar users/home 659eda14cbcSMatt Macyfile system. 660eda14cbcSMatt MacyThe permissions on 66116038816SMartin Matuska.Ar users/home 662eda14cbcSMatt Macyare also displayed. 66316038816SMartin Matuska.Bd -literal -compact -offset Ds 66416038816SMartin Matuska.No # Nm zfs Cm allow Ar cindys Sy quota , Ns Sy reservation Ar users/home 66516038816SMartin Matuska.No # Nm zfs Cm allow Ar users/home 666eda14cbcSMatt Macy---- Permissions on users/home --------------------------------------- 667eda14cbcSMatt MacyLocal+Descendent permissions: 668eda14cbcSMatt Macy user cindys quota,reservation 669eda14cbcSMatt Macycindys% zfs set quota=10G users/home/marks 670eda14cbcSMatt Macycindys% zfs get quota users/home/marks 671eda14cbcSMatt MacyNAME PROPERTY VALUE SOURCE 672eda14cbcSMatt Macyusers/home/marks quota 10G local 673eda14cbcSMatt Macy.Ed 67416038816SMartin Matuska. 675da5137abSMartin Matuska.Ss Example 21 : No Removing ZFS Delegated Permissions on a ZFS Dataset 676eda14cbcSMatt MacyThe following example shows how to remove the snapshot permission from the 67716038816SMartin Matuska.Ar staff 678eda14cbcSMatt Macygroup on the 67916038816SMartin Matuska.Sy tank/users 680eda14cbcSMatt Macyfile system. 681eda14cbcSMatt MacyThe permissions on 68216038816SMartin Matuska.Sy tank/users 683eda14cbcSMatt Macyare also displayed. 68416038816SMartin Matuska.Bd -literal -compact -offset Ds 68516038816SMartin Matuska.No # Nm zfs Cm unallow Ar staff Sy snapshot Ar tank/users 68616038816SMartin Matuska.No # Nm zfs Cm allow Ar tank/users 687eda14cbcSMatt Macy---- Permissions on tank/users --------------------------------------- 688eda14cbcSMatt MacyPermission sets: 689eda14cbcSMatt Macy @pset create,destroy,mount,snapshot 690eda14cbcSMatt MacyLocal+Descendent permissions: 691eda14cbcSMatt Macy group staff @pset 692eda14cbcSMatt Macy.Ed 69316038816SMartin Matuska. 694da5137abSMartin Matuska.Ss Example 22 : No Showing the differences between a snapshot and a ZFS Dataset 695eda14cbcSMatt MacyThe following example shows how to see what has changed between a prior 696eda14cbcSMatt Macysnapshot of a ZFS dataset and its current state. 697eda14cbcSMatt MacyThe 698eda14cbcSMatt Macy.Fl F 699eda14cbcSMatt Macyoption is used to indicate type information for the files affected. 70016038816SMartin Matuska.Bd -literal -compact -offset Ds 70116038816SMartin Matuska.No # Nm zfs Cm diff Fl F Ar tank/test@before tank/test 702eda14cbcSMatt MacyM / /tank/test/ 703eda14cbcSMatt MacyM F /tank/test/linked (+1) 704eda14cbcSMatt MacyR F /tank/test/oldname -> /tank/test/newname 705eda14cbcSMatt Macy- F /tank/test/deleted 706eda14cbcSMatt Macy+ F /tank/test/created 707eda14cbcSMatt MacyM F /tank/test/modified 708eda14cbcSMatt Macy.Ed 70916038816SMartin Matuska. 710da5137abSMartin Matuska.Ss Example 23 : No Creating a bookmark 711716fd348SMartin MatuskaThe following example creates a bookmark to a snapshot. 712716fd348SMartin MatuskaThis bookmark can then be used instead of a snapshot in send streams. 71316038816SMartin Matuska.Dl # Nm zfs Cm bookmark Ar rpool Ns @ Ns Ar snapshot rpool Ns # Ns Ar bookmark 71416038816SMartin Matuska. 715da5137abSMartin Matuska.Ss Example 24 : No Setting Sy sharesmb No Property Options on a ZFS File System 716eda14cbcSMatt MacyThe following example show how to share SMB filesystem through ZFS. 71716038816SMartin MatuskaNote that a user and their password must be given. 71816038816SMartin Matuska.Dl # Nm smbmount Ar //127.0.0.1/share_tmp /mnt/tmp Fl o No user=workgroup/turbo,password=obrut,uid=1000 719eda14cbcSMatt Macy.Pp 720eda14cbcSMatt MacyMinimal 72116038816SMartin Matuska.Pa /etc/samba/smb.conf 72216038816SMartin Matuskaconfiguration is required, as follows. 723eda14cbcSMatt Macy.Pp 72416038816SMartin MatuskaSamba will need to bind to the loopback interface for the ZFS utilities to 725eda14cbcSMatt Macycommunicate with Samba. 726eda14cbcSMatt MacyThis is the default behavior for most Linux distributions. 727eda14cbcSMatt Macy.Pp 728eda14cbcSMatt MacySamba must be able to authenticate a user. 72916038816SMartin MatuskaThis can be done in a number of ways 73016038816SMartin Matuska.Pq Xr passwd 5 , LDAP , Xr smbpasswd 5 , &c.\& . 73116038816SMartin MatuskaHow to do this is outside the scope of this document – refer to 732eda14cbcSMatt Macy.Xr smb.conf 5 73316038816SMartin Matuskafor more information. 734eda14cbcSMatt Macy.Pp 735eda14cbcSMatt MacySee the 73616038816SMartin Matuska.Sx USERSHARES 73716038816SMartin Matuskasection for all configuration options, 73816038816SMartin Matuskain case you need to modify any options of the share afterwards. 739eda14cbcSMatt MacyDo note that any changes done with the 740eda14cbcSMatt Macy.Xr net 8 74116038816SMartin Matuskacommand will be undone if the share is ever unshared (like via a reboot). 74216038816SMartin Matuska. 743eda14cbcSMatt Macy.Sh ENVIRONMENT VARIABLES 744e3aa18adSMartin Matuska.Bl -tag -width "ZFS_MODULE_TIMEOUT" 74515f0b8c3SMartin Matuska.It Sy ZFS_COLOR 74615f0b8c3SMartin MatuskaUse ANSI color in 74715f0b8c3SMartin Matuska.Nm zfs Cm diff 7482a58b312SMartin Matuskaand 7492a58b312SMartin Matuska.Nm zfs Cm list 75015f0b8c3SMartin Matuskaoutput. 75116038816SMartin Matuska.It Sy ZFS_MOUNT_HELPER 752eda14cbcSMatt MacyCause 75316038816SMartin Matuska.Nm zfs Cm mount 754eda14cbcSMatt Macyto use 75516038816SMartin Matuska.Xr mount 8 75616038816SMartin Matuskato mount ZFS datasets. 75716038816SMartin MatuskaThis option is provided for backwards compatibility with older ZFS versions. 758e3aa18adSMartin Matuska. 759716fd348SMartin Matuska.It Sy ZFS_SET_PIPE_MAX 760716fd348SMartin MatuskaTells 761716fd348SMartin Matuska.Nm zfs 762*c6767dc1SMartin Matuskato set the maximum pipe size for sends/receives. 763716fd348SMartin MatuskaDisabled by default on Linux 764716fd348SMartin Matuskadue to an unfixed deadlock in Linux's pipe size handling code. 765e3aa18adSMartin Matuska. 766e3aa18adSMartin Matuska.\" Shared with zpool.8 767e3aa18adSMartin Matuska.It Sy ZFS_MODULE_TIMEOUT 768e3aa18adSMartin MatuskaTime, in seconds, to wait for 769e3aa18adSMartin Matuska.Pa /dev/zfs 770e3aa18adSMartin Matuskato appear. 771e3aa18adSMartin MatuskaDefaults to 772e3aa18adSMartin Matuska.Sy 10 , 773e3aa18adSMartin Matuskamax 774e3aa18adSMartin Matuska.Sy 600 Pq 10 minutes . 775e3aa18adSMartin MatuskaIf 776e3aa18adSMartin Matuska.Pf < Sy 0 , 777e3aa18adSMartin Matuskawait forever; if 778e3aa18adSMartin Matuska.Sy 0 , 779e3aa18adSMartin Matuskadon't wait. 780716fd348SMartin Matuska.El 78116038816SMartin Matuska. 782eda14cbcSMatt Macy.Sh INTERFACE STABILITY 783eda14cbcSMatt Macy.Sy Committed . 78416038816SMartin Matuska. 785eda14cbcSMatt Macy.Sh SEE ALSO 786eda14cbcSMatt Macy.Xr attr 1 , 787eda14cbcSMatt Macy.Xr gzip 1 , 788eda14cbcSMatt Macy.Xr ssh 1 , 789eda14cbcSMatt Macy.Xr chmod 2 , 790eda14cbcSMatt Macy.Xr fsync 2 , 791eda14cbcSMatt Macy.Xr stat 2 , 792eda14cbcSMatt Macy.Xr write 2 , 793eda14cbcSMatt Macy.Xr acl 5 , 794eda14cbcSMatt Macy.Xr attributes 5 , 795eda14cbcSMatt Macy.Xr exports 5 , 7963ff01b23SMartin Matuska.Xr zfsconcepts 7 , 7973ff01b23SMartin Matuska.Xr zfsprops 7 , 798eda14cbcSMatt Macy.Xr exportfs 8 , 799eda14cbcSMatt Macy.Xr mount 8 , 800eda14cbcSMatt Macy.Xr net 8 , 801eda14cbcSMatt Macy.Xr selinux 8 , 802ac0bf12eSMatt Macy.Xr zfs-allow 8 , 803ac0bf12eSMatt Macy.Xr zfs-bookmark 8 , 804ac0bf12eSMatt Macy.Xr zfs-change-key 8 , 805ac0bf12eSMatt Macy.Xr zfs-clone 8 , 806ac0bf12eSMatt Macy.Xr zfs-create 8 , 807ac0bf12eSMatt Macy.Xr zfs-destroy 8 , 808ac0bf12eSMatt Macy.Xr zfs-diff 8 , 809ac0bf12eSMatt Macy.Xr zfs-get 8 , 810ac0bf12eSMatt Macy.Xr zfs-groupspace 8 , 811ac0bf12eSMatt Macy.Xr zfs-hold 8 , 812ac0bf12eSMatt Macy.Xr zfs-inherit 8 , 813ac0bf12eSMatt Macy.Xr zfs-jail 8 , 814ac0bf12eSMatt Macy.Xr zfs-list 8 , 815ac0bf12eSMatt Macy.Xr zfs-load-key 8 , 816ac0bf12eSMatt Macy.Xr zfs-mount 8 , 817ac0bf12eSMatt Macy.Xr zfs-program 8 , 818ac0bf12eSMatt Macy.Xr zfs-project 8 , 819ac0bf12eSMatt Macy.Xr zfs-projectspace 8 , 820ac0bf12eSMatt Macy.Xr zfs-promote 8 , 821ac0bf12eSMatt Macy.Xr zfs-receive 8 , 822ac0bf12eSMatt Macy.Xr zfs-redact 8 , 823ac0bf12eSMatt Macy.Xr zfs-release 8 , 824ac0bf12eSMatt Macy.Xr zfs-rename 8 , 825ac0bf12eSMatt Macy.Xr zfs-rollback 8 , 826ac0bf12eSMatt Macy.Xr zfs-send 8 , 827ac0bf12eSMatt Macy.Xr zfs-set 8 , 828ac0bf12eSMatt Macy.Xr zfs-share 8 , 829ac0bf12eSMatt Macy.Xr zfs-snapshot 8 , 830ac0bf12eSMatt Macy.Xr zfs-unallow 8 , 831ac0bf12eSMatt Macy.Xr zfs-unjail 8 , 832ac0bf12eSMatt Macy.Xr zfs-unload-key 8 , 833ac0bf12eSMatt Macy.Xr zfs-unmount 8 , 834ac0bf12eSMatt Macy.Xr zfs-unshare 8 , 835ac0bf12eSMatt Macy.Xr zfs-upgrade 8 , 836ac0bf12eSMatt Macy.Xr zfs-userspace 8 , 837ac0bf12eSMatt Macy.Xr zfs-wait 8 , 838eda14cbcSMatt Macy.Xr zpool 8 839