1BTRFS-RECEIVE(8)                     BTRFS                    BTRFS-RECEIVE(8)
2
3
4

NAME

6       btrfs-receive - receive subvolumes from send stream
7

SYNOPSIS

9       btrfs receive [options] <path>
10
11       or
12
13       btrfs receive --dump [options]
14

DESCRIPTION

16       Receive  a  stream of changes and replicate one or more subvolumes that
17       were previously generated by btrfs send. The  received  subvolumes  are
18       stored to path, unless --dump option is given.
19
20       If  --dump  option is specified, btrfs receive will only do the valida‐
21       tion of the stream, and print the stream metadata,  one  operation  per
22       line.
23
24       btrfs receive will fail in the following cases:
25
26       1. receiving subvolume already exists
27
28       2. previously received subvolume has been changed after it was received
29
30       3. default  subvolume has changed or you didn't mount the filesystem at
31          the toplevel subvolume
32
33       A subvolume is made read-only after the receiving process finishes suc‐
34       cessfully (see BUGS below).
35
36       Options
37
38       -f <FILE>
39              read the stream from FILE instead of stdin,
40
41       -C|--chroot
42              confine the process to path using chroot(1)
43
44       -e     terminate after receiving an end cmd marker in the stream.
45
46              Without this option the receiver side terminates only in case of
47              an error on end of file.
48
49       -E|--max-errors <NERR>
50              terminate as soon as NERR errors occur while  stream  processing
51              commands from the stream
52
53              Default value is 1. A value of 0 means no limit.
54
55       -m <ROOTMOUNT>
56              the root mount point of the destination filesystem
57
58              By default the mount point is searched in /proc/self/mounts.  If
59              /proc is not accessible, e.g. in a chroot environment, use  this
60              option to tell us where this filesystem is mounted.
61
62       --force-decompress
63              if the stream contains compressed data (see --compressed-data in
64              btrfs-send(8)), always decompress it instead of writing it  with
65              encoded I/O
66
67       --dump dump the stream metadata, one line per operation
68
69              Does  not require the path parameter. The filesystem remains un‐
70              changed.
71
72       -q|--quiet
73              (deprecated) alias for global -q option
74
75       -v     (deprecated) alias for global -v option
76
77       Global options
78
79       -v|--verbose
80              increase verbosity about performed actions, print details  about
81              each operation
82
83       -q|--quiet
84              suppress all messages except errors
85

BUGS

87       btrfs  receive sets the subvolume read-only after it completes success‐
88       fully.  However, while the receive is in progress, users who have write
89       access  to  files or directories in the receiving path can add, remove,
90       or modify files, in which case the resulting read-only  subvolume  will
91       not be an exact copy of the sent subvolume.
92
93       If  the intention is to create an exact copy, the receiving path should
94       be protected from access by users until the receive operation has  com‐
95       pleted and the subvolume is set to read-only.
96
97       Additionally, receive does not currently do a very good job of validat‐
98       ing that an incremental send stream actually makes  sense,  and  it  is
99       thus possible for a specially crafted send stream to create a subvolume
100       with reflinks to arbitrary files in the same  filesystem.   Because  of
101       this,  users  are advised to not use btrfs receive on send streams from
102       untrusted sources, and to protect trusted  streams  when  sending  them
103       across untrusted networks.
104

EXIT STATUS

106       btrfs  receive  returns  a zero exit status if it succeeds. Non zero is
107       returned in case of failure.
108

AVAILABILITY

110       btrfs is part of btrfs-progs.  Please refer  to  the  documentation  at
111       https://btrfs.readthedocs.io  or  wiki http://btrfs.wiki.kernel.org for
112       further information.
113

SEE ALSO

115       btrfs-send(8), mkfs.btrfs(8)
116
117
118
119
1206.1.3                            Jan 25, 2023                 BTRFS-RECEIVE(8)
Impressum