{
    "mode": "info",
    "parameter": "btrfs-receive",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/btrfs-receive/json",
    "generated": "2026-07-05T11:50:04Z",
    "synopsis": "btrfs receive [options] <path>\nor\nbtrfs receive --dump [options]",
    "sections": {
        "NAME": {
            "content": "btrfs-receive - receive subvolumes from send stream\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "btrfs receive [options] <path>\n\nor\n\nbtrfs receive --dump [options]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Receive a stream of changes and replicate one or more subvolumes that\nwere previously generated by btrfs send. The received subvolumes are\nstored to path, unless --dump option is given.\n\nIf --dump option is specified, btrfs receive will only do the\nvalidation of the stream, and print the stream metadata, one operation\nper line.\n\nbtrfs receive will fail in the following cases:\n\n1. receiving subvolume already exists\n\n2. previously received subvolume has been changed after it was\nreceived\n\n3. default subvolume has changed or you didn't mount the filesystem at\nthe toplevel subvolume\n\nA subvolume is made read-only after the receiving process finishes\nsuccessfully (see BUGS below).\n\nOptions\n",
            "subsections": [
                {
                    "name": "-f <FILE>",
                    "content": "read the stream from <FILE> instead of stdin,\n\n-C|--chroot\nconfine the process to path using chroot(1)\n",
                    "flag": "-f",
                    "arg": "<FILE>"
                },
                {
                    "name": "-e",
                    "content": "terminate after receiving an end cmd marker in the stream.\n\nWithout this option the receiver side terminates only in case of an\nerror on end of file.\n\n-E|--max-errors <NERR>\nterminate as soon as NERR errors occur while stream processing\ncommands from the stream\n\nDefault value is 1. A value of 0 means no limit.\n",
                    "flag": "-e"
                },
                {
                    "name": "-m <ROOTMOUNT>",
                    "content": "the root mount point of the destination filesystem\n\nBy default the mountpoint is searched in /proc/self/mounts. If\n/proc is not accessible, eg. in a chroot environment, use this\noption to tell us where this filesystem is mounted.\n",
                    "flag": "-m",
                    "arg": "<ROOTMOUNT>"
                },
                {
                    "name": "--dump",
                    "content": "dump the stream metadata, one line per operation\n\nDoes not require the path parameter. The filesystem remains\nunchanged.\n\n-q|--quiet\n(deprecated) alias for global -q option\n",
                    "long": "--dump"
                },
                {
                    "name": "-v",
                    "content": "(deprecated) alias for global -v option\n\nGlobal options\n\n-v|--verbose\nincrease verbosity about performed actions, print details about\neach operation\n\n-q|--quiet\nsuppress all messages except errors\n",
                    "flag": "-v"
                }
            ]
        },
        "BUGS": {
            "content": "btrfs receive sets the subvolume read-only after it completes\nsuccessfully. However, while the receive is in progress, users who have\nwrite access to files or directories in the receiving path can add,\nremove, or modify files, in which case the resulting read-only\nsubvolume will not be an exact copy of the sent subvolume.\n\nIf the intention is to create an exact copy, the receiving path should\nbe protected from access by users until the receive operation has\ncompleted and the subvolume is set to read-only.\n\nAdditionally, receive does not currently do a very good job of\nvalidating that an incremental send stream actually makes sense, and it\nis thus possible for a specially crafted send stream to create a\nsubvolume with reflinks to arbitrary files in the same filesystem.\nBecause of this, users are advised to not use btrfs receive on send\nstreams from untrusted sources, and to protect trusted streams when\nsending them across untrusted networks.\n",
            "subsections": []
        },
        "EXIT STATUS": {
            "content": "btrfs receive returns a zero exit status if it succeeds. Non zero is\nreturned in case of failure.\n",
            "subsections": []
        },
        "AVAILABILITY": {
            "content": "btrfs is part of btrfs-progs. Please refer to the btrfs wiki\nhttp://btrfs.wiki.kernel.org for further details.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mkfs.btrfs(8), btrfs-send(8)\n\nBtrfs v5.16.2                     02/16/2022                  BTRFS-RECEIVE(8)",
            "subsections": []
        }
    },
    "summary": "btrfs-receive - receive subvolumes from send stream",
    "flags": [
        {
            "flag": "-f",
            "long": null,
            "arg": "<FILE>",
            "description": "read the stream from <FILE> instead of stdin, -C|--chroot confine the process to path using chroot(1)"
        },
        {
            "flag": "-e",
            "long": null,
            "arg": null,
            "description": "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> 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."
        },
        {
            "flag": "-m",
            "long": null,
            "arg": "<ROOTMOUNT>",
            "description": "the root mount point of the destination filesystem By default the mountpoint is searched in /proc/self/mounts. If /proc is not accessible, eg. in a chroot environment, use this option to tell us where this filesystem is mounted."
        },
        {
            "flag": "",
            "long": "--dump",
            "arg": null,
            "description": "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"
        },
        {
            "flag": "-v",
            "long": null,
            "arg": null,
            "description": "(deprecated) alias for global -v option Global options -v|--verbose increase verbosity about performed actions, print details about each operation -q|--quiet suppress all messages except errors"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "mkfs.btrfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
        },
        {
            "name": "btrfs-send",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/btrfs-send/8/json"
        },
        {
            "name": "BTRFS-RECEIVE",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/BTRFS-RECEIVE/8/json"
        }
    ]
}