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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
.\" 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" "8" "Feb 14, 2024" "6.7.1" "BTRFS"
.SH NAME
btrfs \- a toolbox to manage btrfs filesystems
.SH SYNOPSIS
.sp
\fBbtrfs\fP [global] <group> [<group>...] <command> [<args>]
.SH DESCRIPTION
.sp
The \fBbtrfs\fP utility is a toolbox for managing btrfs filesystems. There are
command groups to work with subvolumes, devices, for whole filesystem or other
specific actions. See section \fI\%COMMANDS\fP\&.
.sp
There are also standalone tools for some tasks like \fI\%btrfs\-convert(8)\fP or
\fI\%btrfstune(8)\fP that were separate historically and/or haven\(aqt been merged to the
main utility. See section \fI\%STANDALONE TOOLS\fP
for more details.
.sp
For other topics (mount options, etc) please refer to the separate manual
page \fI\%btrfs(5)\fP\&.
.SH COMMAND SYNTAX
.sp
Any command name can be shortened so long as the shortened form is unambiguous,
however, it is recommended to use full command names in scripts. All command
groups have their manual page named \fBbtrfs\-<group>\fP\&.
.sp
For example: it is possible to run \fBbtrfs sub snaps\fP instead of
\fBbtrfs subvolume snapshot\fP\&.
But \fBbtrfs file s\fP is not allowed, because \fBfile s\fP may be interpreted
both as \fBfilesystem show\fP and as \fBfilesystem sync\fP\&.
.sp
If the command name is ambiguous, the list of conflicting options is
printed.
.sp
\fISizes\fP, both upon input and output, can be expressed in either SI or IEC\-I
units (see \fI\%numfmt(1)\fP)
with the suffix \fIB\fP appended.
All numbers will be formatted according to the rules of the \fIC\fP locale
(ignoring the shell locale, see \fI\%locale(7)\fP).
.sp
For an overview of a given command use \fBbtrfs command \-\-help\fP
or \fBbtrfs [command...] \-\-help \-\-full\fP to print all available options.
.sp
There are global options that are passed between \fIbtrfs\fP and the \fIgroup\fP name
and affect behaviour not specific to the command, e.g. verbosity or the type
of the output.
.INDENT 0.0
.TP
.BI \-\-format \ <format>
if supported by the command, print subcommand output in that format (text, json)
.UNINDENT
.INDENT 0.0
.TP
.B \-v|\-\-verbose
increase verbosity of the subcommand
.TP
.B \-q|\-\-quiet
print only errors
.UNINDENT
.INDENT 0.0
.TP
.BI \-\-log \ <level>
set log level (default, info, verbose, debug, quiet)
.UNINDENT
.sp
The remaining options are relevant only for the main tool:
.INDENT 0.0
.TP
.B \-\-help
print condensed help for all subcommands
.TP
.B \-\-version
print version string
.UNINDENT
.SH COMMANDS
.INDENT 0.0
.TP
.B balance
Balance btrfs filesystem chunks across single or several devices.
See \fI\%btrfs\-balance(8)\fP for details.
.TP
.B check
Do off\-line check on a btrfs filesystem.
See \fI\%btrfs\-check(8)\fP for details.
.TP
.B device
Manage devices managed by btrfs, including add/delete/scan and so
on. See \fI\%btrfs\-device(8)\fP for details.
.TP
.B filesystem
Manage a btrfs filesystem, including label setting/sync and so on.
See \fI\%btrfs\-filesystem(8)\fP for details.
.TP
.B inspect\-internal
Debug tools for developers/hackers.
See \fI\%btrfs\-inspect\-internal(8)\fP for details.
.TP
.B property
Get/set a property from/to a btrfs object.
See \fI\%btrfs\-property(8)\fP for details.
.TP
.B qgroup
Manage quota group(qgroup) for btrfs filesystem.
See \fI\%btrfs\-qgroup(8)\fP for details.
.TP
.B quota
Manage quota on btrfs filesystem like enabling/rescan and etc.
See \fI\%btrfs\-quota(8)\fP and \fI\%btrfs\-qgroup(8)\fP for details.
.TP
.B receive
Receive subvolume data from stdin/file for restore and etc.
See \fI\%btrfs\-receive(8)\fP for details.
.TP
.B replace
Replace btrfs devices.
See \fI\%btrfs\-replace(8)\fP for details.
.TP
.B rescue
Try to rescue damaged btrfs filesystem.
See \fI\%btrfs\-rescue(8)\fP for details.
.TP
.B restore
Try to restore files from a damaged btrfs filesystem.
See \fI\%btrfs\-restore(8)\fP for details.
.TP
.B scrub
Scrub a btrfs filesystem.
See \fI\%btrfs\-scrub(8)\fP for details.
.TP
.B send
Send subvolume data to stdout/file for backup and etc.
See \fI\%btrfs\-send(8)\fP for details.
.TP
.B subvolume
Create/delete/list/manage btrfs subvolume.
See \fI\%btrfs\-subvolume(8)\fP for details.
.UNINDENT
.SH STANDALONE TOOLS
.sp
New functionality could be provided using a standalone tool. If the functionality
proves to be useful, then the standalone tool is declared obsolete and its
functionality is copied to the main tool. Obsolete tools are removed after a
long (years) depreciation period.
.sp
Tools that are still in active use without an equivalent in \fBbtrfs\fP:
.INDENT 0.0
.TP
.B btrfs\-convert
in\-place conversion from ext2/3/4 filesystems to btrfs
.TP
.B btrfstune
tweak some filesystem properties on a unmounted filesystem
.TP
.B btrfs\-select\-super
rescue tool to overwrite primary superblock from a spare copy
.TP
.B btrfs\-find\-root
rescue helper to find tree roots in a filesystem
.UNINDENT
.sp
For space\-constrained environments, it\(aqs possible to build a single binary with
functionality of several standalone tools. This is following the concept of
busybox where the file name selects the functionality. This works for symlinks
or hardlinks. The full list can be obtained by \fBbtrfs help \-\-box\fP\&.
.SH EXIT STATUS
.sp
\fBbtrfs\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\%btrfs(5)\fP,
\fI\%btrfs\-balance(8)\fP,
\fI\%btrfs\-check(8)\fP,
\fI\%btrfs\-convert(8)\fP,
\fI\%btrfs\-device(8)\fP,
\fI\%btrfs\-filesystem(8)\fP,
\fI\%btrfs\-inspect\-internal(8)\fP,
\fI\%btrfs\-property(8)\fP,
\fI\%btrfs\-qgroup(8)\fP,
\fI\%btrfs\-quota(8)\fP,
\fI\%btrfs\-receive(8)\fP,
\fI\%btrfs\-replace(8)\fP,
\fI\%btrfs\-rescue(8)\fP,
\fI\%btrfs\-restore(8)\fP,
\fI\%btrfs\-scrub(8)\fP,
\fI\%btrfs\-send(8)\fP,
\fI\%btrfs\-subvolume(8)\fP,
\fI\%btrfstune(8)\fP,
\fI\%mkfs.btrfs(8)\fP
.\" Generated by docutils manpage writer.
.
|