btrfs-progs: restore: add more long option variants
[platform/upstream/btrfs-progs.git] / Documentation / btrfs-restore.asciidoc
1 btrfs-restore(8)
2 ================
3
4 NAME
5 ----
6 btrfs-restore - try to restore files from a damaged btrfs filesystem image
7
8 SYNOPSIS
9 --------
10 *btrfs restore* [options] <device> <path> | -l <device>
11
12 DESCRIPTION
13 -----------
14 *btrfs restore* is used to try to salvage files from a damaged filesystem and
15 restore them into <path> or just list the tree roots.
16
17 Since current `btrfs-check`(8) or `btrfs-rescue`(8) only has very limited usage,
18 *btrfs restore* is normally a better choice.
19
20 NOTE: It is recommended to read the following btrfs wiki page if your data is
21 not salvaged with default option: +
22 https://btrfs.wiki.kernel.org/index.php/Restore
23
24 OPTIONS
25 -------
26 -s|--snapshots::
27 get snapshots, btrfs restore skips snapshots in default.
28
29 -x|--xattr::
30 get extended attributes.
31
32 -m|--metadata::
33 restore owner, mode and times.
34
35 -S|--symlinks::
36 restore symbolic links as well as normal files.
37
38 -v|--verbose::
39 verbose.
40
41 -i|--ignore-errors::
42 ignore errors.
43
44 -o|--overwrite::
45 overwrite directories/files in <path>.
46
47 -t <bytenr>::
48 use <bytenr> to read root tree.
49
50 -f <bytenr>::
51 only restore files that are under specified root whose root bytenr is <bytenr>.
52
53 -u|--super <mirror>::
54 use given superblock mirror identified by <mirror>, it can be 0,1,2.
55
56 -r|--root <rootid>::
57 only restore files that are under specified root whose objectid is <rootid>.
58
59 -d::
60 find dir.
61
62 -l|--list-roots::
63 list tree roots.
64
65 -D|--dry-run::
66 dry run (only list files that would be recovered).
67
68 --path-regex <regex>::
69 restore only filenames matching regex, you have to use following syntax (possibly quoted):
70 +
71 +^/(|home(|/username(|/Desktop(|/.*))))$+
72
73 -c::
74 ignore case (--path-regex only).
75
76 EXIT STATUS
77 -----------
78 *btrfs restore* returns a zero exit status if it succeeds. Non zero is
79 returned in case of failure.
80
81 AVAILABILITY
82 ------------
83 *btrfs* is part of btrfs-progs.
84 Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for
85 further details.
86
87 SEE ALSO
88 --------
89 `mkfs.btrfs`(8),
90 `btrfs-rescue`(8),
91 `btrfs-check`(8)