Debian Codegraph @

upstream/opensuse-leap-16-1/man8/btrfs-rescue.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-RESCUE" "8" "Mar 26, 2025" "6.14" "BTRFS"
31 .SH NAME
32 btrfs-rescue \- recover a damaged btrfs filesystem
33 .SH SYNOPSIS
34 .sp
35 \fBbtrfs rescue\fP <subcommand> <args>
36 .SH DESCRIPTION
37 .sp
38 \fBbtrfs rescue\fP is used to try to recover a damaged btrfs filesystem.
39 .SH SUBCOMMAND
40 .INDENT 0.0
41 .TP
42 .B chunk\-recover [options] <device>
43 Recover the chunk tree by scanning the devices
44 .sp
45 \fBOptions\fP
46 .INDENT 7.0
47 .TP
48 .B \-y
49 assume an answer of \fIyes\fP to all questions.
50 .TP
51 .B \-h
52 help.
53 .TP
54 .B \-v
55 (deprecated) alias for global \fI\-v\fP option
56 .UNINDENT
57 .UNINDENT
58 .sp
59 \fBNOTE:\fP
60 .INDENT 0.0
61 .INDENT 3.5
62 Since \fBchunk\-recover\fP will scan the whole device, it will be very
63 slow especially executed on a large device.
64 .UNINDENT
65 .UNINDENT
66 .INDENT 0.0
67 .TP
68 .B fix\-device\-size <device>
69 fix device size and super block total bytes values that do not match
70 .sp
71 Kernel 4.11 starts to check the device size more strictly and this might
72 mismatch the stored value of total bytes. See the exact error message below.
73 Newer kernel will refuse to mount the filesystem where the values do not match.
74 This error is not fatal and can be fixed. This command will fix the device
75 size values if possible.
76 .INDENT 7.0
77 .INDENT 3.5
78 .sp
79 .EX
80 BTRFS error (device sdb): super_total_bytes 92017859088384 mismatch with fs_devices total_rw_bytes 92017859094528
81 .EE
82 .UNINDENT
83 .UNINDENT
84 .sp
85 The mismatch may also exhibit as a kernel warning:
86 .INDENT 7.0
87 .INDENT 3.5
88 .sp
89 .EX
90 WARNING: CPU: 3 PID: 439 at fs/btrfs/ctree.h:1559 btrfs_update_device+0x1c5/0x1d0 [btrfs]
91 .EE
92 .UNINDENT
93 .UNINDENT
94 .UNINDENT
95 .INDENT 0.0
96 .TP
97 .B clear\-ino\-cache <device>
98 Remove leftover items pertaining to the deprecated \fIinode cache\fP feature.
99 .sp
100 The \fIinode cache\fP feature (enabled by mount option \(dqinode_cache\(dq) has been
101 completely removed in 5.11 kernel.
102 .TP
103 .B clear\-space\-cache <v1|v2> <device>
104 Completely remove the on\-disk data of free space cache of given version.
105 .sp
106 Especially for v1 free space cache, \fIclear_cache\fP mount option would only
107 remove the cache for updated block groups, the remaining would not be removed.
108 Thus this command is provided to manually clear the free space cache.
109 .UNINDENT
110 .INDENT 0.0
111 .TP
112 .B clear\-uuid\-tree <device>
113 Clear the UUID tree, so that kernel can regenerate it at next read\-write
114 mount.
115 .sp
116 Since kernel v4.16 there are more sanity check performed, and sometimes
117 non\-critical trees like UUID tree can cause problems and reject the mount.
118 In such case, clearing UUID tree may make the filesystem to be mountable again
119 without much risk as it\(aqs built from other trees.
120 See also \fI\%mount option rescan_uuid_tree (in btrfs\-man5)\fP\&.
121 .TP
122 .B super\-recover [options] <device>
123 Recover bad superblocks from good copies.
124 .sp
125 \fBOptions\fP
126 .INDENT 7.0
127 .TP
128 .B \-y
129 assume an answer of \fIyes\fP to all questions.
130 .TP
131 .B \-v
132 (deprecated) alias for global \fI\-v\fP option
133 .UNINDENT
134 .TP
135 .B zero\-log <device>
136 clear the filesystem log tree
137 .sp
138 This command will clear the filesystem log tree. This may fix a specific
139 set of problem when the filesystem mount fails due to the log replay. See below
140 for sample stack traces that may show up in system log.
141 .sp
142 The common case where this happens was fixed a long time ago,
143 so it is unlikely that you will see this particular problem, but the command is
144 kept around.
145 .sp
146 \fBNOTE:\fP
147 .INDENT 7.0
148 .INDENT 3.5
149 Clearing the log may lead to loss of changes that were made
150 since the last transaction commit. This may be up to 30 seconds
151 (default commit period) or less if the commit was implied by
152 other filesystem activity.
153 .UNINDENT
154 .UNINDENT
155 .sp
156 One can determine whether \fBzero\-log\fP is needed according to the kernel
157 backtrace:
158 .INDENT 7.0
159 .INDENT 3.5
160 .sp
161 .EX
162 ? replay_one_dir_item+0xb5/0xb5 [btrfs]
163 ? walk_log_tree+0x9c/0x19d [btrfs]
164 ? btrfs_read_fs_root_no_radix+0x169/0x1a1 [btrfs]
165 ? btrfs_recover_log_trees+0x195/0x29c [btrfs]
166 ? replay_one_dir_item+0xb5/0xb5 [btrfs]
167 ? btree_read_extent_buffer_pages+0x76/0xbc [btrfs]
168 ? open_ctree+0xff6/0x132c [btrfs]
169 .EE
170 .UNINDENT
171 .UNINDENT
172 .sp
173 If the errors are like above, then \fBzero\-log\fP should be used to clear
174 the log and the filesystem may be mounted normally again. The keywords to look
175 for are \(aqopen_ctree\(aq which says that it\(aqs during mount and function names
176 that contain \fIreplay\fP, \fIrecover\fP or \fIlog_tree\fP\&.
177 .UNINDENT
178 .SH EXIT STATUS
179 .sp
180 \fBbtrfs rescue\fP returns a zero exit status if it succeeds. Non zero is
181 returned in case of failure.
182 .SH AVAILABILITY
183 .sp
184 \fBbtrfs\fP is part of btrfs\-progs. Please refer to the documentation at
185 \X'tty: link https://btrfs.readthedocs.io'\fI\%https://btrfs.readthedocs.io\fP\X'tty: link'\&.
186 .SH SEE ALSO
187 .sp
188 \fI\%btrfs\-check(8)\fP,
189 \fI\%btrfs\-scrub(8)\fP,
190 \fI\%mkfs.btrfs(8)\fP
191 .\" Generated by docutils manpage writer.
192 .