Debian Codegraph @

upstream/debian-trixie/man8/btrfs-restore.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-RESTORE" "8" "May 18, 2026" "7.0" "BTRFS"
31 .SH NAME
32 btrfs-restore \- try to restore files from a damaged filesystem image
33 .SH SYNOPSIS
34 .sp
35 \fBbtrfs restore\fP [options] <device> <path> | \-l <device>
36 .SH DESCRIPTION
37 .sp
38 \fBbtrfs restore\fP is used to try to salvage files from a damaged filesystem and
39 restore them into \fIpath\fP or just list the subvolume tree roots. The filesystem
40 image is not modified.
41 .sp
42 If the filesystem is damaged and cannot be repaired by the other tools
43 (\fI\%btrfs\-check(8)\fP or \fI\%btrfs\-rescue(8)\fP),
44 \fBbtrfs restore\fP could be used to
45 retrieve file data, as far as the metadata are readable. The checks done by
46 restore are less strict and the process is usually able to get far enough to
47 retrieve data from the whole filesystem. This comes at a cost that some data
48 might be incomplete or from older versions if they\(aqre available.
49 .sp
50 There are several options to attempt restoration of various file metadata type.
51 You can try a dry run first to see how well the process goes and use further
52 options to extend the set of restored metadata.
53 .sp
54 For images with damaged tree structures, there are several options to point the
55 process to some spare copy.
56 .SH OPTIONS
57 .INDENT 0.0
58 .TP
59 .B \-s|\-\-snapshots
60 get also snapshots that are skipped by default
61 .TP
62 .B \-x|\-\-xattr
63 get extended attributes
64 .TP
65 .B \-m|\-\-metadata
66 restore owner, mode and times for files and directories
67 .TP
68 .B \-S|\-\-symlinks
69 restore symbolic links as well as normal files
70 .TP
71 .B \-i|\-\-ignore\-errors
72 ignore errors during restoration and continue
73 .TP
74 .B \-o|\-\-overwrite
75 overwrite directories/files in \fIpath\fP, e.g. for repeated runs
76 .UNINDENT
77 .INDENT 0.0
78 .TP
79 .BI \-t \ <bytenr>
80 use \fIbytenr\fP to read the root tree
81 .TP
82 .BI \-f \ <bytenr>
83 only restore files that are under specified subvolume root pointed by \fIbytenr\fP
84 .UNINDENT
85 .INDENT 0.0
86 .TP
87 .B \-u|\-\-super <mirror>
88 use given superblock mirror identified by <mirror>, it can be 0,1 or 2
89 .TP
90 .B \-r|\-\-root <rootid>
91 only restore files that are under a specified subvolume whose objectid is \fIrootid\fP
92 .UNINDENT
93 .INDENT 0.0
94 .TP
95 .B \-d
96 find directory
97 .UNINDENT
98 .INDENT 0.0
99 .TP
100 .B \-l|\-\-list\-roots
101 list subvolume tree roots, can be used as argument for \fI\-r\fP
102 .TP
103 .B \-D|\-\-dry\-run
104 dry run (only list files that would be recovered)
105 .UNINDENT
106 .INDENT 0.0
107 .TP
108 .BI \-\-path\-regex \ <regex>
109 restore only filenames matching a regular expression (\X'tty: link https://man7.org/linux/man-pages/man7/regex.7.html'\fI\%regex(7)\fP\X'tty: link')
110 with a mandatory format
111 .sp
112 \fB^/(|home(|/username(|/Desktop(|/.*))))$\fP
113 .sp
114 The format is not very comfortable and restores all files in the
115 directories in the whole path, so this is not useful for restoring
116 single file in a deep hierarchy.
117 .TP
118 .B \-c
119 ignore case (\fI\-\-path\-regex\fP only)
120 .UNINDENT
121 .INDENT 0.0
122 .TP
123 .B \-v|\-\-verbose
124 (deprecated) alias for global \fI\-v\fP option
125 .UNINDENT
126 .sp
127 \fBGlobal options\fP
128 .INDENT 0.0
129 .TP
130 .B \-v|\-\-verbose
131 be verbose and print what is being restored
132 .UNINDENT
133 .SH EXIT STATUS
134 .sp
135 \fBbtrfs restore\fP returns a zero exit status if it succeeds. Non zero is
136 returned in case of failure.
137 .SH AVAILABILITY
138 .sp
139 \fBbtrfs\fP is part of btrfs\-progs. Please refer to the documentation at
140 \X'tty: link https://btrfs.readthedocs.io'\fI\%https://btrfs.readthedocs.io\fP\X'tty: link'\&.
141 .SH SEE ALSO
142 .sp
143 \fI\%btrfs\-check(8)\fP,
144 \fI\%btrfs\-rescue(8)\fP,
145 \fI\%mkfs.btrfs(8)\fP
146 .\" Generated by docutils manpage writer.
147 .