32d8a927970453376bca8ad062f82bf22ea5f7be
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-rescue.asciidoc
1 btrfs-check(8)
2 ==============
3
4 NAME
5 ----
6 btrfs-rescue - Recover a damaged btrfs filesystem
7
8 SYNOPSIS
9 --------
10 *btrfs rescue* <subcommand> <args>
11
12 DESCRIPTION
13 -----------
14 *btrfs rescue* is used to try to recover a damaged btrfs filesystem.
15
16 SUBCOMMAND
17 ----------
18 *chunk-recover* [options] <device>::
19 Recover the chunk tree by scanning the devices
20 +
21 `Options`
22 +
23 -y::::
24 assume an answer of 'yes' to all questions.
25 -v::::
26 verbose mode.
27 -h::::
28 help.
29
30 NOTE: Since *chunk-recover* will scan the whole device, it will be *VERY* slow
31 especially executed on a large device.
32
33 *super-recover* [options] <device>::
34 Recover bad superblocks from good copies.
35 +
36 `Options`
37 +
38 -y::::
39 assume an answer of 'yes' to all questions.
40 -v::::
41 verbose mode.
42
43 *zero-log* <device>::
44 clear out log tree
45
46 *btrfs rescue zero-log* will remove the log tree if log tree is corrupt, which
47 will allow you to mount the filesystem again.
48
49 The common case where this happens has been fixed a long time ago,
50 so it is unlikely that you will see this particular problem.
51
52 One can determine whether *btrfs-zero-log* is needed according to the kernel
53 backtrace:
54 ----
55 ? replay_one_dir_item+0xb5/0xb5 [btrfs]
56 ? walk_log_tree+0x9c/0x19d [btrfs]
57 ? btrfs_read_fs_root_no_radix+0x169/0x1a1 [btrfs]
58 ? btrfs_recover_log_trees+0x195/0x29c [btrfs]
59 ? replay_one_dir_item+0xb5/0xb5 [btrfs]
60 ? btree_read_extent_buffer_pages+0x76/0xbc [btrfs]
61 ? open_ctree+0xff6/0x132c [btrfs]
62 ----
63
64 If the errors are like above, then *zero-log* could be used to clear
65 the log and the filesystem may be mounted normally again.
66
67 EXIT STATUS
68 -----------
69 *btrfs rescue* returns a zero exit status if it succeeds. Non zero is
70 returned in case of failure.
71
72 AVAILABILITY
73 ------------
74 *btrfs* is part of btrfs-progs.
75 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
76 further details.
77
78 SEE ALSO
79 --------
80 `mkfs.btrfs`(8),
81 `btrfs-scrub`(8),
82 `btrfs-check`(8)