logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

zfs-set.8 (12856B)


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