xref: /freebsd/sys/contrib/openzfs/man/man8/zfs-set.8 (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
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 http://www.opensolaris.org/os/licensing.
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.\"
22.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
23.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
24.\" Copyright (c) 2011, 2019 by Delphix. All rights reserved.
25.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
26.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
27.\" Copyright (c) 2014 by Adam Stevko. All rights reserved.
28.\" Copyright (c) 2014 Integros [integros.com]
29.\" Copyright 2019 Richard Laager. All rights reserved.
30.\" Copyright 2018 Nexenta Systems, Inc.
31.\" Copyright 2019 Joyent, Inc.
32.\"
33.Dd June 30, 2019
34.Dt ZFS-SET 8
35.Os
36.Sh NAME
37.Nm zfs-set
38.Nd Sets the property or list of properties to the given value(s) for each dataset.
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 | 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.Sh DESCRIPTION
58.Bl -tag -width ""
59.It Xo
60.Nm zfs
61.Cm set
62.Ar property Ns = Ns Ar value Oo Ar property Ns = Ns Ar value Oc Ns ...
63.Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
64.Xc
65Only some properties can be edited.
66See
67.Xr zfsprops 8
68for more information on what properties can be set and acceptable
69values.
70Numeric values can be specified as exact values, or in a human-readable form
71with a suffix of
72.Sy B , K , M , G , T , P , E , Z
73.Po for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes,
74or zettabytes, respectively
75.Pc .
76User properties can be set on snapshots.
77For more information, see the
78.Em User Properties
79section of
80.Xr zfsprops 8 .
81.It Xo
82.Nm zfs
83.Cm get
84.Op Fl r Ns | Ns Fl d Ar depth
85.Op Fl Hp
86.Oo Fl o Ar field Ns Oo , Ns Ar field Oc Ns ... Oc
87.Oo Fl s Ar source Ns Oo , Ns Ar source Oc Ns ... Oc
88.Oo Fl t Ar type Ns Oo , Ns Ar type Oc Ns ... Oc
89.Cm all | Ar property Ns Oo , Ns Ar property Oc Ns ...
90.Oo Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns | Ns Ar bookmark Oc Ns ...
91.Xc
92Displays properties for the given datasets.
93If no datasets are specified, then the command displays properties for all
94datasets on the system.
95For each property, the following columns are displayed:
96.Bd -literal
97    name      Dataset name
98    property  Property name
99    value     Property value
100    source    Property source  \fBlocal\fP, \fBdefault\fP, \fBinherited\fP,
101              \fBtemporary\fP, \fBreceived\fP or none (\fB-\fP).
102.Ed
103.Pp
104All columns are displayed by default, though this can be controlled by using the
105.Fl o
106option.
107This command takes a comma-separated list of properties as described in the
108.Em Native Properties
109and
110.Em User Properties
111sections of
112.Xr zfsprops 8 .
113.Pp
114The value
115.Sy all
116can be used to display all properties that apply to the given dataset's type
117.Pq filesystem, volume, snapshot, or bookmark .
118.Bl -tag -width "-H"
119.It Fl H
120Display output in a form more easily parsed by scripts.
121Any headers are omitted, and fields are explicitly separated by a single tab
122instead of an arbitrary amount of space.
123.It Fl d Ar depth
124Recursively display any children of the dataset, limiting the recursion to
125.Ar depth .
126A depth of
127.Sy 1
128will display only the dataset and its direct children.
129.It Fl o Ar field
130A comma-separated list of columns to display.
131.Sy name Ns \&, Ns Sy property Ns \&, Ns Sy value Ns \&, Ns Sy source
132is the default value.
133.It Fl p
134Display numbers in parsable
135.Pq exact
136values.
137.It Fl r
138Recursively display properties for any children.
139.It Fl s Ar source
140A comma-separated list of sources to display.
141Those properties coming from a source other than those in this list are ignored.
142Each source must be one of the following:
143.Sy local ,
144.Sy default ,
145.Sy inherited ,
146.Sy temporary ,
147.Sy received ,
148and
149.Sy none .
150The default value is all sources.
151.It Fl t Ar type
152A comma-separated list of types to display, where
153.Ar type
154is one of
155.Sy filesystem ,
156.Sy snapshot ,
157.Sy volume ,
158.Sy bookmark ,
159or
160.Sy all .
161.El
162.It Xo
163.Nm zfs
164.Cm inherit
165.Op Fl rS
166.Ar property Ar filesystem Ns | Ns Ar volume Ns | Ns Ar snapshot Ns ...
167.Xc
168Clears the specified property, causing it to be inherited from an ancestor,
169restored to default if no ancestor has the property set, or with the
170.Fl S
171option reverted to the received value if one exists.
172See
173.Xr zfsprops 8
174for a listing of default values, and details on which properties can be
175inherited.
176.Bl -tag -width "-r"
177.It Fl r
178Recursively inherit the given property for all children.
179.It Fl S
180Revert the property to the received value if one exists; otherwise operate as
181if the
182.Fl S
183option was not specified.
184.El
185.El
186.Sh SEE ALSO
187.Xr zfs-list 8 ,
188.Xr zfsprops 8
189