blob: 8651130e0afbb02146571b610ac617e540381d44 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BTRFS-PROPERTY" "8" "Mar 10, 2024" "6.7.1" "BTRFS"
.SH NAME
btrfs-property \- get/set/list properties for given filesystem object
.SH SYNOPSIS
.sp
\fBbtrfs property\fP <subcommand> <args>
.SH DESCRIPTION
.sp
\fBbtrfs property\fP is used to get/set/list property for given filesystem object.
The object can be an inode (file or directory), subvolume or the whole
filesystem.
.sp
\fBbtrfs property\fP provides an unified and user\-friendly method to tune different
btrfs properties instead of using the traditional method like \fBchattr(1)\fP or
\fBlsattr(1)\fP\&.
.SS Object types
.sp
A property might apply to several object types so in some cases it\(aqs necessary
to specify that explicitly, however it\(aqs not needed in the most common case of
files and directories.
.sp
The subcommands take parameter \fI\-t\fP, use first letter as a shortcut (\fIf/s/d/i\fP)
of the type:
.INDENT 0.0
.IP \(bu 2
filesystem
.IP \(bu 2
subvolume
.IP \(bu 2
device
.IP \(bu 2
inode (file or directory)
.UNINDENT
.SS Inode properties
.INDENT 0.0
.TP
.B compression
compression algorithm set for an inode (it\(aqs not possible to set the
compression level this way), possible values:
.INDENT 7.0
.IP \(bu 2
\fIlzo\fP
.IP \(bu 2
\fIzlib\fP
.IP \(bu 2
\fIzstd\fP
.IP \(bu 2
\fIno\fP or \fInone\fP \- disable compression (equivalent to \fBchattr +m\fP)
.IP \(bu 2
\fI\(dq\(dq\fP (empty string) \- set the default value
.INDENT 2.0
.INDENT 3.5
.sp
\fBNOTE:\fP
.INDENT 0.0
.INDENT 3.5
This has changed in version 5.18 of btrfs\-progs and
requires kernel 5.14 or newer to work.
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.UNINDENT
.SS Subvolume properties
.INDENT 0.0
.TP
.B ro
read\-only flag of subvolume: true or false. Please also see section \fISUBVOLUME FLAGS\fP
in \fI\%btrfs\-subvolume(8)\fP for possible implications regarding incremental send.
.UNINDENT
.SS Filesystem properties
.INDENT 0.0
.TP
.B label
label of the filesystem. For an unmounted filesystem, provide a path to a block
device as object. For a mounted filesystem, specify a mount point.
.UNINDENT
.SH SUBCOMMAND
.INDENT 0.0
.TP
.B get [\-t <type>] <object> [<name>]
Read value of a property \fIname\fP of btrfs \fIobject\fP of given \fItype\fP,
empty \fIname\fP will read all of them
.TP
.B list [\-t <type>] <object>
List available properties with their descriptions for the given object.
.UNINDENT
.INDENT 0.0
.TP
.B set [\-f] [\-t <type>] <object> <name> <value>
Set \fIvalue\fP of property \fIname\fP on a given btrfs object.
.sp
\fBOptions\fP
.INDENT 7.0
.TP
.B \-f
Force the change. Changing some properties may involve safety checks or
additional changes that depend on the properties semantics.
.UNINDENT
.UNINDENT
.SH EXAMPLES
.sp
Set compression on a file:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ touch file1
$ btrfs prop get file1
[ empty output ]
$ btrfs prop set file1 compression zstd
$ btrfs prop get file1
compression=zstd
.ft P
.fi
.UNINDENT
.UNINDENT
.sp
Make a writeable subvolume read\-only:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
$ btrfs subvol create subvol1
[ fill subvol1 with data ]
$ btrfs prop get subvol1
ro=false
$ btrfs prop set subvol1 ro true
ro=true
.ft P
.fi
.UNINDENT
.UNINDENT
.SH EXIT STATUS
.sp
\fBbtrfs property\fP returns a zero exit status if it succeeds. Non zero is
returned in case of failure.
.SH AVAILABILITY
.sp
\fBbtrfs\fP is part of btrfs\-progs. Please refer to the documentation at
\fI\%https://btrfs.readthedocs.io\fP\&.
.SH SEE ALSO
.sp
\fI\%mkfs.btrfs(8)\fP,
\fBlsattr(1)\fP,
\fBchattr(1)\fP
.\" Generated by docutils manpage writer.
.
|