'\" t
.\"     Title: btrfs-receive
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 08/06/2017
.\"    Manual: Btrfs Manual
.\"    Source: Btrfs v4.9.1
.\"  Language: English
.\"
.TH "BTRFS\-RECEIVE" "8" "08/06/2017" "Btrfs v4\&.9\&.1" "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-receive \- receive subvolumes from send stream
.SH "SYNOPSIS"
.sp
\fBbtrfs receive\fR [options] \fI<path>\fR
.sp
or
.sp
\fBbtrfs receive\fR \-\-dump [options]
.SH "DESCRIPTION"
.sp
Receive a stream of changes and replicate one or more subvolumes that were previously generated by \fBbtrfs send\fR\&. The received subvolumes are stored to \fIpath\fR, unless \fI\-\-dump\fR option is given\&.
.sp
If \fI\-\-dump\fR option is specified, \fBbtrfs receive\fR will only do the validation of the stream, and print the stream metadata, one operation per line\&.
.sp
\fBbtrfs receive\fR will fail int the following cases:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
receiving subvolume already exists
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
previously received subvolume has been changed after it was received
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
default subvolume has changed or you didn\(cqt mount the filesystem at the toplevel subvolume
.RE
.sp
A subvolume is made read\-only after the receiving process finishes succesfully\&.
.sp
\fBOptions\fR
.PP
\-v
.RS 4
increase verbosity about performed actions, print details about each operation
.RE
.PP
\-f \fI<FILE>\fR
.RS 4
read the stream from
\fI<FILE>\fR
instead of stdin,
.RE
.PP
\-C|\-\-chroot
.RS 4
confine the process to
\fIpath\fR
using
\fBchroot\fR(1)
.RE
.PP
\-e
.RS 4
terminate after receiving an
\fIend cmd\fR
marker in the stream\&.
.sp
Without this option the receiver side terminates only in case of an error on end of file\&.
.RE
.PP
\-E|\-\-max\-errors \fI<NERR>\fR
.RS 4
terminate as soon as NERR errors occur while stream processing commands from the stream
.sp
Default value is 1\&. A value of 0 means no limit\&.
.RE
.PP
\-m \fI<ROOTMOUNT>\fR
.RS 4
the root mount point of the destination filesystem
.sp
By default the mountpoint is searched in
\fI/proc/self/mounts\fR\&. If
\fI/proc\fR
is not accessible, eg\&. in a chroot environment, use this option to tell us where this filesystem is mounted\&.
.RE
.PP
\-\-dump
.RS 4
dump the stream metadata, one line per operation
.sp
Does not require the
\fIpath\fR
parameter\&. The filesystem chanded\&.
.RE
.SH "EXIT STATUS"
.sp
\fBbtrfs receive\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\-send\fR(8)
