1BTRFS-RECEIVE(8) BTRFS BTRFS-RECEIVE(8)
2
3
4
6 btrfs-receive - receive subvolumes from send stream
7
9 btrfs receive [options] <path>
10
11 or
12
13 btrfs receive --dump [options]
14
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 :‐
59 file:/proc/self/mounts`. If /proc is not accessible, e.g. in a
60 chroot environment, use this option to tell us where this
61 filesystem is mounted.
62
63 --force-decompress
64 if the stream contains compressed data (see --compressed-data in
65 btrfs-send(8)), always decompress it instead of writing it with
66 encoded I/O
67
68 --dump dump the stream metadata, one line per operation
69
70 Does not require the path parameter. The filesystem remains un‐
71 changed.
72
73 -q|--quiet
74 (deprecated) alias for global -q option
75
76 -v (deprecated) alias for global -v option
77
78 Global options
79
80 -v|--verbose
81 increase verbosity about performed actions, print details about
82 each operation
83
84 -q|--quiet
85 suppress all messages except errors
86
88 btrfs receive sets the subvolume read-only after it completes success‐
89 fully. However, while the receive is in progress, users who have write
90 access to files or directories in the receiving path can add, remove,
91 or modify files, in which case the resulting read-only subvolume will
92 not be an exact copy of the sent subvolume.
93
94 If the intention is to create an exact copy, the receiving path should
95 be protected from access by users until the receive operation has com‐
96 pleted and the subvolume is set to read-only.
97
98 Additionally, receive does not currently do a very good job of validat‐
99 ing that an incremental send stream actually makes sense, and it is
100 thus possible for a specially crafted send stream to create a subvolume
101 with reflinks to arbitrary files in the same filesystem. Because of
102 this, users are advised to not use btrfs receive on send streams from
103 untrusted sources, and to protect trusted streams when sending them
104 across untrusted networks.
105
107 btrfs receive returns a zero exit status if it succeeds. Non zero is
108 returned in case of failure.
109
111 btrfs is part of btrfs-progs. Please refer to the documentation at
112 https://btrfs.readthedocs.io.
113
115 btrfs-send(8), mkfs.btrfs(8)
116
117
118
119
1206.6.2 Nov 24, 2023 BTRFS-RECEIVE(8)