~ubuntu-branches/debian/sid/btrfs-tools/sid

« back to all changes in this revision

Viewing changes to .pc/0005-Update-references-to-btrfs-tools-instead-of-btrfs-pr.patch/man/btrfs.8.in

  • Committer: Package Import Robot
  • Author(s): Dimitri John Ledkov
  • Date: 2014-04-19 12:12:11 UTC
  • mfrom: (1.3.4)
  • Revision ID: package-import@ubuntu.com-20140419121211-0jeuu83zmf9nowmu
Tags: 3.14.1-1
* New upstream release.
* Switch to git-dpm.
* Rebase and cleanup patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH BTRFS 8 "" "btrfs" "btrfs"
 
2
.\"
 
3
.\" Man page written by Goffredo Baroncelli <kreijack@inwind.it> (Feb 2010)
 
4
.\" Modified by Qu Wenruo <quwenruo@cn.fujitsu.com> (Jun 2013)
 
5
.\"
 
6
.SH NAME
 
7
btrfs \- control a btrfs filesystem
 
8
.SH SYNOPSIS
 
9
\fBbtrfs\fP \fBsubvolume create\fP [-i \fI<qgroupid>\fP] [\fI<dest>\fP/]\fI<name>\fP
 
10
.PP
 
11
\fBbtrfs\fP \fBsubvolume delete\fP [\fIoptions\fP] \fI<subvolume>\fP [\fI<subvolume>...\fP]
 
12
.PP
 
13
\fBbtrfs\fP \fBsubvolume list\fP [\fIoptions\fP] [-G [+|-]\fIvalue\fP] [-C [+|-]\fIvalue\fP] [--sort=rootid,gen,ogen,path] \fI<path>\fP
 
14
.PP
 
15
\fBbtrfs\fP \fBsubvolume snapshot\fP [-r] \fI<source>\fP \fI<dest>\fP|[\fI<dest>\fP/]\fI<name>\fP
 
16
.PP
 
17
\fBbtrfs\fP \fBsubvolume get-default\fP\fI <path>\fP
 
18
.PP
 
19
\fBbtrfs\fP \fBsubvolume set-default\fP\fI <id> <path>\fP
 
20
.PP
 
21
\fBbtrfs\fP \fBsubvolume find-new\fP\fI <subvolume> <lastgen>\fP
 
22
.PP
 
23
\fBbtrfs\fP \fBsubvolume show\fP\fI <path>\fP
 
24
.PP
 
25
.PP
 
26
\fBbtrfs\fP \fBfilesystem df\fP\fI <path>\fP
 
27
.PP
 
28
\fBbtrfs\fP \fBfilesystem show\fP [\fI--mounted\fP|\fI--all-devices\fP|\fI<uuid>\fP]\fP
 
29
.PP
 
30
\fBbtrfs\fP \fBfilesystem sync\fP\fI <path> \fP
 
31
.PP
 
32
\fBbtrfs\fP \fBfilesystem defragment\fP [\fIoptions\fP] \fI<file>\fP|\fI<dir>\fP [\fI<file>\fP|\fI<dir>...\fP]\fP
 
33
.PP
 
34
\fBbtrfs\fP \fBfilesystem resize\fP [\fIdevid\fP:][+/\-]\fI<size>\fP[gkm]|[\fIdevid\fP:]\fImax <path>\fP
 
35
.PP
 
36
\fBbtrfs\fP \fBfilesystem label\fP [\fI<device>\fP|\fI<mount_point>\fP] [\fI<newlabel>\fP]
 
37
.PP
 
38
.PP
 
39
\fBbtrfs\fP \fB[filesystem] balance start\fP [\fIoptions\fP] \fI<path>\fP
 
40
.PP
 
41
\fBbtrfs\fP \fB[filesystem] balance pause\fP\fI <path>\fP
 
42
.PP
 
43
\fBbtrfs\fP \fB[filesystem] balance cancel\fP\fI <path>\fP
 
44
.PP
 
45
\fBbtrfs\fP \fB[filesystem] balance resume\fP\fI <path>\fP
 
46
.PP
 
47
\fBbtrfs\fP \fB[filesystem] balance status\fP [-v] \fI<path>\fP
 
48
.PP
 
49
.PP
 
50
\fBbtrfs\fP \fBdevice add\fP [-Kf] \fI<device>\fP [\fI<device>...\fP] \fI<path>\fP
 
51
.PP
 
52
\fBbtrfs\fP \fBdevice delete\fP \fI<device>\fP [\fI<device>...\fP] \fI<path>\fP
 
53
.PP
 
54
\fBbtrfs\fP \fBdevice scan\fP [\fI--all-devices\fP|\fI<device> \P[\fI<device>...\fP]
 
55
.PP
 
56
\fBbtrfs\fP \fBdevice ready\fP\fI <device>\fP
 
57
.PP
 
58
\fBbtrfs\fP \fBdevice stats\fP [-z] {\fI<path>\fP|\fI<device>\fP}
 
59
.PP
 
60
.PP
 
61
\fBbtrfs\fP \fBscrub start\fP [-BdqrRf] [-c \fIioprio_class\fP -n \fIioprio_classdata\fP] {\fI<path>\fP|\fI<device>\fP}
 
62
.PP
 
63
\fBbtrfs\fP \fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
 
64
.PP
 
65
\fBbtrfs\fP \fBscrub resume\fP [-BdqrR] [-c \fIioprio_class\fP -n \fIioprio_classdata\fP] {\fI<path>\fP|\fI<device>\fP}
 
66
.PP
 
67
\fBbtrfs\fP \fBscrub status\fP [-d] {\fI<path>\fP|\fI<device>\fP}
 
68
.PP
 
69
.PP
 
70
\fBbtrfs\fP \fBcheck\fP [\fIoptions\fP] \fI<device>\fP
 
71
.PP
 
72
\fBbtrfs\fP \fBrescue chunk-recover\fP [\fIoptions\fP] \fI<path>\fP
 
73
.PP
 
74
\fBbtrfs\fP \fBrescue super-recover\fP [\fIoptions\fP] \fI<path>\fP
 
75
.PP
 
76
\fBbtrfs\fP \fBrestore\fP [\fIoptions\fP] \fI<device>\fP
 
77
.PP
 
78
.PP
 
79
\fBbtrfs\fP \fBinspect-internal inode-resolve\fP [-v] \fI<inode>\fP \fI<path>\fP
 
80
.PP
 
81
\fBbtrfs\fP \fBinspect-internal logical-resolve\fP [-Pv] [-s \fI<size>\fP] \fI<logical>\fP \fI<path>\fP
 
82
.PP
 
83
\fBbtrfs\fP \fBinspect-internal subvolid-resolve\fP \fI<subvolid>\fP \fI<path>\fP
 
84
.PP
 
85
\fBbtrfs\fP \fBinspect-internal rootid\fP \fI<path>\fP
 
86
.PP
 
87
.PP
 
88
\fBbtrfs\fP \fBsend\fP [-ve] [-p \fI<parent>\fP] [-c \fI<clone-src>\fP] [-f \fI<outfile>\fP] \fI<subvol>\fP [\fI<subvol>\fP...]
 
89
.PP
 
90
\fBbtrfs\fP \fBreceive\fP [-ve] [-f \fI<infile>\fP] \fI<mount>\fP
 
91
.PP
 
92
.PP
 
93
\fBbtrfs\fP \fBquota enable\fP\fI <path>\fP
 
94
.PP
 
95
\fBbtrfs\fP \fBquota disable\fP\fI <path>\fP
 
96
.PP
 
97
\fBbtrfs\fP \fBquota rescan\fP [-s] \fI<path>\fP
 
98
.PP
 
99
.PP
 
100
\fBbtrfs\fP \fBqgroup assign\fP \fI<src>\fP \fI<dst>\fP \fI<path>\fP
 
101
.PP
 
102
\fBbtrfs\fP \fBqgroup remove\fP \fI<src>\fP \fI<dst>\fP \fI<path>\fP
 
103
.PP
 
104
\fBbtrfs\fP \fBqgroup create\fP \fI<qgroupid>\fP \fI<path>\fP
 
105
.PP
 
106
\fBbtrfs\fP \fBqgroup destroy\fP \fI<qgroupid>\fP \fI<path>\fP
 
107
.PP
 
108
\fBbtrfs\fP \fBqgroup show\fP \fI<path>\fP
 
109
.PP
 
110
\fBbtrfs\fP \fBqgroup limit\fP [\fIoptions\fP] \fI<size>\fP|\fBnone\fP [\fI<qgroupid>\fP] \fI<path>\fP
 
111
.PP
 
112
.PP
 
113
\fBbtrfs\fP \fBreplace start\fP [-Bfr] \fI<srcdev>\fP|\fI<devid> <targetdev> <mount_point>\fP
 
114
.PP
 
115
\fBbtrfs\fP \fBreplace status\fP [-1] \fI<mount_point>\fP
 
116
.PP
 
117
\fBbtrfs\fP \fBreplace cancel\fP \fI<mount_point>\fP
 
118
.PP
 
119
\fBbtrfs\fP \fBhelp|\-\-help \fP
 
120
.PP
 
121
\fBbtrfs\fP \fB<command> \-\-help \fP
 
122
.PP
 
123
.SH DESCRIPTION
 
124
.B btrfs
 
125
is used to control the filesystem and the files and directories stored. It is
 
126
the tool to create or destroy a snapshot or a subvolume for the
 
127
filesystem, to defrag a file or a directory, flush the data to the disk,
 
128
to resize the filesystem, to scan the device.
 
129
 
 
130
It is possible to abbreviate the commands unless the commands are ambiguous.
 
131
For example: it is possible to run
 
132
.I btrfs sub snaps
 
133
instead of
 
134
.I btrfs subvolume snapshot.
 
135
But
 
136
.I btrfs file s
 
137
is not allowed, because
 
138
.I file s
 
139
may be interpreted both as
 
140
.I filesystem show
 
141
and as
 
142
.I filesystem sync.
 
143
In this case
 
144
.I btrfs
 
145
returns filesystem sync
 
146
If a command is terminated by
 
147
.I --help
 
148
, the detailed help is showed. If the passed command matches more commands,
 
149
detailed help of all the matched commands is showed. For example
 
150
.I btrfs dev --help
 
151
shows the help of all
 
152
.I device*
 
153
commands.
 
154
 
 
155
.SH COMMANDS
 
156
.TP
 
157
 
 
158
\fBsubvolume create\fP [-i \fI<qgroupid>\fP] [\fI<dest>\fP/]\fI<name>\fP
 
159
Create a subvolume \fI<name>\fR in \fI<dest>\fR.
 
160
If \fI<dest>\fR is not given subvolume \fI<name>\fR will be created in the
 
161
current directory.
 
162
.RS
 
163
 
 
164
\fIOptions\fP
 
165
.IP "\fB-i\fP \fI<qgroupid>\fR" 5
 
166
Add the newly created subvolume to a qgroup. This option can be given multiple
 
167
times.
 
168
.RE
 
169
.TP
 
170
 
 
171
\fBsubvolume delete\fR [\fIoptions\fP] \fI<subvolume>\fP [\fI<subvolume>...\fP]\fR
 
172
Delete the subvolume(s) from the filesystem. If \fI<subvolume>\fR is not a
 
173
subvolume, \fBbtrfs\fR returns an error but continues if there are more arguments
 
174
to process.
 
175
 
 
176
The corresponding directory is removed instantly but the data blocks are
 
177
removed later.  The deletion does not involve full commit by default due to
 
178
performance reasons (as a consequence, the subvolume may appear again after a
 
179
crash).  Use one of the --commit options to wait until the operation is safely
 
180
stored on the media.
 
181
.RS
 
182
 
 
183
\fIOptions\fP
 
184
.IP "\fB-c|--commit-after\fP" 5
 
185
wait for transaction commit at the end of the operation
 
186
.IP "\fB-C|--commit-each\fP" 5
 
187
wait for transaction commit after deleting each subvolume
 
188
.RE
 
189
.TP
 
190
 
 
191
\fBsubvolume list\fR [\fIoptions\fP] [-G [+|-]\fIvalue\fP] [-C [+|-]\fIvalue\fP] [--sort=rootid,gen,ogen,path] \fI<path>\fR
 
192
 
 
193
List the subvolumes present in the filesystem \fI<path>\fR. For every
 
194
subvolume the following information is shown by default.
 
195
ID \fI<ID>\fP top level \fI<ID>\fP path \fI<path>\fP
 
196
where path is the relative path of the subvolume to the \fItop level\fR
 
197
subvolume.
 
198
 
 
199
The subvolume's ID may be used by the \fBsubvolume set-default\fR command, or
 
200
at mount time via the \fIsubvolid=\fR option.
 
201
If \fI-p\fR is given, then \fIparent <ID>\fR is added to the output between ID
 
202
and top level. The parent's ID may be used at mount time via the
 
203
\fIsubvolrootid=\fR option.
 
204
.RS
 
205
 
 
206
\fIOptions\fP
 
207
.IP "\fB-p\fP" 5
 
208
print parent ID.
 
209
.IP "\fB-a\fP" 5
 
210
print all the subvolumes in the filesystem and distinguish between
 
211
absolute and relative path with respect to the given \fI<path>\fP.
 
212
.IP "\fB-c\fP" 5
 
213
print the ogeneration of the subvolume, aliases: ogen or origin generation.
 
214
.IP "\fB-g\fP" 5
 
215
print the generation of the subvolume.
 
216
.IP "\fB-o\fP" 5
 
217
print only subvolumes bellow specified <path>.
 
218
.IP "\fB-u\fP" 5
 
219
print the UUID of the subvolume.
 
220
.IP "\fB-q\fP" 5
 
221
print the parent uuid of subvolumes (and snapshots).
 
222
.IP "\fB-t\fP" 5
 
223
print the result as a table.
 
224
.IP "\fB-s\fP" 5
 
225
only snapshot subvolumes in the filesystem will be listed.
 
226
.IP "\fB-r\fP" 5
 
227
only readonly subvolumes in the filesystem will be listed.
 
228
.IP "\fB-G [+|-]\fIvalue\fP\fP" 5
 
229
list subvolumes in the filesystem that its generation is
 
230
>=, <= or = \fIvalue\fP. '+' means >= \fIvalue\fP, '-' means <= \fIvalue\fP, If there is
 
231
neither '+' nor '-', it means = \fIvalue\fP.
 
232
.IP "\fB-C [+|-]\fIvalue\fP" 5
 
233
list subvolumes in the filesystem that its ogeneration is
 
234
>=, <= or = \fIvalue\fP. The usage is the same to '-g' option.
 
235
.IP "\fB--sort=rootid,gen,ogen,path\fP" 5
 
236
list subvolumes in order by specified items.
 
237
you can add '+' or '-' in front of each items, '+' means ascending, '-'
 
238
means descending. The default is ascending.
 
239
 
 
240
for \fB--sort\fP you can combine some items together by ',', just like
 
241
\f--sort=+ogen,-gen,path,rootid\fR.
 
242
.RE
 
243
.TP
 
244
 
 
245
\fBsubvolume snapshot\fP [-r] \fI<source>\fP \fI<dest>\fP|[\fI<dest>\fP/]\fI<name>\fP
 
246
Create a writable/readonly snapshot of the subvolume \fI<source>\fR with the
 
247
name \fI<name>\fR in the \fI<dest>\fR directory.
 
248
If only \fI<dest>\fR is given, the subvolume will be named the basename of \fI<source>\fR.
 
249
If \fI<source>\fR is not a subvolume, \fBbtrfs\fR returns an error.
 
250
If \fI-r\fR is given, the snapshot will be readonly.
 
251
.TP
 
252
 
 
253
\fBsubvolume get-default\fR\fI <path>\fR
 
254
Get the default subvolume of the filesystem \fI<path>\fR. The output format
 
255
is similar to \fBsubvolume list\fR command.
 
256
.TP
 
257
 
 
258
\fBsubvolume set-default\fR\fI <id> <path>\fR
 
259
Set the subvolume of the filesystem \fI<path>\fR which is mounted as
 
260
\fIdefault\fR. The subvolume is identified by \fI<id>\fR, which
 
261
is returned by the \fBsubvolume list\fR command.
 
262
.TP
 
263
 
 
264
\fBsubvolume find-new\fR\fI <subvolume> <last_gen>\fR
 
265
List the recently modified files in a subvolume, after \fI<last_gen>\fR ID.
 
266
.TP
 
267
 
 
268
\fBsubvolume show\fR\fI <path>\fR
 
269
Show information of a given subvolume in the \fI<path>\fR.
 
270
.TP
 
271
 
 
272
\fBfilesystem df\fP\fI <path>\fR
 
273
Show space usage information for a mount point.
 
274
.TP
 
275
 
 
276
\fBfilesystem show\fR [\fI--mounted\fP|\fI--all-devices\fP|\fI<uuid>\fR]\fR
 
277
Show the btrfs filesystem with some additional info. If no option or \fIUUID\fP
 
278
is passed, \fBbtrfs\fR shows information of all the btrfs filesystem both mounted
 
279
and unmounted.
 
280
If \fB--mounted\fP is passed, it would probe btrfs kernel to list mounted btrfs filesystem(s);
 
281
If \fB--all-devices\fP is passed, all the devices under /dev are scanned;
 
282
otherwise the devices list is extracted from the /proc/partitions file.
 
283
.TP
 
284
 
 
285
\fBfilesystem sync\fR\fI <path> \fR
 
286
Force a sync for the filesystem identified by \fI<path>\fR.
 
287
.TP
 
288
 
 
289
\fBfilesystem defragment\fP [\fIoptions\fP] \fI<file>\fP|\fI<dir>\fP [\fI<file>\fP|\fI<dir>...\fP]\fP
 
290
Defragment file data and/or directory metadata. If \fB-r\fP is passed, 
 
291
files in \fIdir\fR will be defragmented recursively.
 
292
 
 
293
 
 
294
The start position and the number of bytes to defragment can be specified by
 
295
\fIstart\fR and \fIlen\fR. Any extent bigger than threshold will be
 
296
considered already defragged. Use 0 to take the kernel default, and use 1 to
 
297
say every single extent must be rewritten. You can also turn on compression in
 
298
defragment operations.
 
299
.RS
 
300
 
 
301
\fIOptions\fR
 
302
.IP "\fB-v\fP" 5
 
303
be verbose
 
304
.IP "\fB-c\fP" 5
 
305
compress file contents while defragmenting
 
306
.IP "\fB-r\fP" 5
 
307
defragment files recursively
 
308
.IP "\fB-f\fP" 5
 
309
flush filesystem after defragmenting
 
310
.IP "\fB-s \fIstart\fP\fP" 5
 
311
defragment only from byte \fIstart\fR onward
 
312
.IP "\fB-l \fIlen\fP\fP" 5
 
313
defragment only up to \fIlen\fR bytes
 
314
.IP "\fB-t \fIsize\fP\fP" 5
 
315
defragment only files at least \fIsize\fR bytes big
 
316
 
 
317
For \fBstart\fP, \fBlen\fP, \fBsize\fP it is possible to append a suffix
 
318
like \fBk\fP for 1 KBytes, \fBm\fP for 1 MBytes...
 
319
 
 
320
NOTE: defragmenting with kernels up to 2.6.37 will unlink COW-ed copies of data,
 
321
don't use it if you use snapshots, have de-duplicated your data or made
 
322
copies with \fBcp --reflink\fP.
 
323
.RE
 
324
.TP
 
325
 
 
326
.\"
 
327
.\" Some wording are extracted by the resize2fs man page
 
328
.\"
 
329
\fBfilesystem resize\fP [\fIdevid\fP:][+/\-]\fI<size>\fP[gkm]|[\fIdevid\fP:]\fImax <path>\fR
 
330
Resize a filesystem identified by \fI<path>\fR for the underlying device
 
331
\fIdevid\fR.  The \fIdevid\fR can be found with \fBbtrfs filesystem show\fR and
 
332
defaults to 1 if not specified.
 
333
The \fI<size>\fR parameter specifies the new size of the filesystem.
 
334
If the prefix \fI+\fR or \fI\-\fR is present the size is increased or decreased
 
335
by the quantity \fI<size>\fR.
 
336
If no units are specified, the unit of the \fI<size>\fR parameter defaults to
 
337
bytes. Optionally, the size parameter may be suffixed by one of the following
 
338
units designators: 'K', 'M', or 'G', kilobytes, megabytes, or gigabytes,
 
339
respectively.
 
340
 
 
341
If 'max' is passed, the filesystem will occupy all available space on the
 
342
device \fIdevid\fR.
 
343
 
 
344
The \fBresize\fR command \fBdoes not\fR manipulate the size of underlying
 
345
partition.  If you wish to enlarge/reduce a filesystem, you must make sure you
 
346
can expand the partition before enlarging the filesystem and shrink the
 
347
partition after reducing the size of the filesystem.  This can done using
 
348
\fBfdisk(8)\fR or \fBparted(8)\fR to delete the existing partition and recreate
 
349
it with the new desired size.  When recreating the partition make sure to use
 
350
the same starting disk cylinder as before.
 
351
.TP
 
352
 
 
353
\fBfilesystem label\fP [\fI<dev>\fP|\fI<mount_point>\fP] [\fInewlabel\fP]\fP
 
354
Show or update the label of a filesystem. \fI[<device>|<mountpoint>]\fR is used
 
355
to identify the filesystem. 
 
356
If a \fInewlabel\fR optional argument is passed, the label is changed. The
 
357
following constraints exist for a label:
 
358
.IP
 
359
- the maximum allowable length shall be less than 256 chars
 
360
.TP
 
361
 
 
362
\fB[filesystem] balance start\fR [\fIoptions\fP] \fI<path>\fR
 
363
Balance chunks across the devices
 
364
Balance and/or convert (change allocation profile of) chunks that
 
365
passed all \fIfilters\fR in a comma-separated list of filters for a
 
366
particular chunk type.
 
367
If filter list is not given balance all chunks of that type.
 
368
In case none of the \fI-d\fR, \fI-m\fR or \fI-s\fR options is
 
369
given balance all chunks in a filesystem.
 
370
.RS
 
371
 
 
372
\fIOptions\fR
 
373
.IP "\fB-d[\fIfilters\fP]\fR" 5
 
374
act on data chunks
 
375
.IP "\fB-m[\fIfilters\fP]\fR" 5
 
376
act on metadata chunks
 
377
.IP "\fB-s[\fIfilters\fP]\fR" 5
 
378
act on system chunks (only under -f)
 
379
.IP "\fB-v\fP" 5
 
380
be verbose
 
381
.IP "\fB-f\fP" 5
 
382
force reducing of metadata integrity
 
383
.RE
 
384
.TP
 
385
 
 
386
\fB[filesystem] balance pause\fR\fI <path>\fR
 
387
Pause running balance.
 
388
.TP
 
389
 
 
390
\fB[filesystem] balance cancel\fR\fI <path>\fR
 
391
Cancel running or paused balance.
 
392
.TP
 
393
 
 
394
\fB[filesystem] balance resume\fR\fI <path>\fR
 
395
Resume interrupted balance.
 
396
.TP
 
397
 
 
398
\fB[filesystem] balance status\fR [-v] \fI<path>\fR
 
399
Show status of running or paused balance.
 
400
.RS
 
401
 
 
402
\fIOptions\fR
 
403
.IP "\fB-v\fP" 5
 
404
be verbose
 
405
.RE
 
406
.TP
 
407
 
 
408
\fBdevice add\fR\fI [-Kf] <dev> \fP[\fI<dev>...\fP] \fI<path>\fR
 
409
Add device(s) to the filesystem identified by \fI<path>\fR.
 
410
If applicable, a whole device discard (TRIM) operation is performed.
 
411
.RS
 
412
 
 
413
\fIOptions\fR
 
414
.IP "\fB-K|--nodiscard\fP" 5
 
415
do not perform discard by default
 
416
.IP "\fB-f|--force\fP" 5
 
417
force overwrite of existing filesystem on the given disk(s)
 
418
.RE
 
419
.TP
 
420
 
 
421
\fBdevice delete\fR\fI <dev> \fP[\fI<dev>...\fP] \fI<path>\fR
 
422
Remove device(s) from a filesystem identified by \fI<path>\fR.
 
423
.TP
 
424
 
 
425
\fBdevice scan\fR [--all-devices|\fI<device> \fP[\fI<device>...\fP]\fR
 
426
If one or more devices are passed, these are scanned for a btrfs filesystem. 
 
427
If no devices are passed, \fBbtrfs\fR uses block devices containing btrfs
 
428
filesystem as listed by blkid.
 
429
Finally, if \fB--all-devices\fP is passed, all the devices under /dev are 
 
430
scanned.
 
431
.TP
 
432
 
 
433
\fBdevice ready\fR \fI<device>\fR
 
434
Check device to see if it has all of it's devices in cache for mounting.
 
435
.TP
 
436
 
 
437
\fBdevice stats\fP [-z] {\fI<path>\fP|\fI<device>\fP}
 
438
Read and print the device IO stats for all devices of the filesystem
 
439
identified by \fI<path>\fR or for a single \fI<device>\fR.
 
440
.RS
 
441
 
 
442
\fIOptions\fR
 
443
.IP "\fB-z\fP" 5
 
444
Reset stats to zero after reading them.
 
445
.RE
 
446
.TP
 
447
 
 
448
\fBscrub start\fP [-BdqrR] [-c \fIioprio_class\fP -n \fIioprio_classdata\fP] {\fI<path>\fP|\fI<device>\fP}
 
449
Start a scrub on all devices of the filesystem identified by \fI<path>\fR or on
 
450
a single \fI<device>\fR. Without options, scrub is started as a background
 
451
process. Progress can be obtained with the \fBscrub status\fR command. Scrubbing
 
452
involves reading all data from all disks and verifying checksums. Errors are
 
453
corrected along the way if possible.
 
454
.IP
 
455
The default IO priority of scrub is the idle class. The priority can be configured similar to the
 
456
.BR ionice (1)
 
457
syntax.
 
458
.RS
 
459
 
 
460
\fIOptions\fR
 
461
.IP "\fB-B\fP" 5
 
462
Do not background and print scrub statistics when finished.
 
463
.IP "\fB-d\fP" 5
 
464
Print separate statistics for each device of the filesystem (-B only).
 
465
.IP "\fB-q\fP" 5
 
466
Quiet. Omit error messages and statistics.
 
467
.IP "\fB-r\fP" 5
 
468
Read only mode. Do not attempt to correct anything.
 
469
.IP "\fB-R\fP" 5
 
470
Raw print mode. Print full data instead of summary.
 
471
.IP "\fB-c \fIioprio_class\fP" 5
 
472
Set IO priority class (see
 
473
.BR ionice (1)
 
474
manpage).
 
475
.IP "\fB-n \fIioprio_classdata\fP" 5
 
476
Set IO priority classdata (see
 
477
.BR ionice (1)
 
478
manpage).
 
479
.IP "\fB-f\fP" 5
 
480
force to check whether scrub has started or resumed in userspace.
 
481
this is useful when scrub stat record file is damaged.
 
482
.RE
 
483
.TP
 
484
 
 
485
\fBscrub cancel\fP {\fI<path>\fP|\fI<device>\fP}
 
486
If a scrub is running on the filesystem identified by \fI<path>\fR, cancel it.
 
487
Progress is saved in the scrub progress file and scrubbing can be resumed later
 
488
using the \fBscrub resume\fR command.
 
489
If a \fI<device>\fR is given, the corresponding filesystem is found and
 
490
\fBscrub cancel\fP behaves as if it was called on that filesystem.
 
491
.TP
 
492
 
 
493
\fBscrub resume\fP [-BdqrR] [-c ioprio_class -n ioprio_classdata] {\fI<path>\fP|\fI<device>\fP}
 
494
Resume a canceled or interrupted scrub cycle on the filesystem identified by
 
495
\fI<path>\fR or on a given \fI<device>\fR. Does not start a new scrub if the
 
496
last scrub finished successfully.
 
497
.RS
 
498
 
 
499
\fIOptions\fR
 
500
.TP
 
501
see \fBscrub start\fP.
 
502
.RE
 
503
.TP
 
504
 
 
505
\fBscrub status\fP [-d] {\fI<path>\fP|\fI<device>\fP}
 
506
Show status of a running scrub for the filesystem identified by \fI<path>\fR or
 
507
for the specified \fI<device>\fR.
 
508
If no scrub is running, show statistics of the last finished or canceled scrub
 
509
for that filesystem or device.
 
510
.RS
 
511
 
 
512
\fIOptions\fR
 
513
.IP "\fB-d\fP" 5
 
514
Print separate statistics for each device of the filesystem.
 
515
.RE
 
516
.TP
 
517
 
 
518
\fBcheck\fR [\fIoptions\fP] <device>\fR
 
519
Check an unmounted btrfs filesystem.
 
520
.RS
 
521
 
 
522
\fIOptions\fR
 
523
.IP "\fB-s|--support \fI<superblock>\fP\fR" 5
 
524
use this superblock copy.
 
525
.IP "\fB--repair\fP" 5
 
526
try to repair the filesystem.
 
527
.IP "\fB--init-csum-tree\fP" 5
 
528
create a new CRC tree.
 
529
.IP "\fB--init-extent-tree\fP" 5
 
530
create a new extent tree.
 
531
.RE
 
532
.TP
 
533
 
 
534
\fBrescue chunk-recover\fR [\fIoptions\fP] <device>\fR
 
535
Recover the chunk tree by scanning the devices one by one.
 
536
.RS
 
537
 
 
538
\fIOptions\fR
 
539
.IP "\fB-y\fP" 5
 
540
assume an answer of 'yes' to all questions.
 
541
.IP "\fB-v\fP" 5
 
542
verbose mode.
 
543
.IP "\fB-h\fP" 5
 
544
help.
 
545
.RE
 
546
.TP
 
547
 
 
548
\fBrescue super-recover\fR [\fIoptions\fP] <device>\fR
 
549
Recover bad superblocks from good copies.
 
550
.RS
 
551
 
 
552
\fIOptions\fR
 
553
.IP "\fB-y\fP" 5
 
554
assume an answer of 'yes' to all questions.
 
555
.IP "\fB-v\fP" 5
 
556
verbose mode.
 
557
.RE
 
558
.TP
 
559
 
 
560
\fBrestore\fR [\fIoptions\fP] <device>\fR
 
561
Try to restore files from a damaged filesystem(unmounted).
 
562
.RS
 
563
 
 
564
\fIOptions\fR
 
565
.IP "\fB-s\fP" 5
 
566
get snapshots.
 
567
.IP "\fB-x\fP" 5
 
568
get extended attributes.
 
569
.IP "\fB-v\fP" 5
 
570
verbose.
 
571
.IP "\fB-i\fP" 5
 
572
ignore errors.
 
573
.IP "\fB-o\fP" 5
 
574
overwrite.
 
575
.IP "\fB-t \fI<location>\fP\fP" 5
 
576
tree location.
 
577
.IP "\fB-f \fI<offset>\fP\fP" 5
 
578
filesystem location.
 
579
.IP "\fB-u \fI<block>\fP\fP" 5
 
580
super mirror.
 
581
.IP "\fB-r \fI<rootid>\fP\fP" 5
 
582
root objectid.
 
583
.IP "\fB-d\fP" 5
 
584
find dir.
 
585
.IP "\fB-l\fP" 5
 
586
list tree roots.
 
587
.RE
 
588
.TP
 
589
 
 
590
\fBinspect-internal inode-resolve\fP [-v] \fI<inode>\fP \fI<path>\fP
 
591
Resolves an <inode> in subvolume <path> to all filesystem paths.
 
592
.RS
 
593
 
 
594
\fIOptions\fR
 
595
.IP "\fB-v\fP" 5
 
596
verbose mode. print count of returned paths and ioctl() return value
 
597
.RE
 
598
.TP
 
599
 
 
600
\fBinspect-internal logical-resolve\fP [-Pv] [-s bufsize] \fI<logical>\fP \fI<path>\fP
 
601
Resolves a <logical> address in the filesystem mounted at <path> to all inodes.
 
602
By default, each inode is then resolved to a file system path (similar to the
 
603
\fBinode-resolve\fP subcommand).
 
604
.RS
 
605
 
 
606
\fIOptions\fR
 
607
.IP "\fB-P\fP" 5
 
608
skip the path resolving and print the inodes instead
 
609
.IP "\fB-v\fP" 5
 
610
verbose mode. print count of returned paths and all ioctl() return values
 
611
.IP "\fB-s \fI<bufsize>\fP" 5
 
612
set inode container's size. This is used to increase inode container's size in case it is
 
613
not enough to read all the resolved results. The max value one can set is 64k.
 
614
.RE
 
615
.TP
 
616
 
 
617
\fBinspect-internal subvolid-resolve\fP \fI<subvolid> <path>\fP
 
618
Get file system paths for the given subvolume ID.
 
619
.TP
 
620
 
 
621
\fBinspect-internal rootid\fP \fI<path>\fP
 
622
For a given file or directory, return the containing tree root id. For a
 
623
subvolume return it's own tree id.
 
624
 
 
625
The result is undefined for the so-called empty subvolumes (identified by inode number 2).
 
626
.TP
 
627
 
 
628
\fBsend\fP [-ve] [-p \fI<parent>\fP] [-c \fI<clone-src>\fP] [-f \fI<outfile>\fP] \fI<subvol>\fP [\fI<subvol>...\fP]
 
629
Send the subvolume(s) to stdout.
 
630
Sends the subvolume(s) specified by \fI<subvol>\fR to stdout.
 
631
By default, this will send the whole subvolume. To do an incremental
 
632
send, use '\fI-p <parent>\fR'. If you want to allow btrfs to clone from
 
633
any additional local snapshots, use '\fI-c <clone-src>\fR' (multiple times
 
634
where applicable). You must not specify clone sources unless you
 
635
guarantee that these snapshots are exactly in the same state on both
 
636
sides, the sender and the receiver. It is allowed to omit the '\fI-p <parent>\fR'
 
637
option when '\fI-c <clone-src>\fR' options are given, in
 
638
which case '\fBbtrfs send\fP' will determine a suitable parent among the
 
639
clone sources itself.
 
640
.RS
 
641
 
 
642
\fIOptions\fR
 
643
.IP "\fB-v\fP" 5
 
644
Enable verbose debug output. Each occurrence of this option increases the
 
645
verbose level more.
 
646
.IP "\fB-e\fP" 5
 
647
If sending multiple subvols at once, use the new format and omit the <end cmd> between the subvols.
 
648
.IP "\fB-p \fI<parent>\fP" 5
 
649
Send an incremental stream from \fI<parent>\fR to \fI<subvol>\fR.
 
650
.IP "\fB-c \fI<clone-src>\fP" 5
 
651
Use this snapshot as a clone source for an incremental send (multiple allowed).
 
652
.IP "\fB-f \fI<outfile>\fP" 5
 
653
Output is normally written to stdout. To write to a file, use this option.
 
654
An alternative would be to use pipes.
 
655
.RE
 
656
.TP
 
657
 
 
658
\fBreceive\fP [-ve] [-f \fI<infile>\fR] \fI<mount>\fR
 
659
Receive subvolumes from stdin.
 
660
Receives one or more subvolumes that were previously
 
661
sent with btrfs send. The received subvolumes are stored
 
662
into \fI<mount>\fP.
 
663
btrfs receive will fail with the following case:
 
664
 
 
665
1.a receiving subvolume already exists.
 
666
 
 
667
2.a previously received subvolume was changed after it was received.
 
668
 
 
669
3.default subvolume is changed or you don't mount btrfs filesystem with
 
670
fs tree.
 
671
 
 
672
After receiving a subvolume, it is immediately set to read only.
 
673
.RS
 
674
 
 
675
\fIOptions\fR
 
676
.IP "\fB-v\fP" 5
 
677
Enable verbose debug output. Each occurrence of this option increases the
 
678
verbose level more.
 
679
.IP "\fB-f \fI<infile>\fR" 5
 
680
By default, btrfs receive uses stdin to receive the subvolumes.
 
681
Use this option to specify a file to use instead.
 
682
.IP "\fB-e\fP" 5
 
683
Terminate after receiving an <end cmd> in the data stream.
 
684
Without this option, the receiver terminates only if an error is recognized or on EOF.
 
685
.RE
 
686
.TP
 
687
 
 
688
\fBquota enable\fR \fI<path>\fR
 
689
Enable subvolume quota support for a filesystem.
 
690
.TP
 
691
 
 
692
\fBquota disable\fR \fI<path>\fR
 
693
Disable subvolume quota support for a filesystem.
 
694
.TP
 
695
 
 
696
\fBquota rescan\fR [-s] \fI<path>\fR
 
697
Trash all qgroup numbers and scan the metadata again with the current config.
 
698
.RS
 
699
 
 
700
\fIOptions\fR
 
701
.IP "\fB-s\fP" 5
 
702
show status of a running rescan operation.
 
703
.RE
 
704
.TP
 
705
 
 
706
\fBqgroup assign\fP \fI<src> <dst> <path>\fP
 
707
Enable subvolume qgroup support for a filesystem.
 
708
.TP
 
709
 
 
710
\fBqgroup remove\fP \fI<src> <dst> <path>\fP
 
711
Remove a subvol from a quota group.
 
712
.TP
 
713
 
 
714
\fBqgroup create\fP \fI<qgroupid> <path>\fP
 
715
Create a subvolume quota group.
 
716
.TP
 
717
 
 
718
\fBqgroup destroy\fP \fI<qgroupid> <path>\fP
 
719
Destroy a subvolume quota group.
 
720
.TP
 
721
 
 
722
\fBqgroup show\fP \fI<path>\fP
 
723
Show all subvolume quota groups.
 
724
.TP
 
725
 
 
726
\fBqgroup limit\fP [\fIoptions\fP] \fI<size>\fP|\fBnone\fP [\fI<qgroupid>\fP] \fI<path>\fP
 
727
Limit the size of a subvolume quota group.
 
728
.TP
 
729
 
 
730
\fBreplace start\fR [-Bfr] \fI<srcdev>\fP|\fI<devid> <targetdev> <path>\fR
 
731
Replace device of a btrfs filesystem.
 
732
On a live filesystem, duplicate the data to the target device which
 
733
is currently stored on the source device. If the source device is not
 
734
available anymore, or if the \fB-r\fR option is set, the data is built
 
735
only using the RAID redundancy mechanisms. After completion of the
 
736
operation, the source device is removed from the filesystem.
 
737
If the \fI<srcdev>\fR is a numerical value, it is assumed to be the device id
 
738
of the filesystem which is mounted at mount_point, otherwise is is
 
739
the path to the source device. If the source device is disconnected,
 
740
from the system, you have to use the \fIdevid\fR parameter format.
 
741
The \fI<targetdev>\fP needs to be same size or larger than the \fI<srcdev>\fR.
 
742
.RS
 
743
 
 
744
\fIOptions\fR
 
745
.IP "\fB-r\fP" 5
 
746
only read from \fI<srcdev>\fR if no other zero-defect mirror exists (enable
 
747
this if your drive has lots of read errors, the access would be very slow)
 
748
.IP "\fB-f\fP" 5
 
749
force using and overwriting \fI<targetdev>\fR even if it looks like
 
750
containing a valid btrfs filesystem. A valid filesystem is
 
751
assumed if a btrfs superblock is found which contains a
 
752
correct checksum. Devices which are currently mounted are
 
753
never allowed to be used as the \fI<targetdev>\fR
 
754
.IP "\fB-B\fP" 5
 
755
do not background
 
756
.RE
 
757
.TP
 
758
 
 
759
\fBreplace status\fR [-1] \fI<mount_point>\fR
 
760
Print status and progress information of a running device replace operation.
 
761
.RS
 
762
 
 
763
\fIOptions\fR
 
764
.IP "\fB-1\fP" 5
 
765
print once instead of print continuously until the replace
 
766
operation finishes (or is canceled)
 
767
.RE
 
768
.TP
 
769
 
 
770
\fBreplace cancel\fR \fI<mount_point>\fR
 
771
Cancel a running device replace operation.
 
772
.RE
 
773
 
 
774
.SH EXIT STATUS
 
775
\fBbtrfs\fR returns a zero exist status if it succeeds. Non zero is returned in
 
776
case of failure.
 
777
 
 
778
.SH AVAILABILITY
 
779
.B btrfs
 
780
is part of btrfs-progs. Btrfs filesystem is currently under heavy development,
 
781
and not suitable for any uses other than benchmarking and review.
 
782
Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
 
783
further details.
 
784
.SH SEE ALSO
 
785
.BR mkfs.btrfs (8),
 
786
.BR ionice (1)