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 9eda14cbcSMatt Macy.\" or http://www.opensolaris.org/os/licensing. 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) 2013 by Saso Kiselkov. All rights reserved. 25eda14cbcSMatt Macy.\" Copyright (c) 2014, Joyent, Inc. All rights reserved. 26eda14cbcSMatt Macy.\" Copyright (c) 2014 by Adam Stevko. All rights reserved. 27eda14cbcSMatt Macy.\" Copyright (c) 2014 Integros [integros.com] 28eda14cbcSMatt Macy.\" Copyright 2019 Richard Laager. All rights reserved. 29eda14cbcSMatt Macy.\" Copyright 2018 Nexenta Systems, Inc. 30eda14cbcSMatt Macy.\" Copyright 2019 Joyent, Inc. 31eda14cbcSMatt Macy.\" 32*da5137abSMartin Matuska.Dd March 16, 2022 33eda14cbcSMatt Macy.Dt ZFS-SET 8 34eda14cbcSMatt Macy.Os 3516038816SMartin Matuska. 36eda14cbcSMatt Macy.Sh NAME 377877fdebSMatt Macy.Nm zfs-set 3816038816SMartin Matuska.Nd set properties on ZFS datasets 39eda14cbcSMatt Macy.Sh SYNOPSIS 407877fdebSMatt Macy.Nm zfs 41eda14cbcSMatt Macy.Cm set 4216038816SMartin Matuska.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns … 4316038816SMartin Matuska.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns … 447877fdebSMatt Macy.Nm zfs 45eda14cbcSMatt Macy.Cm get 46eda14cbcSMatt Macy.Op Fl r Ns | Ns Fl d Ar depth 47eda14cbcSMatt Macy.Op Fl Hp 4816038816SMartin Matuska.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns … Oc 4916038816SMartin Matuska.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns … Oc 5016038816SMartin Matuska.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns … Oc 5116038816SMartin Matuska.Cm all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns … 5216038816SMartin Matuska.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns … 537877fdebSMatt Macy.Nm zfs 54eda14cbcSMatt Macy.Cm inherit 55eda14cbcSMatt Macy.Op Fl rS 5616038816SMartin Matuska.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns … 5716038816SMartin Matuska. 58eda14cbcSMatt Macy.Sh DESCRIPTION 59eda14cbcSMatt Macy.Bl -tag -width "" 60eda14cbcSMatt Macy.It Xo 617877fdebSMatt Macy.Nm zfs 62eda14cbcSMatt Macy.Cm set 6316038816SMartin Matuska.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns … 6416038816SMartin Matuska.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns … 65eda14cbcSMatt Macy.Xc 66eda14cbcSMatt MacyOnly some properties can be edited. 67eda14cbcSMatt MacySee 683ff01b23SMartin Matuska.Xr zfsprops 7 69eda14cbcSMatt Macyfor more information on what properties can be set and acceptable 70eda14cbcSMatt Macyvalues. 71eda14cbcSMatt MacyNumeric values can be specified as exact values, or in a human-readable form 72eda14cbcSMatt Macywith a suffix of 73eda14cbcSMatt Macy.Sy B , K , M , G , T , P , E , Z 74eda14cbcSMatt Macy.Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, 75eda14cbcSMatt Macyor zettabytes, respectively 76eda14cbcSMatt Macy.Pc . 77eda14cbcSMatt MacyUser properties can be set on snapshots. 78eda14cbcSMatt MacyFor more information, see the 79eda14cbcSMatt Macy.Em User Properties 80eda14cbcSMatt Macysection of 813ff01b23SMartin Matuska.Xr zfsprops 7 . 82eda14cbcSMatt Macy.It Xo 837877fdebSMatt Macy.Nm zfs 84eda14cbcSMatt Macy.Cm get 85eda14cbcSMatt Macy.Op Fl r Ns | Ns Fl d Ar depth 86eda14cbcSMatt Macy.Op Fl Hp 8716038816SMartin Matuska.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns … Oc 8816038816SMartin Matuska.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns … Oc 8916038816SMartin Matuska.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns … Oc 9016038816SMartin Matuska.Cm all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns … 9116038816SMartin Matuska.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns … 92eda14cbcSMatt Macy.Xc 93eda14cbcSMatt MacyDisplays properties for the given datasets. 94eda14cbcSMatt MacyIf no datasets are specified, then the command displays properties for all 95eda14cbcSMatt Macydatasets on the system. 96eda14cbcSMatt MacyFor each property, the following columns are displayed: 9716038816SMartin Matuska.Bl -tag -compact -offset 4n -width "property" 9816038816SMartin Matuska.It Sy name 9916038816SMartin MatuskaDataset name 10016038816SMartin Matuska.It Sy property 10116038816SMartin MatuskaProperty name 10216038816SMartin Matuska.It Sy value 10316038816SMartin MatuskaProperty value 10416038816SMartin Matuska.It Sy source 10516038816SMartin MatuskaProperty source 10616038816SMartin Matuska.Sy local , default , inherited , temporary , received , No or Sy - Pq none . 10716038816SMartin Matuska.El 108eda14cbcSMatt Macy.Pp 109eda14cbcSMatt MacyAll columns are displayed by default, though this can be controlled by using the 110eda14cbcSMatt Macy.Fl o 111eda14cbcSMatt Macyoption. 112eda14cbcSMatt MacyThis command takes a comma-separated list of properties as described in the 11316038816SMartin Matuska.Sx Native Properties 114eda14cbcSMatt Macyand 11516038816SMartin Matuska.Sx User Properties 116eda14cbcSMatt Macysections of 1173ff01b23SMartin Matuska.Xr zfsprops 7 . 118eda14cbcSMatt Macy.Pp 119eda14cbcSMatt MacyThe value 120eda14cbcSMatt Macy.Sy all 121eda14cbcSMatt Macycan be used to display all properties that apply to the given dataset's type 12216038816SMartin Matuska.Pq Sy filesystem , volume , snapshot , No or Sy bookmark . 12316038816SMartin Matuska.Bl -tag -width "-s source" 124eda14cbcSMatt Macy.It Fl H 125eda14cbcSMatt MacyDisplay output in a form more easily parsed by scripts. 126eda14cbcSMatt MacyAny headers are omitted, and fields are explicitly separated by a single tab 127eda14cbcSMatt Macyinstead of an arbitrary amount of space. 128eda14cbcSMatt Macy.It Fl d Ar depth 129eda14cbcSMatt MacyRecursively display any children of the dataset, limiting the recursion to 130eda14cbcSMatt Macy.Ar depth . 131eda14cbcSMatt MacyA depth of 132eda14cbcSMatt Macy.Sy 1 133eda14cbcSMatt Macywill display only the dataset and its direct children. 134eda14cbcSMatt Macy.It Fl o Ar field 13516038816SMartin MatuskaA comma-separated list of columns to display, defaults to 13616038816SMartin Matuska.Sy name , Ns Sy property , Ns Sy value , Ns Sy source . 137eda14cbcSMatt Macy.It Fl p 138eda14cbcSMatt MacyDisplay numbers in parsable 139eda14cbcSMatt Macy.Pq exact 140eda14cbcSMatt Macyvalues. 141eda14cbcSMatt Macy.It Fl r 142eda14cbcSMatt MacyRecursively display properties for any children. 143eda14cbcSMatt Macy.It Fl s Ar source 144eda14cbcSMatt MacyA comma-separated list of sources to display. 145eda14cbcSMatt MacyThose properties coming from a source other than those in this list are ignored. 146eda14cbcSMatt MacyEach source must be one of the following: 14716038816SMartin Matuska.Sy local , default , inherited , temporary , received , No or Sy none . 148eda14cbcSMatt MacyThe default value is all sources. 149eda14cbcSMatt Macy.It Fl t Ar type 150eda14cbcSMatt MacyA comma-separated list of types to display, where 151eda14cbcSMatt Macy.Ar type 152eda14cbcSMatt Macyis one of 15316038816SMartin Matuska.Sy filesystem , snapshot , volume , bookmark , No or Sy all . 154eda14cbcSMatt Macy.El 155eda14cbcSMatt Macy.It Xo 1567877fdebSMatt Macy.Nm zfs 157eda14cbcSMatt Macy.Cm inherit 158eda14cbcSMatt Macy.Op Fl rS 15916038816SMartin Matuska.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns … 160eda14cbcSMatt Macy.Xc 161eda14cbcSMatt MacyClears the specified property, causing it to be inherited from an ancestor, 162eda14cbcSMatt Macyrestored to default if no ancestor has the property set, or with the 163eda14cbcSMatt Macy.Fl S 164eda14cbcSMatt Macyoption reverted to the received value if one exists. 165eda14cbcSMatt MacySee 1663ff01b23SMartin Matuska.Xr zfsprops 7 167eda14cbcSMatt Macyfor a listing of default values, and details on which properties can be 168eda14cbcSMatt Macyinherited. 169eda14cbcSMatt Macy.Bl -tag -width "-r" 170eda14cbcSMatt Macy.It Fl r 171eda14cbcSMatt MacyRecursively inherit the given property for all children. 172eda14cbcSMatt Macy.It Fl S 173eda14cbcSMatt MacyRevert the property to the received value if one exists; otherwise operate as 174eda14cbcSMatt Macyif the 175eda14cbcSMatt Macy.Fl S 176eda14cbcSMatt Macyoption was not specified. 177eda14cbcSMatt Macy.El 178eda14cbcSMatt Macy.El 17916038816SMartin Matuska. 180*da5137abSMartin Matuska.Sh EXAMPLES 181*da5137abSMartin Matuska.\" These are, respectively, examples 1, 4, 6, 7, 11, 14, 16 from zfs.8 182*da5137abSMartin Matuska.\" Make sure to update them bidirectionally 183*da5137abSMartin Matuska.Ss Example 1 : No Creating a ZFS File System Hierarchy 184*da5137abSMartin MatuskaThe following commands create a file system named 185*da5137abSMartin Matuska.Ar pool/home 186*da5137abSMartin Matuskaand a file system named 187*da5137abSMartin Matuska.Ar pool/home/bob . 188*da5137abSMartin MatuskaThe mount point 189*da5137abSMartin Matuska.Pa /export/home 190*da5137abSMartin Matuskais set for the parent file system, and is automatically inherited by the child 191*da5137abSMartin Matuskafile system. 192*da5137abSMartin Matuska.Dl # Nm zfs Cm create Ar pool/home 193*da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy mountpoint Ns = Ns Ar /export/home pool/home 194*da5137abSMartin Matuska.Dl # Nm zfs Cm create Ar pool/home/bob 195*da5137abSMartin Matuska. 196*da5137abSMartin Matuska.Ss Example 2 : No Disabling and Enabling File System Compression 197*da5137abSMartin MatuskaThe following command disables the 198*da5137abSMartin Matuska.Sy compression 199*da5137abSMartin Matuskaproperty for all file systems under 200*da5137abSMartin Matuska.Ar pool/home . 201*da5137abSMartin MatuskaThe next command explicitly enables 202*da5137abSMartin Matuska.Sy compression 203*da5137abSMartin Matuskafor 204*da5137abSMartin Matuska.Ar pool/home/anne . 205*da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy off Ar pool/home 206*da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy on Ar pool/home/anne 207*da5137abSMartin Matuska. 208*da5137abSMartin Matuska.Ss Example 3 : No Setting a Quota on a ZFS File System 209*da5137abSMartin MatuskaThe following command sets a quota of 50 Gbytes for 210*da5137abSMartin Matuska.Ar pool/home/bob : 211*da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy quota Ns = Ns Ar 50G pool/home/bob 212*da5137abSMartin Matuska. 213*da5137abSMartin Matuska.Ss Example 4 : No Listing ZFS Properties 214*da5137abSMartin MatuskaThe following command lists all properties for 215*da5137abSMartin Matuska.Ar pool/home/bob : 216*da5137abSMartin Matuska.Bd -literal -compact -offset Ds 217*da5137abSMartin Matuska.No # Nm zfs Cm get Sy all Ar pool/home/bob 218*da5137abSMartin MatuskaNAME PROPERTY VALUE SOURCE 219*da5137abSMartin Matuskapool/home/bob type filesystem - 220*da5137abSMartin Matuskapool/home/bob creation Tue Jul 21 15:53 2009 - 221*da5137abSMartin Matuskapool/home/bob used 21K - 222*da5137abSMartin Matuskapool/home/bob available 20.0G - 223*da5137abSMartin Matuskapool/home/bob referenced 21K - 224*da5137abSMartin Matuskapool/home/bob compressratio 1.00x - 225*da5137abSMartin Matuskapool/home/bob mounted yes - 226*da5137abSMartin Matuskapool/home/bob quota 20G local 227*da5137abSMartin Matuskapool/home/bob reservation none default 228*da5137abSMartin Matuskapool/home/bob recordsize 128K default 229*da5137abSMartin Matuskapool/home/bob mountpoint /pool/home/bob default 230*da5137abSMartin Matuskapool/home/bob sharenfs off default 231*da5137abSMartin Matuskapool/home/bob checksum on default 232*da5137abSMartin Matuskapool/home/bob compression on local 233*da5137abSMartin Matuskapool/home/bob atime on default 234*da5137abSMartin Matuskapool/home/bob devices on default 235*da5137abSMartin Matuskapool/home/bob exec on default 236*da5137abSMartin Matuskapool/home/bob setuid on default 237*da5137abSMartin Matuskapool/home/bob readonly off default 238*da5137abSMartin Matuskapool/home/bob zoned off default 239*da5137abSMartin Matuskapool/home/bob snapdir hidden default 240*da5137abSMartin Matuskapool/home/bob acltype off default 241*da5137abSMartin Matuskapool/home/bob aclmode discard default 242*da5137abSMartin Matuskapool/home/bob aclinherit restricted default 243*da5137abSMartin Matuskapool/home/bob canmount on default 244*da5137abSMartin Matuskapool/home/bob xattr on default 245*da5137abSMartin Matuskapool/home/bob copies 1 default 246*da5137abSMartin Matuskapool/home/bob version 4 - 247*da5137abSMartin Matuskapool/home/bob utf8only off - 248*da5137abSMartin Matuskapool/home/bob normalization none - 249*da5137abSMartin Matuskapool/home/bob casesensitivity sensitive - 250*da5137abSMartin Matuskapool/home/bob vscan off default 251*da5137abSMartin Matuskapool/home/bob nbmand off default 252*da5137abSMartin Matuskapool/home/bob sharesmb off default 253*da5137abSMartin Matuskapool/home/bob refquota none default 254*da5137abSMartin Matuskapool/home/bob refreservation none default 255*da5137abSMartin Matuskapool/home/bob primarycache all default 256*da5137abSMartin Matuskapool/home/bob secondarycache all default 257*da5137abSMartin Matuskapool/home/bob usedbysnapshots 0 - 258*da5137abSMartin Matuskapool/home/bob usedbydataset 21K - 259*da5137abSMartin Matuskapool/home/bob usedbychildren 0 - 260*da5137abSMartin Matuskapool/home/bob usedbyrefreservation 0 - 261*da5137abSMartin Matuska.Ed 262*da5137abSMartin Matuska.Pp 263*da5137abSMartin MatuskaThe following command gets a single property value: 264*da5137abSMartin Matuska.Bd -literal -compact -offset Ds 265*da5137abSMartin Matuska.No # Nm zfs Cm get Fl H o Sy value compression Ar pool/home/bob 266*da5137abSMartin Matuskaon 267*da5137abSMartin Matuska.Ed 268*da5137abSMartin Matuska.Pp 269*da5137abSMartin MatuskaThe following command lists all properties with local settings for 270*da5137abSMartin Matuska.Ar pool/home/bob : 271*da5137abSMartin Matuska.Bd -literal -compact -offset Ds 272*da5137abSMartin 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 273*da5137abSMartin MatuskaNAME PROPERTY VALUE 274*da5137abSMartin Matuskapool/home/bob quota 20G 275*da5137abSMartin Matuskapool/home/bob compression on 276*da5137abSMartin Matuska.Ed 277*da5137abSMartin Matuska. 278*da5137abSMartin Matuska.Ss Example 5 : No Inheriting ZFS Properties 279*da5137abSMartin MatuskaThe following command causes 280*da5137abSMartin Matuska.Ar pool/home/bob No and Ar pool/home/anne 281*da5137abSMartin Matuskato inherit the 282*da5137abSMartin Matuska.Sy checksum 283*da5137abSMartin Matuskaproperty from their parent. 284*da5137abSMartin Matuska.Dl # Nm zfs Cm inherit Sy checksum Ar pool/home/bob pool/home/anne 285*da5137abSMartin Matuska. 286*da5137abSMartin Matuska.Ss Example 6 : No Setting User Properties 287*da5137abSMartin MatuskaThe following example sets the user-defined 288*da5137abSMartin Matuska.Ar com.example : Ns Ar department 289*da5137abSMartin Matuskaproperty for a dataset: 290*da5137abSMartin Matuska.Dl # Nm zfs Cm set Ar com.example : Ns Ar department Ns = Ns Ar 12345 tank/accounting 291*da5137abSMartin Matuska. 292*da5137abSMartin Matuska.Ss Example 7 : No Setting sharenfs Property Options on a ZFS File System 293*da5137abSMartin MatuskaThe following commands show how to set 294*da5137abSMartin Matuska.Sy sharenfs 295*da5137abSMartin Matuskaproperty options to enable read-write 296*da5137abSMartin Matuskaaccess for a set of IP addresses and to enable root access for system 297*da5137abSMartin Matuska.Qq neo 298*da5137abSMartin Matuskaon the 299*da5137abSMartin Matuska.Ar tank/home 300*da5137abSMartin Matuskafile system: 301*da5137abSMartin 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 302*da5137abSMartin Matuska.Pp 303*da5137abSMartin MatuskaIf you are using DNS for host name resolution, 304*da5137abSMartin Matuskaspecify the fully-qualified hostname. 305*da5137abSMartin Matuska. 306eda14cbcSMatt Macy.Sh SEE ALSO 3073ff01b23SMartin Matuska.Xr zfsprops 7 , 3083ff01b23SMartin Matuska.Xr zfs-list 8 309