'\" t
.\" Title: btrfs-restore
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1
.\" Date: 06/20/2015
.\" Manual: Btrfs Manual
.\" Source: Btrfs v3.17
.\" Language: English
.\"
.TH "BTRFS\-RESTORE" "8" "06/20/2015" "Btrfs v3\&.17" "Btrfs Manual"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
btrfs-restore \- try to restore files from a damaged btrfs filesystem(unmounted)
.SH "SYNOPSIS"
.sp
\fBbtrfs restore\fR [options] \fI\fR \fI\fR | \-l \fI\fR
.SH "DESCRIPTION"
.sp
\fBbtrfs restore\fR is used to try to salvage files from a damaged filesystem and restore them into \fI\fR or just list the tree roots\&.
.sp
Since current \fBbtrfs\-check\fR(8) or \fBbtrfs\-rescue\fR(8) only has very limited usage, \fBbtrfs restore\fR is normally a better choice\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
.sp
It is recommended to read the following btrfs wiki page if your data is not salvaged with default option: \m[blue]\fBhttps://btrfs\&.wiki\&.kernel\&.org/index\&.php/Restore\fR\m[]
.sp .5v
.RE
.SH "OPTIONS"
.PP
\-s
.RS 4
get snapshots, btrfs restore skips snapshots in default\&.
.RE
.PP
\-x
.RS 4
get extended attributes\&.
.RE
.PP
\-v
.RS 4
verbose\&.
.RE
.PP
\-i
.RS 4
ignore errors\&.
.RE
.PP
\-o
.RS 4
overwrite directories/files in
\fI\fR\&.
.RE
.PP
\-t \fI\fR
.RS 4
use
\fI\fR
to read root tree\&.
.RE
.PP
\-f \fI\fR
.RS 4
only restore files that are under specified root whose root bytenr is
\fI\fR\&.
.RE
.PP
\-u \fI\fR
.RS 4
use given superblock mirror identified by
\fI\fR, it can be 0,1,2\&.
.RE
.PP
\-r \fI\fR
.RS 4
only restore files that are under specified root whose objectid is
\fI\fR\&.
.RE
.PP
\-d
.RS 4
find dir\&.
.RE
.PP
\-l
.RS 4
list tree roots\&.
.RE
.PP
\-D|\-\-dry\-run
.RS 4
dry run (only list files that would be recovered)\&.
.RE
.PP
\-\-path\-regex \fI\fR
.RS 4
restore only filenames matching regex, you have to use following syntax (possibly quoted): ^/(|home(|/username(|/Desktop(|/\&.*))))$
.RE
.PP
\-c
.RS 4
ignore case (\-\-path\-regrex only)\&.
.RE
.SH "EXIT STATUS"
.sp
\fBbtrfs restore\fR returns a zero exit status if it succeeds\&. Non zero is returned in case of failure\&.
.SH "AVAILABILITY"
.sp
\fBbtrfs\fR is part of btrfs\-progs\&. Please refer to the btrfs wiki \m[blue]\fBhttp://btrfs\&.wiki\&.kernel\&.org\fR\m[] for further details\&.
.SH "SEE ALSO"
.sp
\fBmkfs\&.btrfs\fR(8), \fBbtrfs\-rescue\fR(8), \fBbtrfs\-check\fR(8)