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