From 30d5c8a49f088d76fb2806240393fc035ed75290 Mon Sep 17 00:00:00 2001 From: Miao Xie Date: Wed, 3 Jul 2013 21:25:17 +0800 Subject: Btrfs-progs: Add chunk recover function - using old chunk items Add chunk-recover program to check or rebuild chunk tree when the system chunk array or chunk tree is broken. Due to the importance of the system chunk array and chunk tree, if one of them is broken, the whole btrfs will be broken even other data are OK. But we have some hint(fsid, checksum...) to salvage the old metadata. So this function will first scan the whole file system and collect the needed data(chunk/block group/dev extent), and check for the references between them. If the references are OK, the chunk tree can be rebuilt and luckily the file system will be mountable. Signed-off-by: Qu Wenruo Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- commands.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'commands.h') diff --git a/commands.h b/commands.h index 15c616d5..65829f49 100644 --- a/commands.h +++ b/commands.h @@ -94,6 +94,7 @@ extern const struct cmd_group replace_cmd_group; extern const char * const cmd_send_usage[]; extern const char * const cmd_receive_usage[]; extern const char * const cmd_check_usage[]; +extern const char * const cmd_chunk_recover_usage[]; extern const char * const cmd_restore_usage[]; int cmd_subvolume(int argc, char **argv); @@ -102,6 +103,7 @@ int cmd_balance(int argc, char **argv); int cmd_device(int argc, char **argv); int cmd_scrub(int argc, char **argv); int cmd_check(int argc, char **argv); +int cmd_chunk_recover(int argc, char **argv); int cmd_inspect(int argc, char **argv); int cmd_send(int argc, char **argv); int cmd_receive(int argc, char **argv); -- cgit v1.2.3