Debian Codegraph @

upstream/debian-trixie/man8/btrfs-receive.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-RECEIVE" "8" "May 18, 2026" "7.0" "BTRFS"
31 .SH NAME
32 btrfs-receive \- receive subvolumes from send stream
33 .SH SYNOPSIS
34 .sp
35 \fBbtrfs receive\fP [options] <path>
36 .sp
37 or
38 .sp
39 \fBbtrfs receive\fP \-\-dump [options]
40 .SH DESCRIPTION
41 .sp
42 Receive a stream of changes and replicate one or more subvolumes that were
43 previously generated by \fBbtrfs send\fP\&. The received subvolumes are stored to
44 \fIpath\fP, unless \fI\-\-dump\fP option is given.
45 .sp
46 If \fI\-\-dump\fP option is specified, \fBbtrfs receive\fP will only do the validation of
47 the stream, and print the stream metadata, one operation per line.
48 .sp
49 \fBbtrfs receive\fP will fail in the following cases:
50 .INDENT 0.0
51 .IP 1. 3
52 receiving subvolume already exists
53 .IP 2. 3
54 previously received subvolume has been changed after it was received
55 .IP 3. 3
56 default subvolume has changed or you didn\(aqt mount the filesystem at the toplevel subvolume
57 .UNINDENT
58 .sp
59 A subvolume is made read\-only after the receiving process finishes successfully (see BUGS below).
60 .sp
61 \fBOptions\fP
62 .INDENT 0.0
63 .TP
64 .BI \-f \ <FILE>
65 read the stream from \fIFILE\fP instead of stdin,
66 .UNINDENT
67 .INDENT 0.0
68 .TP
69 .B \-C|\-\-chroot
70 confine the process to \fIpath\fP using \X'tty: link https://man7.org/linux/man-pages/man1/chroot.1.html'\fI\%chroot(1)\fP\X'tty: link'
71 .UNINDENT
72 .INDENT 0.0
73 .TP
74 .B \-e
75 terminate after receiving an \fIend cmd\fP marker in the stream.
76 .sp
77 Without this option the receiver side terminates only in case
78 of an error on end of file.
79 .UNINDENT
80 .INDENT 0.0
81 .TP
82 .B \-E|\-\-max\-errors <NERR>
83 terminate as soon as NERR errors occur while stream processing commands from
84 the stream
85 .sp
86 Default value is 1. A value of 0 means no limit.
87 .UNINDENT
88 .INDENT 0.0
89 .TP
90 .BI \-m \ <ROOTMOUNT>
91 the root mount point of the destination filesystem
92 .sp
93 By default the mount point is searched in :\fI\%file:/proc/self\fP/mounts\(ga.
94 If \fB/proc\fP is not accessible, e.g. in a chroot environment, use this option to
95 tell us where this filesystem is mounted.
96 .TP
97 .B \-\-force\-decompress
98 if the stream contains compressed data (see \fI\-\-compressed\-data\fP in
99 \fI\%btrfs\-send(8)\fP), always decompress it instead of writing it with
100 encoded I/O
101 .TP
102 .B \-\-dump
103 dump the stream metadata, one line per operation
104 .sp
105 Does not require the \fIpath\fP parameter. The filesystem remains unchanged.
106 Each stream command is on one line in the form of \fIkey=value\fP and separated
107 by one or more spaces. Values that contain special characters (like
108 paths or extended attributes) are encoded in C\-like way, e.g. \fI\(aq\en\(aq\fP or
109 octal escape sequence like \fI\(aq\eNNN\(aq\fP where N is the char value. Same encoding
110 as is used in \fI/proc\fP files.
111 .UNINDENT
112 .INDENT 0.0
113 .TP
114 .B \-q|\-\-quiet
115 (deprecated) alias for global \fI\-q\fP option
116 .UNINDENT
117 .INDENT 0.0
118 .TP
119 .B \-v
120 (deprecated) alias for global \fI\-v\fP option
121 .UNINDENT
122 .sp
123 \fBGlobal options\fP
124 .INDENT 0.0
125 .TP
126 .B \-v|\-\-verbose
127 increase verbosity about performed actions, print details about each operation
128 .TP
129 .B \-q|\-\-quiet
130 suppress all messages except errors
131 .UNINDENT
132 .SH BUGS
133 .sp
134 \fBbtrfs receive\fP sets the subvolume read\-only after it completes
135 successfully. However, while the receive is in progress, users who have
136 write access to files or directories in the receiving \fIpath\fP can add,
137 remove, or modify files, in which case the resulting read\-only subvolume
138 will not be an exact copy of the sent subvolume.
139 .sp
140 If the intention is to create an exact copy, the receiving \fIpath\fP
141 should be protected from access by users until the receive operation
142 has completed and the subvolume is set to read\-only.
143 .sp
144 Additionally, receive does not currently do a very good job of validating
145 that an incremental send stream actually makes sense, and it is thus
146 possible for a specially crafted send stream to create a subvolume with
147 reflinks to arbitrary files in the same filesystem. Because of this,
148 users are advised to not use \fIbtrfs receive\fP on send streams from
149 untrusted sources, and to protect trusted streams when sending them
150 across untrusted networks.
151 .SH EXIT STATUS
152 .sp
153 \fBbtrfs receive\fP returns a zero exit status if it succeeds. Non zero is
154 returned in case of failure.
155 .SH AVAILABILITY
156 .sp
157 \fBbtrfs\fP is part of btrfs\-progs. Please refer to the documentation at
158 \X'tty: link https://btrfs.readthedocs.io'\fI\%https://btrfs.readthedocs.io\fP\X'tty: link'\&.
159 .SH SEE ALSO
160 .sp
161 \fI\%btrfs\-send(8)\fP,
162 \fI\%mkfs.btrfs(8)\fP
163 .\" Generated by docutils manpage writer.
164 .