btrfs-receive(8)

SYNOPSIS 概要 

btrfs receive [options] <path>
btrfs 接收 [选项] <路径>

or

btrfs receive --dump [options]
btrfs 接收 --转储 [选项]

DESCRIPTION 描述 

Receive a stream of changes and replicate one or more subvolumes that were previously generated by btrfs send. The received subvolumes are stored to path, unless --dump option is given.
接收一系列更改流并复制一个或多个之前由 btrfs send 生成的子卷。接收到的子卷将存储到路径,除非给出--dump 选项。

If --dump option is specified, btrfs receive will only do the validation of the stream, and print the stream metadata, one operation per line.
如果指定了--dump 选项,btrfs receive 将仅对流进行验证,并打印流元数据,每行一个操作。

btrfs receive will fail in the following cases:
在以下情况下,btrfs receive 将失败:

  1. receiving subvolume already exists
    接收的子卷已经存在

  2. previously received subvolume has been changed after it was received
    先前接收的子卷在接收后已更改

  3. default subvolume has changed or you didn’t mount the filesystem at the toplevel subvolume
    默认子卷已更改或您未将文件系统挂载在顶级子卷处

A subvolume is made read-only after the receiving process finishes successfully (see BUGS below).
接收过程成功完成后,子卷变为只读(请参阅下面的错误)。

Options

-f <FILE>

read the stream from FILE instead of stdin,
从文件而不是标准输入读取流,

-C|--chroot

confine the process to path using chroot(1)
使用 chroot(1) 将进程限制在路径中

-e

terminate after receiving an end cmd marker in the stream.
在流中接收到结束命令标记后终止

Without this option the receiver side terminates only in case of an error on end of file.
如果没有此选项,接收方仅在文件末尾出现错误时终止

-E|--max-errors <NERR> -E|--最大错误数 <NERR>

terminate as soon as NERR errors occur while stream processing commands from the stream
当从流中处理命令时发生 NERR 个错误时立即终止

Default value is 1. A value of 0 means no limit.
默认值为 1。值为 0 表示没有限制。

-m <ROOTMOUNT>

the root mount point of the destination filesystem
目标文件系统的根挂载点

By default the mount point is searched in :file:/proc/self/mounts`. If /proc is not accessible, e.g. in a chroot environment, use this option to tell us where this filesystem is mounted.
默认情况下,挂载点在:file:/proc/self/mounts`中搜索。如果 /proc 不可访问,例如在 chroot 环境中,请使用此选项告诉我们此文件系统的挂载位置。

--force-decompress

if the stream contains compressed data (see --compressed-data in btrfs-send(8)), always decompress it instead of writing it with encoded I/O
如果流包含压缩数据(参见 btrfs-send(8)中的--compressed-data),始终解压缩它,而不是使用编码的 I/O 写入。

--dump

dump the stream metadata, one line per operation
转储流元数据,每个操作一行

Does not require the path parameter. The filesystem remains unchanged.
不需要路径参数。文件系统保持不变。

-q|--quiet -q|--安静

(deprecated) alias for global -q option
(已弃用) 全局 -q 选项的别名

-v

(deprecated) alias for global -v option
(已弃用)全局 -v 选项的别名

Global options

-v|--verbose -v|--详细

increase verbosity about performed actions, print details about each operation
增加有关执行操作的详细信息,打印每个操作的详细信息

-q|--quiet -q|--安静

suppress all messages except errors
抑制除错误之外的所有消息

BUGS

btrfs receive 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 path can add, remove, or modify files, in which case the resulting read-only subvolume will not be an exact copy of the sent subvolume.
btrfs 接收在成功完成后将子卷设为只读。然而,在接收过程中,对接收路径中的文件或目录具有写访问权限的用户可以添加、删除或修改文件,这种情况下,生成的只读子卷将不是发送的子卷的精确副本。

If the intention is to create an exact copy, the receiving path should be protected from access by users until the receive operation has completed and the subvolume is set to read-only.
如果意图是创建精确副本,则应保护接收路径,使用户无法访问,直到接收操作完成并子卷设为只读。

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 btrfs receive on send streams from untrusted sources, and to protect trusted streams when sending them across untrusted networks.
另外,接收目前并不很好地验证增量发送流是否合理,因此,可能会通过特制的发送流在同一文件系统中创建具有重定向到任意文件的子卷。因此,建议用户不要在来自不受信任来源的发送流上使用 btrfs 接收,并在通过不受信任网络发送受信任的流时加以保护。

EXIT STATUS 退出状态 

btrfs receive returns a zero exit status if it succeeds. Non zero is returned in case of failure.
如果成功,btrfs receive 返回零退出状态。如果失败,则返回非零值。

AVAILABILITY 可用性 

btrfs is part of btrfs-progs. Please refer to the documentation at https://btrfs.readthedocs.io.
btrfs 是 btrfs-progs 的一部分。请参考 https://btrfs.readthedocs.io 上的文档。

SEE ALSO 参见 

btrfs-send(8), mkfs.btrfs(8)
btrfs-send(8),mkfs.btrfs(8)