The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/contrib/openzfs/man/man8/zfs-set.8

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    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 https://opensource.org/licenses/CDDL-1.0.
   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) 2013 by Saso Kiselkov. All rights reserved.
   25 .\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
   26 .\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
   27 .\" Copyright (c) 2014 Integros [integros.com]
   28 .\" Copyright 2019 Richard Laager. All rights reserved.
   29 .\" Copyright 2018 Nexenta Systems, Inc.
   30 .\" Copyright 2019 Joyent, Inc.
   31 .\"
   32 .Dd March 16, 2022
   33 .Dt ZFS-SET 8
   34 .Os
   35 .
   36 .Sh NAME
   37 .Nm zfs-set
   38 .Nd set properties on ZFS datasets
   39 .Sh SYNOPSIS
   40 .Nm zfs
   41 .Cm set
   42 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns …
   43 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns …
   44 .Nm zfs
   45 .Cm get
   46 .Op Fl r Ns | Ns Fl d Ar depth
   47 .Op Fl Hp
   48 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns … Oc
   49 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns … Oc
   50 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns … Oc
   51 .Cm all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns …
   52 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns …
   53 .Nm zfs
   54 .Cm inherit
   55 .Op Fl rS
   56 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns …
   57 .
   58 .Sh DESCRIPTION
   59 .Bl -tag -width ""
   60 .It Xo
   61 .Nm zfs
   62 .Cm set
   63 .Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns …
   64 .Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns …
   65 .Xc
   66 Only some properties can be edited.
   67 See
   68 .Xr zfsprops 7
   69 for more information on what properties can be set and acceptable
   70 values.
   71 Numeric values can be specified as exact values, or in a human-readable form
   72 with a suffix of
   73 .Sy B , K , M , G , T , P , E , Z
   74 .Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
   75 or zettabytes, respectively
   76 .Pc .
   77 User properties can be set on snapshots.
   78 For more information, see the
   79 .Em User Properties
   80 section of
   81 .Xr zfsprops 7 .
   82 .It Xo
   83 .Nm zfs
   84 .Cm get
   85 .Op Fl r Ns | Ns Fl d Ar depth
   86 .Op Fl Hp
   87 .Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns … Oc
   88 .Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns … Oc
   89 .Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns … Oc
   90 .Cm all Ns | Ns Ar property Ns Oo , Ns Ar property Oc Ns …
   91 .Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns …
   92 .Xc
   93 Displays properties for the given datasets.
   94 If no datasets are specified, then the command displays properties for all
   95 datasets on the system.
   96 For each property, the following columns are displayed:
   97 .Bl -tag -compact -offset 4n -width "property"
   98 .It Sy name
   99 Dataset name
  100 .It Sy property
  101 Property name
  102 .It Sy value
  103 Property value
  104 .It Sy source
  105 Property source
  106 .Sy local , default , inherited , temporary , received , No or Sy - Pq none .
  107 .El
  108 .Pp
  109 All columns are displayed by default, though this can be controlled by using the
  110 .Fl o
  111 option.
  112 This command takes a comma-separated list of properties as described in the
  113 .Sx Native Properties
  114 and
  115 .Sx User Properties
  116 sections of
  117 .Xr zfsprops 7 .
  118 .Pp
  119 The value
  120 .Sy all
  121 can be used to display all properties that apply to the given dataset's type
  122 .Pq Sy filesystem , volume , snapshot , No or Sy bookmark .
  123 .Bl -tag -width "-s source"
  124 .It Fl H
  125 Display output in a form more easily parsed by scripts.
  126 Any headers are omitted, and fields are explicitly separated by a single tab
  127 instead of an arbitrary amount of space.
  128 .It Fl d Ar depth
  129 Recursively display any children of the dataset, limiting the recursion to
  130 .Ar depth .
  131 A depth of
  132 .Sy 1
  133 will display only the dataset and its direct children.
  134 .It Fl o Ar field
  135 A comma-separated list of columns to display, defaults to
  136 .Sy name , Ns Sy property , Ns Sy value , Ns Sy source .
  137 .It Fl p
  138 Display numbers in parsable
  139 .Pq exact
  140 values.
  141 .It Fl r
  142 Recursively display properties for any children.
  143 .It Fl s Ar source
  144 A comma-separated list of sources to display.
  145 Those properties coming from a source other than those in this list are ignored.
  146 Each source must be one of the following:
  147 .Sy local , default , inherited , temporary , received , No or Sy none .
  148 The default value is all sources.
  149 .It Fl t Ar type
  150 A comma-separated list of types to display, where
  151 .Ar type
  152 is one of
  153 .Sy filesystem , snapshot , volume , bookmark , No or Sy all .
  154 .El
  155 .It Xo
  156 .Nm zfs
  157 .Cm inherit
  158 .Op Fl rS
  159 .Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns …
  160 .Xc
  161 Clears the specified property, causing it to be inherited from an ancestor,
  162 restored to default if no ancestor has the property set, or with the
  163 .Fl S
  164 option reverted to the received value if one exists.
  165 See
  166 .Xr zfsprops 7
  167 for a listing of default values, and details on which properties can be
  168 inherited.
  169 .Bl -tag -width "-r"
  170 .It Fl r
  171 Recursively inherit the given property for all children.
  172 .It Fl S
  173 Revert the property to the received value, if one exists;
  174 otherwise, for non-inheritable properties, to the default;
  175 otherwise, operate as if the
  176 .Fl S
  177 option was not specified.
  178 .El
  179 .El
  180 .
  181 .Sh EXAMPLES
  182 .\" These are, respectively, examples 1, 4, 6, 7, 11, 14, 16 from zfs.8
  183 .\" Make sure to update them bidirectionally
  184 .Ss Example 1 : No Creating a ZFS File System Hierarchy
  185 The following commands create a file system named
  186 .Ar pool/home
  187 and a file system named
  188 .Ar pool/home/bob .
  189 The mount point
  190 .Pa /export/home
  191 is set for the parent file system, and is automatically inherited by the child
  192 file system.
  193 .Dl # Nm zfs Cm create Ar pool/home
  194 .Dl # Nm zfs Cm set Sy mountpoint Ns = Ns Ar /export/home pool/home
  195 .Dl # Nm zfs Cm create Ar pool/home/bob
  196 .
  197 .Ss Example 2 : No Disabling and Enabling File System Compression
  198 The following command disables the
  199 .Sy compression
  200 property for all file systems under
  201 .Ar pool/home .
  202 The next command explicitly enables
  203 .Sy compression
  204 for
  205 .Ar pool/home/anne .
  206 .Dl # Nm zfs Cm set Sy compression Ns = Ns Sy off Ar pool/home
  207 .Dl # Nm zfs Cm set Sy compression Ns = Ns Sy on Ar pool/home/anne
  208 .
  209 .Ss Example 3 : No Setting a Quota on a ZFS File System
  210 The following command sets a quota of 50 Gbytes for
  211 .Ar pool/home/bob :
  212 .Dl # Nm zfs Cm set Sy quota Ns = Ns Ar 50G pool/home/bob
  213 .
  214 .Ss Example 4 : No Listing ZFS Properties
  215 The following command lists all properties for
  216 .Ar pool/home/bob :
  217 .Bd -literal -compact -offset Ds
  218 .No # Nm zfs Cm get Sy all Ar pool/home/bob
  219 NAME           PROPERTY              VALUE                  SOURCE
  220 pool/home/bob  type                  filesystem             -
  221 pool/home/bob  creation              Tue Jul 21 15:53 2009  -
  222 pool/home/bob  used                  21K                    -
  223 pool/home/bob  available             20.0G                  -
  224 pool/home/bob  referenced            21K                    -
  225 pool/home/bob  compressratio         1.00x                  -
  226 pool/home/bob  mounted               yes                    -
  227 pool/home/bob  quota                 20G                    local
  228 pool/home/bob  reservation           none                   default
  229 pool/home/bob  recordsize            128K                   default
  230 pool/home/bob  mountpoint            /pool/home/bob         default
  231 pool/home/bob  sharenfs              off                    default
  232 pool/home/bob  checksum              on                     default
  233 pool/home/bob  compression           on                     local
  234 pool/home/bob  atime                 on                     default
  235 pool/home/bob  devices               on                     default
  236 pool/home/bob  exec                  on                     default
  237 pool/home/bob  setuid                on                     default
  238 pool/home/bob  readonly              off                    default
  239 pool/home/bob  zoned                 off                    default
  240 pool/home/bob  snapdir               hidden                 default
  241 pool/home/bob  acltype               off                    default
  242 pool/home/bob  aclmode               discard                default
  243 pool/home/bob  aclinherit            restricted             default
  244 pool/home/bob  canmount              on                     default
  245 pool/home/bob  xattr                 on                     default
  246 pool/home/bob  copies                1                      default
  247 pool/home/bob  version               4                      -
  248 pool/home/bob  utf8only              off                    -
  249 pool/home/bob  normalization         none                   -
  250 pool/home/bob  casesensitivity       sensitive              -
  251 pool/home/bob  vscan                 off                    default
  252 pool/home/bob  nbmand                off                    default
  253 pool/home/bob  sharesmb              off                    default
  254 pool/home/bob  refquota              none                   default
  255 pool/home/bob  refreservation        none                   default
  256 pool/home/bob  primarycache          all                    default
  257 pool/home/bob  secondarycache        all                    default
  258 pool/home/bob  usedbysnapshots       0                      -
  259 pool/home/bob  usedbydataset         21K                    -
  260 pool/home/bob  usedbychildren        0                      -
  261 pool/home/bob  usedbyrefreservation  0                      -
  262 .Ed
  263 .Pp
  264 The following command gets a single property value:
  265 .Bd -literal -compact -offset Ds
  266 .No # Nm zfs Cm get Fl H o Sy value compression Ar pool/home/bob
  267 on
  268 .Ed
  269 .Pp
  270 The following command lists all properties with local settings for
  271 .Ar pool/home/bob :
  272 .Bd -literal -compact -offset Ds
  273 .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
  274 NAME           PROPERTY              VALUE
  275 pool/home/bob  quota                 20G
  276 pool/home/bob  compression           on
  277 .Ed
  278 .
  279 .Ss Example 5 : No Inheriting ZFS Properties
  280 The following command causes
  281 .Ar pool/home/bob No and Ar pool/home/anne
  282 to inherit the
  283 .Sy checksum
  284 property from their parent.
  285 .Dl # Nm zfs Cm inherit Sy checksum Ar pool/home/bob pool/home/anne
  286 .
  287 .Ss Example 6 : No Setting User Properties
  288 The following example sets the user-defined
  289 .Ar com.example : Ns Ar department
  290 property for a dataset:
  291 .Dl # Nm zfs Cm set Ar com.example : Ns Ar department Ns = Ns Ar 12345 tank/accounting
  292 .
  293 .Ss Example 7 : No Setting sharenfs Property Options on a ZFS File System
  294 The following commands show how to set
  295 .Sy sharenfs
  296 property options to enable read-write
  297 access for a set of IP addresses and to enable root access for system
  298 .Qq neo
  299 on the
  300 .Ar tank/home
  301 file system:
  302 .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
  303 .Pp
  304 If you are using DNS for host name resolution,
  305 specify the fully-qualified hostname.
  306 .
  307 .Sh SEE ALSO
  308 .Xr zfsprops 7 ,
  309 .Xr zfs-list 8

Cache object: 2ec6373572a0259d78d96aaed422720f


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.