summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-40/man8/btrfs-image.8
blob: ae6f33af18fe59b2884a5f992540cabb45fedae2 (plain)
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
.\" 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-IMAGE" "8" "Mar 26, 2024" "6.8" "BTRFS"
.SH NAME
btrfs-image \- create/restore an image of the filesystem
.SH SYNOPSIS
.sp
\fBbtrfs\-image\fP [options] <source> <target>
.SH DESCRIPTION
.sp
\fBbtrfs\-image\fP is used to create an image of a btrfs filesystem.
All data will be zeroed, but metadata and the like is preserved.
Mainly used for debugging purposes.
.sp
In the dump mode, source is the btrfs device/file and target is the output
file (use \fI\-\fP for stdout).
.sp
In the restore mode (option \fI\-r\fP), source is the dumped image and target is the btrfs device/file.
.SH OPTIONS
.INDENT 0.0
.TP
.B  \-r
Restore metadump image. By default, this fixes super\(aqs chunk tree, by
using 1 stripe pointing to primary device, so that file system can be
restored by running tree log reply if possible. To restore without
changing number of stripes in chunk tree check \fI\-o\fP option.
.TP
.BI \-c \ <value>
Compression level (0 ~ 9).
.TP
.BI \-t \ <value>
Number of threads (1 ~ 32) to be used to process the image dump or restore.
.TP
.B  \-o
Use the old restore method, this does not fixup the chunk tree so the restored
file system will not be able to be mounted.
.TP
.B  \-s
Sanitize the file names when generating the image. One \-s means just
generate random garbage, which means that the directory indexes won\(aqt match up
since the hashes won\(aqt match with the garbage filenames. Using \fI\-s\fP will
calculate a collision for the filename so that the hashes match, and if it
can\(aqt calculate a collision then it will just generate garbage.  The collision
calculator is very time and CPU intensive so only use it if you are having
problems with your file system tree and need to have it mostly working.
.TP
.B  \-w
Walk all the trees manually and copy any blocks that are referenced. Use this
option if your extent tree is corrupted to make sure that all of the metadata is
captured.
.TP
.B  \-m
Restore for multiple devices, more than 1 device should be provided.
.UNINDENT
.SH EXIT STATUS
.sp
\fBbtrfs\-image\fP will return 0 if no error happened.
If any problems happened, 1 will be returned.
.SH SEE ALSO
.sp
\fI\%mkfs.btrfs(8)\fP
.\" Generated by docutils manpage writer.
.