summaryrefslogtreecommitdiffstats
path: root/upstream/fedora-rawhide/man8/btrfs-receive.8
blob: 3d8969e3b2b009358cfd9214f366f091125f54f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
.\" Man page generated from reStructuredText.
.
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin
\\$1 \\n[an-margin]
level \\n[rst2man-indent-level]
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
-
\\n[rst2man-indent0]
\\n[rst2man-indent1]
\\n[rst2man-indent2]
..
.de1 INDENT
.\" .rstReportMargin pre:
. RS \\$1
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
. nr rst2man-indent-level +1
.\" .rstReportMargin post:
..
.de UNINDENT
. RE
.\" indent \\n[an-margin]
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
.nr rst2man-indent-level -1
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "BTRFS-RECEIVE" "8" "Mar 26, 2024" "6.8.1" "BTRFS"
.SH NAME
btrfs-receive \- receive subvolumes from send stream
.SH SYNOPSIS
.sp
\fBbtrfs receive\fP [options] <path>
.sp
or
.sp
\fBbtrfs receive\fP \-\-dump [options]
.SH DESCRIPTION
.sp
Receive a stream of changes and replicate one or more subvolumes that were
previously generated by \fBbtrfs send\fP\&. The received subvolumes are stored to
\fIpath\fP, unless \fI\-\-dump\fP option is given.
.sp
If \fI\-\-dump\fP option is specified, \fBbtrfs receive\fP will only do the validation of
the stream, and print the stream metadata, one operation per line.
.sp
\fBbtrfs receive\fP will fail in the following cases:
.INDENT 0.0
.IP 1. 3
receiving subvolume already exists
.IP 2. 3
previously received subvolume has been changed after it was received
.IP 3. 3
default subvolume has changed or you didn\(aqt mount the filesystem at the toplevel subvolume
.UNINDENT
.sp
A subvolume is made read\-only after the receiving process finishes successfully (see BUGS below).
.sp
\fBOptions\fP
.INDENT 0.0
.TP
.BI \-f \ <FILE>
read the stream from \fIFILE\fP instead of stdin,
.UNINDENT
.INDENT 0.0
.TP
.B \-C|\-\-chroot
confine the process to \fIpath\fP using \fI\%chroot(1)\fP
.UNINDENT
.INDENT 0.0
.TP
.B  \-e
terminate after receiving an \fIend cmd\fP marker in the stream.
.sp
Without this option the receiver side terminates only in case
of an error on end of file.
.UNINDENT
.INDENT 0.0
.TP
.B \-E|\-\-max\-errors <NERR>
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.
.UNINDENT
.INDENT 0.0
.TP
.BI \-m \ <ROOTMOUNT>
the root mount point of the destination filesystem
.sp
By default the mount point is searched in :\fI\%file:/proc/self\fP/mounts\(ga.
If \fB/proc\fP is not accessible, e.g. in a chroot environment, use this option to
tell us where this filesystem is mounted.
.TP
.B  \-\-force\-decompress
if the stream contains compressed data (see \fI\-\-compressed\-data\fP in
\fI\%btrfs\-send(8)\fP), always decompress it instead of writing it with
encoded I/O
.TP
.B  \-\-dump
dump the stream metadata, one line per operation
.sp
Does not require the \fIpath\fP parameter. The filesystem remains unchanged.
.UNINDENT
.INDENT 0.0
.TP
.B \-q|\-\-quiet
(deprecated) alias for global \fI\-q\fP option
.UNINDENT
.INDENT 0.0
.TP
.B  \-v
(deprecated) alias for global \fI\-v\fP option
.UNINDENT
.sp
\fBGlobal options\fP
.INDENT 0.0
.TP
.B \-v|\-\-verbose
increase verbosity about performed actions, print details about each operation
.TP
.B \-q|\-\-quiet
suppress all messages except errors
.UNINDENT
.SH BUGS
.sp
\fBbtrfs receive\fP sets the subvolume read\-only after it completes
successfully.  However, while the receive is in progress, users who have
write access to files or directories in the receiving \fIpath\fP can add,
remove, or modify files, in which case the resulting read\-only subvolume
will not be an exact copy of the sent subvolume.
.sp
If the intention is to create an exact copy, the receiving \fIpath\fP
should be protected from access by users until the receive operation
has completed and the subvolume is set to read\-only.
.sp
Additionally, receive does not currently do a very good job of validating
that an incremental send stream actually makes sense, and it is thus
possible for a specially crafted send stream to create a subvolume with
reflinks to arbitrary files in the same filesystem.  Because of this,
users are advised to not use \fIbtrfs receive\fP on send streams from
untrusted sources, and to protect trusted streams when sending them
across untrusted networks.
.SH EXIT STATUS
.sp
\fBbtrfs receive\fP returns a zero exit status if it succeeds. Non zero is
returned in case of failure.
.SH AVAILABILITY
.sp
\fBbtrfs\fP is part of btrfs\-progs.  Please refer to the documentation at
\fI\%https://btrfs.readthedocs.io\fP\&.
.SH SEE ALSO
.sp
\fI\%btrfs\-send(8)\fP,
\fI\%mkfs.btrfs(8)\fP
.\" Generated by docutils manpage writer.
.