6 Creating Backups and Using the Btrfs Send/Receive Feature

Note:

Working with the Btrfs send/receive feature requires that you boot the system by using UEK R8.

The send operation compares two subvolumes and writes a description of how to convert one subvolume, the parent subvolume, into the other subvolume, which is the sent subvolume. You would usually direct the output to a file for later use or pipe it to a receive operation for immediate use.

The simplest form of the send operation writes a complete description of a subvolume, for example:

sudo btrfs send [-v] [-f sent_file] ... subvol

You can specify many instances of the -v option to display increasing amounts of debugging output. The -f option is used to save the output to a file. Note that both of these options are implicit in the following usage examples.

The following form of the send operation writes a complete description of how to convert one subvolume to another subvolume:

sudo btrfs send -p parent_subvol sent_subvol

If a subvolume such as a snapshot of the parent volume, known as a clone source, will be available during the receive operation from which some data can be recovered, you can specify the clone source to reduce the size of the output file:

sudo btrfs send [-p parent_subvol] [-c clone_src] ... subvol

You can specify the -c option for each of the clone source that exist. If you don't specify the parent subvolume, btrfs chooses a suitable parent from the clone sources.

Use the receive operation to regenerate the sent subvolume at a specified path, for example:

sudo btrfs receive [-f sent_file] mountpoint