Debian Codegraph @

upstream/debian-trixie/man8/btrfs-image.8

raw
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-IMAGE" "8" "May 18, 2026" "7.0" "BTRFS"
31 .SH NAME
32 btrfs-image \- create/restore an image of the filesystem
33 .SH SYNOPSIS
34 .sp
35 \fBbtrfs\-image\fP [options] <source> <target>
36 .SH DESCRIPTION
37 .sp
38 \fBbtrfs\-image\fP is used to create an image of a btrfs filesystem.
39 All data will be zeroed, but metadata and the like is preserved.
40 Mainly used for debugging purposes.
41 .sp
42 In the dump mode, source is the btrfs device/file and target is the output
43 file (use \fI\-\fP for stdout).
44 .sp
45 In the restore mode (option \fI\-r\fP), source is the dumped image and target is the btrfs device/file.
46 .SH OPTIONS
47 .INDENT 0.0
48 .TP
49 .B \-r
50 Restore metadump image. By default, this fixes super\(aqs chunk tree, by
51 using 1 stripe pointing to primary device, so that file system can be
52 restored by running tree log reply if possible. To restore without
53 changing number of stripes in chunk tree check \fI\-o\fP option.
54 .TP
55 .BI \-c \ <value>
56 Compression level (0 ~ 9).
57 .TP
58 .BI \-t \ <value>
59 Number of threads (1 ~ 32) to be used to process the image dump or restore.
60 .TP
61 .B \-o
62 Use the old restore method, this does not fixup the chunk tree so the restored
63 file system will not be able to be mounted.
64 .TP
65 .B \-s
66 Sanitize the file names when generating the image. Not recommended as
67 this would introduce new file name hash mismatches, thus if your
68 problem involves subvolume tress, it can even mask existing problems.
69 Furthermore kernels can not do proper path resolution due to the
70 introduced hash mismatches.
71 .sp
72 One \fI\-s\fP means just generate random garbage, which means that the
73 directory hash won\(aqt match its file names. Using two \fI\-s\fP will
74 calculate a collision for the file name so that the hashes match, and
75 if it can\(aqt calculate a collision then it will just generate garbage.
76 The collision calculator is very time and CPU intensive.
77 .TP
78 .B \-w
79 Walk all the trees manually and copy any blocks that are referenced. Use this
80 option if your extent tree is corrupted to make sure that all of the metadata is
81 captured.
82 .TP
83 .B \-m
84 Restore for multiple devices, more than 1 device should be provided.
85 .TP
86 .B \-\-version
87 Print the \fBbtrfs\-image\fP version, builtin features and exit.
88 .UNINDENT
89 .SH EXIT STATUS
90 .sp
91 \fBbtrfs\-image\fP will return 0 if no error happened.
92 If any problems happened, 1 will be returned.
93 .SH SEE ALSO
94 .sp
95 \fI\%mkfs.btrfs(8)\fP
96 .\" Generated by docutils manpage writer.
97 .