btrfs-send(8)

SYNOPSIS 概要 

btrfs send [-ve] [-p <parent>] [-c <clone-src>] [-f <outfile>] <subvol> [<subvol>…]

DESCRIPTION 描述 

This command will generate a stream of instructions that describe changes between two subvolume snapshots. The stream can be consumed by the btrfs receive command to replicate the sent snapshot on a different filesystem. The command operates in two modes: full and incremental.
此命令将生成一系列指令流,描述两个子卷快照之间的更改。该流可以被 btrfs receive 命令消耗,以在不同的文件系统上复制发送的快照。该命令有两种模式:完整和增量。

All snapshots involved in one send command must be read-only, and this status cannot be changed as long as there’s a running send operation that uses the snapshot. Read-only mount of the subvolume is not sufficient, there’s no way to guarantee that there won’t be any other writable mount of the same subvolume that would potentially write while send would be running.
一个 send 命令涉及的所有快照必须是只读的,只要有一个正在运行的使用该快照的 send 操作,就不能更改此状态。子卷的只读挂载是不够的,无法保证不会有同一子卷的其他可写挂载,可能在 send 运行时写入。

In the full mode, the entire snapshot data and metadata will end up in the stream.
在完整模式下,整个快照数据和元数据将最终出现在流中。

In the incremental mode (options -p and -c), previously sent snapshots that are available on both the sending and receiving side can be used to reduce the amount of information that has to be sent to reconstruct the sent snapshot on a different filesystem.
在增量模式(选项 -p 和 -c)中,之前发送的快照在发送和接收端都可用,可以用来减少必须发送的信息量,以便在不同文件系统上重建发送的快照。

The -p <parent> option can be omitted when -c <clone-src> options are given, in which case btrfs send will determine a suitable parent from among the clone sources.
当给出 -c <clone-src> 选项时,可以省略 -p <parent> 选项,在这种情况下,btrfs send 将从克隆源中选择一个合适的父快照。

You must not specify clone sources unless you guarantee that these snapshots are exactly in the same state on both sides--both for the sender and the receiver. For implications of changed read-write status of a received snapshot please see section SUBVOLUME FLAGS in btrfs-subvolume(8).
除非您保证这些快照在发送方和接收方都处于完全相同的状态,否则不得指定克隆源。有关接收到的快照更改读写状态的影响,请参阅 btrfs-subvolume(8)中的子卷标志部分。

Options

-e

if sending multiple subvolumes at once, use the new format and omit the end cmd marker in the stream separating the subvolumes
如果一次发送多个子卷,请使用新格式,并在流中分隔子卷时省略结束命令标记。

-p <parent>

send an incremental stream from parent to subvol
从父卷发送增量流到子卷

-c <clone-src>

use this snapshot as a clone source for an incremental send (multiple allowed)
将此快照用作增量发送的克隆源(允许多个)

-f <outfile>

output is normally written to standard output so it can be, for example, piped to btrfs receive. Use this option to write it to a file instead.
输出通常写入标准输出,因此可以将其例如管道到 btrfs receive。使用此选项将其写入文件而不是。

--no-data

send in NO_FILE_DATA mode
以 NO_FILE_DATA 模式发送

The output stream does not contain any file data and thus cannot be used to transfer changes. This mode is faster and is useful to show the differences in metadata.
输出流不包含任何文件数据,因此无法用于传输更改。这种模式更快,对于显示元数据中的差异很有用。

--proto <N>

use send protocol version N
使用发送协议版本 N

The default is 1, which was the original protocol version. Version 2 encodes file data slightly more efficiently; it is also required for sending compressed data directly (see --compressed-data). Version 2 requires at least btrfs-progs 6.0 on both the sender and receiver and at least Linux 6.0 on the sender. Passing 0 means to use the highest version supported by the running kernel.
默认值为 1,这是原始协议版本。版本 2 对文件数据进行了稍微更有效的编码;它还需要直接发送压缩数据(请参阅 --compressed-data)。版本 2 在发送方和接收方上至少需要 btrfs-progs 6.0,发送方上至少需要 Linux 6.0。传递 0 表示使用运行内核支持的最高版本。

--compressed-data

send data that is compressed on the filesystem directly without decompressing it
直接在文件系统上发送已压缩的数据,而无需解压缩

If the receiver supports the BTRFS_IOC_ENCODED_WRITE ioctl (added in Linux 6.0), it can also write it directly without decompressing it. Otherwise, the receiver will fall back to decompressing it and writing it normally.
如果接收方支持 BTRFS_IOC_ENCODED_WRITE ioctl(在 Linux 6.0 中添加),它也可以直接写入而无需解压缩。否则,接收方将退回到解压缩并正常写入。

This requires protocol version 2 or higher. If --proto was not used, then --compressed-data implies --proto 2.
这需要协议版本 2 或更高版本。如果未使用 --proto,则 --compressed-data 暗示 --proto 2。

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

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

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

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

Global options

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

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

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

increase output verbosity, print generated commands in a readable form
增加输出详细信息,以可读形式打印生成的命令

EXIT STATUS 退出状态 

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

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-receive(8), btrfs-subvolume(8), mkfs.btrfs(8)