{
    "content": [
        {
            "type": "text",
            "text": "# btrfstune (man)\n\n## NAME\n\nbtrfstune - tune various filesystem parameters\n\n## SYNOPSIS\n\nbtrfstune [options] <device> [<device>...]\n\n## DESCRIPTION\n\nbtrfstune  can be used to enable, disable, or set various filesystem parameters. The filesys‐\ntem must be unmounted.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS** (12 subsections)\n- **EXIT STATUS**\n- **COMPATIBILITY NOTE**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "btrfstune",
        "section": "",
        "mode": "man",
        "summary": "btrfstune - tune various filesystem parameters",
        "synopsis": "btrfstune [options] <device> [<device>...]",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [
            {
                "flag": "",
                "long": "--convert-to-block-group-tree",
                "arg": null,
                "description": "(since kernel 6.1) Convert portions of extent tree that tracks block groups to a separate block group tree. This greatly reduces mount time. Can be also enabled at mkfs time."
            },
            {
                "flag": "",
                "long": "--convert-from-block-group-tree",
                "arg": null,
                "description": "(since kernel 6.1) Convert block groups tracked in standalone block group tree back to extent tree and remove block-group-tree feature bit from the filesystem."
            },
            {
                "flag": "",
                "long": "--convert-to-free-space-tree",
                "arg": null,
                "description": "(since kernel 4.5) Convert to free-space-tree feature (v2 of space cache)."
            },
            {
                "flag": "-f",
                "long": null,
                "arg": null,
                "description": "you are aware of the dangers."
            },
            {
                "flag": "-m",
                "long": null,
                "arg": null,
                "description": "change fsid stored as metadatauuid to a randomly generated UUID, see also -U"
            },
            {
                "flag": "-M",
                "long": null,
                "arg": null,
                "description": "(since kernel: 5.0) change fsid stored as metadatauuid to a given UUID, see also -U The metadatauuid is stored only in the superblock and is a backward incompatible change. The fsid in metadata blocks remains unchanged and is not overwritten, thus the whole operation is significantly faster than -U. The new metadatauuid can be used for mount by UUID and is also used to identify de‐ vices of a multi-device filesystem."
            },
            {
                "flag": "-n",
                "long": null,
                "arg": null,
                "description": "Enable no-holes feature (more efficient representation of file holes), enabled by mkfs feature no-holes."
            },
            {
                "flag": "-r",
                "long": null,
                "arg": null,
                "description": "Enable extended inode refs (hardlink limit per file in a directory is 65536), enabled by mkfs feature extref."
            },
            {
                "flag": "-S",
                "long": null,
                "arg": null,
                "description": "Enable seeding on a given device. Value 1 will enable seeding, 0 will disable it. A seeding filesystem is forced to be mounted read-only. A new device can be added to the filesystem and will capture all writes keeping the seeding device intact. See also section SEEDING DEVICE in btrfs(5). WARNING: Clearing the seeding flag on a device may be dangerous. If a previously-seeding device is changed, all filesystems that used that device will become unmountable. Setting the seeding flag back will not fix that. A valid usecase is seeding device as a base image. Clear the seeding flag, update the filesystem and make it seeding again, provided that it's OK to throw away all filesystems built on top of the previous base."
            },
            {
                "flag": "-u",
                "long": null,
                "arg": null,
                "description": "case it was interrupted."
            },
            {
                "flag": "-U",
                "long": null,
                "arg": null,
                "description": "Change fsid to UUID in all metadata blocks. The UUID should be a 36 bytes string in printf(3) format %08x-%04x-%04x-%04x-%012x. If there is a previous unfinished fsid change, it will continue only if the UUID matches the unfinished one or if you use the option -u. All metadata blocks are rewritten, this may take some time, but the final filesystem compatibility is unaffected, unlike -M. WARNING: Cancelling or interrupting a UUID change operation will make the filesystem tem‐ porarily unmountable. To fix it, rerun btrfstune -u and let it complete."
            },
            {
                "flag": "-x",
                "long": null,
                "arg": null,
                "description": "Enable skinny metadata extent refs (more efficient representation of extents), enabled by mkfs feature skinny-metadata. All newly created extents will use the new representation. To completely switch the entire filesystem, run a full balance of the metadata. Please refer to btrfs-balance(8)."
            }
        ],
        "examples": [],
        "see_also": [
            {
                "name": "btrfs",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/btrfs/5/json"
            },
            {
                "name": "btrfs-balance",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/btrfs-balance/8/json"
            },
            {
                "name": "mkfs.btrfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "--convert-to-block-group-tree",
                        "lines": 5,
                        "long": "--convert-to-block-group-tree"
                    },
                    {
                        "name": "--convert-from-block-group-tree",
                        "lines": 5,
                        "long": "--convert-from-block-group-tree"
                    },
                    {
                        "name": "--convert-to-free-space-tree",
                        "lines": 4,
                        "long": "--convert-to-free-space-tree"
                    },
                    {
                        "name": "-f",
                        "lines": 2,
                        "flag": "-f"
                    },
                    {
                        "name": "-m",
                        "lines": 2,
                        "flag": "-m"
                    },
                    {
                        "name": "-M _",
                        "lines": 11,
                        "flag": "-M"
                    },
                    {
                        "name": "-n",
                        "lines": 3,
                        "flag": "-n"
                    },
                    {
                        "name": "-r",
                        "lines": 3,
                        "flag": "-r"
                    },
                    {
                        "name": "-S _",
                        "lines": 14,
                        "flag": "-S"
                    },
                    {
                        "name": "-u",
                        "lines": 2,
                        "flag": "-u"
                    },
                    {
                        "name": "-U _",
                        "lines": 13,
                        "flag": "-U"
                    },
                    {
                        "name": "-x",
                        "lines": 7,
                        "flag": "-x"
                    }
                ]
            },
            {
                "name": "EXIT STATUS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COMPATIBILITY NOTE",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "btrfstune - tune various filesystem parameters\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "btrfstune [options] <device> [<device>...]\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "btrfstune  can be used to enable, disable, or set various filesystem parameters. The filesys‐\ntem must be unmounted.\n\nThe common use case is to enable features that were not enabled at mkfs  time.   Please  make\nsure that you have kernel support for the features.  You can find a complete list of features\nand  kernel  version of their introduction at Feature by version page.  Also, the manual page\nmkfs.btrfs(8) contains more details about the features.\n\nSome of the features could be also enabled on a mounted filesystem by  other  means.   Please\nrefer to the FILESYSTEM FEATURES in btrfs(5).\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "",
                "subsections": [
                    {
                        "name": "--convert-to-block-group-tree",
                        "content": "(since kernel 6.1)\n\nConvert  portions  of  extent  tree that tracks block groups to a separate block group\ntree. This greatly reduces mount time. Can be also enabled at mkfs time.\n",
                        "long": "--convert-to-block-group-tree"
                    },
                    {
                        "name": "--convert-from-block-group-tree",
                        "content": "(since kernel 6.1)\n\nConvert block groups tracked in standalone block group tree back to  extent  tree  and\nremove block-group-tree feature bit from the filesystem.\n",
                        "long": "--convert-from-block-group-tree"
                    },
                    {
                        "name": "--convert-to-free-space-tree",
                        "content": "(since kernel 4.5)\n\nConvert to free-space-tree feature (v2 of space cache).\n",
                        "long": "--convert-to-free-space-tree"
                    },
                    {
                        "name": "-f",
                        "content": "you are aware of the dangers.\n",
                        "flag": "-f"
                    },
                    {
                        "name": "-m",
                        "content": "change fsid stored as metadatauuid to a randomly generated UUID, see also -U\n",
                        "flag": "-m"
                    },
                    {
                        "name": "-M _",
                        "content": "(since kernel: 5.0)\n\nchange fsid stored as metadatauuid to a given UUID, see also -U\n\nThe metadatauuid is stored only in the superblock  and  is  a  backward  incompatible\nchange. The fsid in metadata blocks remains unchanged and is not overwritten, thus the\nwhole operation is significantly faster than -U.\n\nThe  new  metadatauuid can be used for mount by UUID and is also used to identify de‐\nvices of a multi-device filesystem.\n",
                        "flag": "-M"
                    },
                    {
                        "name": "-n",
                        "content": "Enable no-holes feature (more efficient representation of file holes), enabled by mkfs\nfeature no-holes.\n",
                        "flag": "-n"
                    },
                    {
                        "name": "-r",
                        "content": "Enable extended inode refs (hardlink limit per file in a directory is 65536),  enabled\nby mkfs feature extref.\n",
                        "flag": "-r"
                    },
                    {
                        "name": "-S _",
                        "content": "Enable  seeding  on a given device. Value 1 will enable seeding, 0 will disable it.  A\nseeding filesystem is forced to be mounted read-only. A new device can be added to the\nfilesystem and will capture all writes keeping the seeding device  intact.   See  also\nsection SEEDING DEVICE in btrfs(5).\n\nWARNING:\nClearing  the  seeding  flag on a device may be dangerous.  If a previously-seeding\ndevice is changed, all filesystems that used that device will  become  unmountable.\nSetting the seeding flag back will not fix that.\n\nA  valid  usecase is seeding device as a base image. Clear the seeding flag, update\nthe filesystem and make it seeding again, provided that it's OK to throw  away  all\nfilesystems built on top of the previous base.\n",
                        "flag": "-S"
                    },
                    {
                        "name": "-u",
                        "content": "case it was interrupted.\n",
                        "flag": "-u"
                    },
                    {
                        "name": "-U _",
                        "content": "Change fsid to UUID in all metadata blocks.\n\nThe  UUID  should  be a 36 bytes string in printf(3) format %08x-%04x-%04x-%04x-%012x.\nIf there is a previous unfinished fsid change, it  will  continue  only  if  the  UUID\nmatches the unfinished one or if you use the option -u.\n\nAll  metadata  blocks are rewritten, this may take some time, but the final filesystem\ncompatibility is unaffected, unlike -M.\n\nWARNING:\nCancelling or interrupting a UUID change operation will make  the  filesystem  tem‐\nporarily unmountable.  To fix it, rerun btrfstune -u and let it complete.\n",
                        "flag": "-U"
                    },
                    {
                        "name": "-x",
                        "content": "Enable skinny metadata extent refs (more efficient representation of extents), enabled\nby mkfs feature skinny-metadata.\n\nAll  newly  created  extents will use the new representation. To completely switch the\nentire  filesystem,  run  a  full  balance  of   the   metadata.   Please   refer   to\nbtrfs-balance(8).\n",
                        "flag": "-x"
                    }
                ]
            },
            "EXIT STATUS": {
                "content": "btrfstune returns 0 if no error happened, 1 otherwise.\n",
                "subsections": []
            },
            "COMPATIBILITY NOTE": {
                "content": "This  deprecated tool exists for historical reasons but is still in use today.  Its function‐\nality will be merged to the main tool, at which time btrfstune will be declared obsolete  and\nscheduled for removal.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "btrfs(5), btrfs-balance(8), mkfs.btrfs(8)\n\n\n6.6.3                                       Mar 31, 2024                                BTRFSTUNE(8)",
                "subsections": []
            }
        }
    }
}