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