# BTRFS-RECEIVE - receive subvolumes from send stream - man - [phpMan]

> **TLDR:** The examples for this command have been moved together with `btrfs send`.
>
- View documentation for `btrfs receive`:
  `tldr btrfs send`

*Source: tldr-pages*

---

[_BTRFS-RECEIVE_(8)](https://www.chedong.com/phpMan.php/man/BTRFS-RECEIVE/8/markdown)                                BTRFS                               [_BTRFS-RECEIVE_(8)](https://www.chedong.com/phpMan.php/man/BTRFS-RECEIVE/8/markdown)

## NAME
       btrfs-receive - receive subvolumes from send stream

## SYNOPSIS
       **btrfs receive **[options] <path>

       or

       **btrfs receive **--dump [options]

## DESCRIPTION
       Receive  a stream of changes and replicate one or more subvolumes that were previously gener‐
       ated by **btrfs send**. The received subvolumes are stored  to  _path_,  unless  _--dump_  option  is
       given.

       If  _--dump_  option is specified, **btrfs receive **will only do the validation of the stream, and
       print the stream metadata, one operation per line.

       **btrfs receive **will fail in the following cases:

       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 be‐
       low).

### Options

### -f _
              read the stream from _FILE_ instead of stdin,

### -C|--chroot
              confine the process to _path_ using [**chroot(1)](https://www.chedong.com/phpMan.php/man/chroot/1/markdown)**

### -e     

              Without this option the receiver side terminates only in case of an error  on  end  of
              file.

### -E|--max-errors <NERR>
              terminate  as  soon  as  NERR  errors  occur while stream processing commands from the
              stream

              Default value is 1. A value of 0 means no limit.

### -m _
              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.

### --force-decompress
              if the stream contains compressed data (see _--compressed-data_ in  [_btrfs-send(8)](https://www.chedong.com/phpMan.php/man/btrfs-send/8/markdown)_),  al‐
              ways decompress it instead of writing it with encoded I/O

       **--dump **dump the stream metadata, one line per operation

              Does not require the _path_ parameter. The filesystem remains unchanged.

### -q|--quiet
              (deprecated) alias for global _-q_ option

### -v     (deprecated)

### Global options

### -v|--verbose
              increase verbosity about performed actions, print details about each operation

### -q|--quiet
              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  re‐
       ceiving  _path_ can add, remove, or modify files, in which case the resulting read-only subvol‐
       ume will not be an exact copy of the sent subvolume.

       If the intention is to create an exact copy, the receiving _path_ should be protected from  ac‐
       cess  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.

## EXIT STATUS
       **btrfs receive **returns a zero exit status if it succeeds. Non zero  is  returned  in  case  of
       failure.

## AVAILABILITY
       **btrfs    **is    part    of    btrfs-progs.     Please    refer   to   the   documentation   at
       _<https://btrfs.readthedocs.io_>.

## SEE ALSO
       [_btrfs-send(8)](https://www.chedong.com/phpMan.php/man/btrfs-send/8/markdown)_, [_mkfs.btrfs(8)](https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/markdown)_


6.6.3                                       Mar 31, 2024                            [_BTRFS-RECEIVE_(8)](https://www.chedong.com/phpMan.php/man/BTRFS-RECEIVE/8/markdown)
