{
    "content": [
        {
            "type": "text",
            "text": "# btrfs-receive (man)\n\n## NAME\n\nbtrfs-receive - receive subvolumes from send stream\n\n## SYNOPSIS\n\nbtrfs receive [options] <path>\nor\nbtrfs receive --dump [options]\n\n## DESCRIPTION\n\nReceive a stream of changes and replicate one or more subvolumes that were previously\ngenerated by btrfs send. The received subvolumes are stored to path, unless --dump option is\ngiven.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (5 subsections)\n- **BUGS**\n- **EXIT STATUS**\n- **AVAILABILITY**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "btrfs-receive",
        "section": "",
        "mode": "man",
        "summary": "btrfs-receive - receive subvolumes from send stream",
        "synopsis": "btrfs receive [options] <path>\nor\nbtrfs receive --dump [options]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "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. -m <ROOTMOUNT> 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"
            }
        ],
        "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"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 19,
                "subsections": [
                    {
                        "name": "Options",
                        "lines": 6
                    },
                    {
                        "name": "-e",
                        "lines": 15,
                        "flag": "-e"
                    },
                    {
                        "name": "--dump",
                        "lines": 7,
                        "long": "--dump"
                    },
                    {
                        "name": "-v",
                        "lines": 2,
                        "flag": "-v"
                    },
                    {
                        "name": "Global options",
                        "lines": 6
                    }
                ]
            },
            {
                "name": "BUGS",
                "lines": 15,
                "subsections": []
            },
            {
                "name": "EXIT STATUS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AVAILABILITY",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 5,
                "subsections": []
            }
        ],
        "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 were previously\ngenerated by btrfs send. The received subvolumes are stored to path, unless --dump option is\ngiven.\n\nIf --dump option is specified, btrfs receive will only do the validation of the stream, and\nprint the stream metadata, one operation per 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 received\n\n3. default subvolume has changed or you didn’t mount the filesystem at the toplevel\nsubvolume\n\nA subvolume is made read-only after the receiving process finishes successfully (see BUGS\nbelow).\n",
                "subsections": [
                    {
                        "name": "Options",
                        "content": "-f <FILE>\nread the stream from <FILE> instead of stdin,\n\n-C|--chroot\nconfine the process to path using chroot(1)\n"
                    },
                    {
                        "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 error on end of file.\n\n-E|--max-errors <NERR>\nterminate as soon as NERR errors occur while stream processing commands from the stream\n\nDefault value is 1. A value of 0 means no limit.\n\n-m <ROOTMOUNT>\nthe root mount point of the destination filesystem\n\nBy default the mountpoint is searched in /proc/self/mounts. If /proc is not accessible,\neg. in a chroot environment, use this option to tell us where this filesystem is mounted.\n",
                        "flag": "-e"
                    },
                    {
                        "name": "--dump",
                        "content": "dump the stream metadata, one line per operation\n\nDoes not require the path parameter. The filesystem remains unchanged.\n\n-q|--quiet\n(deprecated) alias for global -q option\n",
                        "long": "--dump"
                    },
                    {
                        "name": "-v",
                        "content": "(deprecated) alias for global -v option\n",
                        "flag": "-v"
                    },
                    {
                        "name": "Global options",
                        "content": "-v|--verbose\nincrease verbosity about performed actions, print details about each operation\n\n-q|--quiet\nsuppress all messages except errors\n"
                    }
                ]
            },
            "BUGS": {
                "content": "btrfs receive sets the subvolume read-only after it completes successfully. However, while\nthe receive is in progress, users who have write access to files or directories in the\nreceiving path can add, remove, 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 be protected from\naccess by users until the receive operation has completed and the subvolume is set to\nread-only.\n\nAdditionally, receive does not currently do a very good job of validating that an incremental\nsend stream actually makes sense, and it is thus possible for a specially crafted send stream\nto create a subvolume with reflinks to arbitrary files in the same filesystem. Because of\nthis, users are advised to not use btrfs receive on send streams from untrusted sources, and\nto protect trusted streams when sending them across untrusted networks.\n",
                "subsections": []
            },
            "EXIT STATUS": {
                "content": "btrfs receive returns a zero exit status if it succeeds. Non zero is returned in case of\nfailure.\n",
                "subsections": []
            },
            "AVAILABILITY": {
                "content": "btrfs is part of btrfs-progs. Please refer to the btrfs wiki http://btrfs.wiki.kernel.org for\nfurther details.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "mkfs.btrfs(8), btrfs-send(8)\n\n\n\nBtrfs v5.16.2                                02/16/2022                             BTRFS-RECEIVE(8)",
                "subsections": []
            }
        }
    }
}