Btrfs Send and Receive Explained for Linux

The btrfs send and btrfs receive commands are native Linux utilities designed for efficient data replication, backups, and filesystem migration. They work by converting read-only Btrfs subvolume snapshots into a standardized data stream that can be transferred across storage devices, local paths, or networks, and then reconstructed byte-for-byte on a target Btrfs filesystem. This functionality provides a high-performance alternative to traditional file-copying utilities like rsync by operating at the filesystem block level rather than scanning individual files.

Core Purpose and Use Cases

The primary objective of the send and receive feature is to move data reliably while minimizing resource usage and execution time. Common use cases include:

How Btrfs Send and Receive Works

The mechanism functions as a pipeline consisting of two operations:

  1. btrfs send: Reads a read-only snapshot on the source filesystem, analyzes its underlying B-trees, and serializes the metadata and data blocks into a continuous binary stream.
  2. btrfs receive: Accepts that binary stream from standard input on the destination filesystem and recreates the identical read-only snapshot.

Because the output of btrfs send is written directly to standard output (stdout), it integrates seamlessly with standard Unix pipes and utilities. It can be redirected into a raw file, compressed using tools like zstd or gzip, or piped through secure network shells like ssh.

Incremental Backups

The most powerful capability of this feature is incremental data transfer. When utilizing the -p (parent) parameter, btrfs send calculates the exact differences (deltas) between an older snapshot and a newer one:

Key Advantages