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.\" 32da5137abSMartin 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 173*716fd348SMartin MatuskaRevert the property to the received value, if one exists; 174*716fd348SMartin Matuskaotherwise, for non-inheritable properties, to the default; 175*716fd348SMartin Matuskaotherwise, operate as if the 176eda14cbcSMatt Macy.Fl S 177eda14cbcSMatt Macyoption was not specified. 178eda14cbcSMatt Macy.El 179eda14cbcSMatt Macy.El 18016038816SMartin Matuska. 181da5137abSMartin Matuska.Sh EXAMPLES 182da5137abSMartin Matuska.\" These are, respectively, examples 1, 4, 6, 7, 11, 14, 16 from zfs.8 183da5137abSMartin Matuska.\" Make sure to update them bidirectionally 184da5137abSMartin Matuska.Ss Example 1 : No Creating a ZFS File System Hierarchy 185da5137abSMartin MatuskaThe following commands create a file system named 186da5137abSMartin Matuska.Ar pool/home 187da5137abSMartin Matuskaand a file system named 188da5137abSMartin Matuska.Ar pool/home/bob . 189da5137abSMartin MatuskaThe mount point 190da5137abSMartin Matuska.Pa /export/home 191da5137abSMartin Matuskais set for the parent file system, and is automatically inherited by the child 192da5137abSMartin Matuskafile system. 193da5137abSMartin Matuska.Dl # Nm zfs Cm create Ar pool/home 194da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy mountpoint Ns = Ns Ar /export/home pool/home 195da5137abSMartin Matuska.Dl # Nm zfs Cm create Ar pool/home/bob 196da5137abSMartin Matuska. 197da5137abSMartin Matuska.Ss Example 2 : No Disabling and Enabling File System Compression 198da5137abSMartin MatuskaThe following command disables the 199da5137abSMartin Matuska.Sy compression 200da5137abSMartin Matuskaproperty for all file systems under 201da5137abSMartin Matuska.Ar pool/home . 202da5137abSMartin MatuskaThe next command explicitly enables 203da5137abSMartin Matuska.Sy compression 204da5137abSMartin Matuskafor 205da5137abSMartin Matuska.Ar pool/home/anne . 206da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy off Ar pool/home 207da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy compression Ns = Ns Sy on Ar pool/home/anne 208da5137abSMartin Matuska. 209da5137abSMartin Matuska.Ss Example 3 : No Setting a Quota on a ZFS File System 210da5137abSMartin MatuskaThe following command sets a quota of 50 Gbytes for 211da5137abSMartin Matuska.Ar pool/home/bob : 212da5137abSMartin Matuska.Dl # Nm zfs Cm set Sy quota Ns = Ns Ar 50G pool/home/bob 213da5137abSMartin Matuska. 214da5137abSMartin Matuska.Ss Example 4 : No Listing ZFS Properties 215da5137abSMartin MatuskaThe following command lists all properties for 216da5137abSMartin Matuska.Ar pool/home/bob : 217da5137abSMartin Matuska.Bd -literal -compact -offset Ds 218da5137abSMartin Matuska.No # Nm zfs Cm get Sy all Ar pool/home/bob 219da5137abSMartin MatuskaNAME PROPERTY VALUE SOURCE 220da5137abSMartin Matuskapool/home/bob type filesystem - 221da5137abSMartin Matuskapool/home/bob creation Tue Jul 21 15:53 2009 - 222da5137abSMartin Matuskapool/home/bob used 21K - 223da5137abSMartin Matuskapool/home/bob available 20.0G - 224da5137abSMartin Matuskapool/home/bob referenced 21K - 225da5137abSMartin Matuskapool/home/bob compressratio 1.00x - 226da5137abSMartin Matuskapool/home/bob mounted yes - 227da5137abSMartin Matuskapool/home/bob quota 20G local 228da5137abSMartin Matuskapool/home/bob reservation none default 229da5137abSMartin Matuskapool/home/bob recordsize 128K default 230da5137abSMartin Matuskapool/home/bob mountpoint /pool/home/bob default 231da5137abSMartin Matuskapool/home/bob sharenfs off default 232da5137abSMartin Matuskapool/home/bob checksum on default 233da5137abSMartin Matuskapool/home/bob compression on local 234da5137abSMartin Matuskapool/home/bob atime on default 235da5137abSMartin Matuskapool/home/bob devices on default 236da5137abSMartin Matuskapool/home/bob exec on default 237da5137abSMartin Matuskapool/home/bob setuid on default 238da5137abSMartin Matuskapool/home/bob readonly off default 239da5137abSMartin Matuskapool/home/bob zoned off default 240da5137abSMartin Matuskapool/home/bob snapdir hidden default 241da5137abSMartin Matuskapool/home/bob acltype off default 242da5137abSMartin Matuskapool/home/bob aclmode discard default 243da5137abSMartin Matuskapool/home/bob aclinherit restricted default 244da5137abSMartin Matuskapool/home/bob canmount on default 245da5137abSMartin Matuskapool/home/bob xattr on default 246da5137abSMartin Matuskapool/home/bob copies 1 default 247da5137abSMartin Matuskapool/home/bob version 4 - 248da5137abSMartin Matuskapool/home/bob utf8only off - 249da5137abSMartin Matuskapool/home/bob normalization none - 250da5137abSMartin Matuskapool/home/bob casesensitivity sensitive - 251da5137abSMartin Matuskapool/home/bob vscan off default 252da5137abSMartin Matuskapool/home/bob nbmand off default 253da5137abSMartin Matuskapool/home/bob sharesmb off default 254da5137abSMartin Matuskapool/home/bob refquota none default 255da5137abSMartin Matuskapool/home/bob refreservation none default 256da5137abSMartin Matuskapool/home/bob primarycache all default 257da5137abSMartin Matuskapool/home/bob secondarycache all default 258da5137abSMartin Matuskapool/home/bob usedbysnapshots 0 - 259da5137abSMartin Matuskapool/home/bob usedbydataset 21K - 260da5137abSMartin Matuskapool/home/bob usedbychildren 0 - 261da5137abSMartin Matuskapool/home/bob usedbyrefreservation 0 - 262da5137abSMartin Matuska.Ed 263da5137abSMartin Matuska.Pp 264da5137abSMartin MatuskaThe following command gets a single property value: 265da5137abSMartin Matuska.Bd -literal -compact -offset Ds 266da5137abSMartin Matuska.No # Nm zfs Cm get Fl H o Sy value compression Ar pool/home/bob 267da5137abSMartin Matuskaon 268da5137abSMartin Matuska.Ed 269da5137abSMartin Matuska.Pp 270da5137abSMartin MatuskaThe following command lists all properties with local settings for 271da5137abSMartin Matuska.Ar pool/home/bob : 272da5137abSMartin Matuska.Bd -literal -compact -offset Ds 273da5137abSMartin 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 274da5137abSMartin MatuskaNAME PROPERTY VALUE 275da5137abSMartin Matuskapool/home/bob quota 20G 276da5137abSMartin Matuskapool/home/bob compression on 277da5137abSMartin Matuska.Ed 278da5137abSMartin Matuska. 279da5137abSMartin Matuska.Ss Example 5 : No Inheriting ZFS Properties 280da5137abSMartin MatuskaThe following command causes 281da5137abSMartin Matuska.Ar pool/home/bob No and Ar pool/home/anne 282da5137abSMartin Matuskato inherit the 283da5137abSMartin Matuska.Sy checksum 284da5137abSMartin Matuskaproperty from their parent. 285da5137abSMartin Matuska.Dl # Nm zfs Cm inherit Sy checksum Ar pool/home/bob pool/home/anne 286da5137abSMartin Matuska. 287da5137abSMartin Matuska.Ss Example 6 : No Setting User Properties 288da5137abSMartin MatuskaThe following example sets the user-defined 289da5137abSMartin Matuska.Ar com.example : Ns Ar department 290da5137abSMartin Matuskaproperty for a dataset: 291da5137abSMartin Matuska.Dl # Nm zfs Cm set Ar com.example : Ns Ar department Ns = Ns Ar 12345 tank/accounting 292da5137abSMartin Matuska. 293da5137abSMartin Matuska.Ss Example 7 : No Setting sharenfs Property Options on a ZFS File System 294da5137abSMartin MatuskaThe following commands show how to set 295da5137abSMartin Matuska.Sy sharenfs 296da5137abSMartin Matuskaproperty options to enable read-write 297da5137abSMartin Matuskaaccess for a set of IP addresses and to enable root access for system 298da5137abSMartin Matuska.Qq neo 299da5137abSMartin Matuskaon the 300da5137abSMartin Matuska.Ar tank/home 301da5137abSMartin Matuskafile system: 302da5137abSMartin 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 303da5137abSMartin Matuska.Pp 304da5137abSMartin MatuskaIf you are using DNS for host name resolution, 305da5137abSMartin Matuskaspecify the fully-qualified hostname. 306da5137abSMartin Matuska. 307eda14cbcSMatt Macy.Sh SEE ALSO 3083ff01b23SMartin Matuska.Xr zfsprops 7 , 3093ff01b23SMartin Matuska.Xr zfs-list 8 310