{
    "mode": "man",
    "parameter": "BTRFS-CONVERT",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/BTRFS-CONVERT/8/json",
    "generated": "2026-10-06T09:11:14Z",
    "synopsis": "btrfs-convert [options] <device>",
    "sections": {
        "NAME": {
            "content": "btrfs-convert - convert from ext2/3/4 or reiserfs filesystem to btrfs in-place\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "btrfs-convert [options] <device>\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The  btrfs-convert  tool  can  be used to convert existing source filesystem image to a btrfs\nfilesystem in-place.  The original filesystem image is accessible  in  subvolume  named  like\next2saved as file image.\n\nSupported filesystems:\n\n• ext2, ext3, ext4 -- original feature, always built in\n\n• reiserfs -- since version 4.13, optionally built, requires libreiserfscore 3.6.27\n\n• NTFS -- external tool https://github.com/maharmstone/ntfs2btrfs\n\nThe  list  of supported source filesystem by a given binary is listed at the end of help (op‐\ntion --help).\n",
            "subsections": [
                {
                    "name": "WARNING:",
                    "content": "If you are going to perform rollback to the original filesystem, you  should  not  execute\nbtrfs  balance command on the converted filesystem. This will change the extent layout and\nmake btrfs-convert unable to rollback.\n\nThe conversion utilizes free space of the original filesystem. The exact estimate of the  re‐\nquired space cannot be foretold. The final btrfs metadata might occupy several gigabytes on a\nhundreds-gigabyte filesystem.\n\nIf  the  ability  to  rollback is no longer important, the it is recommended to perform a few\nmore steps to transition the btrfs filesystem to a more compact layout. This is  because  the\nconversion  inherits  the  original data blocks' fragmentation, and also because the metadata\nblocks are bound to the original free space layout.\n\nDue to different constraints, it is only possible to convert filesystems  that  have  a  sup‐\nported  data block size (i.e. the same that would be valid for mkfs.btrfs). This is typically\nthe system page size (4KiB on x8664 machines).\n\nBEFORE YOU START\n\nThe source filesystem must be clean, e.g. no journal to replay or no repairs needed. The  re‐\nspective  fsck utility must be run on the source filesystem prior to conversion. Please refer\nto the manual pages in case you encounter problems.\n\nFor ext2/3/4:\n\n# e2fsck -fvy /dev/sdx\n\nFor reiserfs:\n\n# reiserfsck -fy /dev/sdx\n\nSkipping that step could lead to incorrect results on the target filesystem, but it may work.\n\nREMOVE THE ORIGINAL FILESYSTEM METADATA\n\nBy removing the subvolume named like ext2saved or reiserfssaved, all metadata of the origi‐\nnal filesystem will be removed:\n\n# btrfs subvolume delete /mnt/ext2saved\n\nAt this point it is not possible to do a rollback. The filesystem is usable but  may  be  im‐\npacted by the fragmentation inherited from the original filesystem.\n\nMAKE FILE DATA MORE CONTIGUOUS\n\nAn  optional  but  recommended  step is to run defragmentation on the entire filesystem. This\nwill attempt to make file extents more contiguous.\n\n# btrfs filesystem defrag -v -r -f -t 32M /mnt/btrfs\n\nVerbose recursive defragmentation (-v, -r), flush data per-file (-f) with target extent  size\n32MiB (-t).\n\nATTEMPT TO MAKE BTRFS METADATA MORE COMPACT\n\nOptional but recommended step.\n\nThe  metadata  block  groups after conversion may be smaller than the default size (256MiB or\n1GiB). Running a balance will attempt to merge the block groups.  This depends  on  the  free\nspace  layout  (and  fragmentation)  and may fail due to lack of enough work space. This is a\nsoft error leaving the filesystem usable but the block group layout may remain unchanged.\n\nNote that balance operation takes a lot of time, please see also btrfs-balance(8).\n\n# btrfs balance start -m /mnt/btrfs\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "--csum <type>, --checksum <type>\nSpecify the checksum algorithm. Default is crc32c. Valid values  are  crc32c,  xxhash,\nsha256 or blake2. To mount such filesystem kernel must support the checksums as well.\n",
            "subsections": [
                {
                    "name": "-d|--no-datasum",
                    "content": "disable  data checksum calculations and set the NODATASUM file flag, this can speed up\nthe conversion\n"
                },
                {
                    "name": "-i|--no-xattr",
                    "content": "ignore xattrs and ACLs of files\n"
                },
                {
                    "name": "-n|--no-inline",
                    "content": "disable inlining of small files to metadata blocks, this will  decrease  the  metadata\nconsumption and may help to convert a filesystem with low free space\n"
                },
                {
                    "name": "-N|--nodesize <SIZE>",
                    "content": "set  filesystem nodesize, the tree block size in which btrfs stores its metadata.  The\ndefault value is 16KiB (16384) or the page size, whichever is bigger.  Must be a  mul‐\ntiple  of  the  sectorsize,  but not larger than 65536. See mkfs.btrfs(8) for more de‐\ntails.\n"
                },
                {
                    "name": "-r|--rollback",
                    "content": "rollback to the original ext2/3/4 filesystem if possible\n"
                },
                {
                    "name": "-l|--label <LABEL>",
                    "content": "set filesystem label during conversion\n"
                },
                {
                    "name": "-L|--copy-label",
                    "content": "use label from the converted filesystem\n"
                },
                {
                    "name": "-O|--features <feature1>[,<feature2>...]",
                    "content": "A list of filesystem features enabled the at time of conversion. Not all features  are\nsupported  by old kernels. To disable a feature, prefix it with ^.  Description of the\nfeatures is in section FILESYSTEM FEATURES of mkfs.btrfs(8).\n\nTo see all available features that btrfs-convert supports run:\n\nbtrfs-convert -O list-all\n"
                },
                {
                    "name": "-p|--progress",
                    "content": "show progress of conversion (a heartbeat indicator and number of inodes processed), on\nby default\n"
                },
                {
                    "name": "--no-progress",
                    "content": "disable progress and show only the main phases of conversion\n\n--uuid <SPEC>\nset the FSID of the new filesystem based on 'SPEC':\n\n• new - (default) generate UUID for the FSID of btrfs\n\n• copy - copy UUID from the source filesystem\n\n• UUID - a conforming UUID value, the 36 byte string representation\n",
                    "long": "--no-progress"
                }
            ]
        },
        "EXIT STATUS": {
            "content": "btrfs-convert will return 0 if no error happened.  If any problems happened, 1  will  be  re‐\nturned.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "mkfs.btrfs(8)\n\n\n6.6.3                                       Mar 31, 2024                            BTRFS-CONVERT(8)",
            "subsections": []
        }
    },
    "summary": "btrfs-convert - convert from ext2/3/4 or reiserfs filesystem to btrfs in-place",
    "flags": [
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "disable data checksum calculations and set the NODATASUM file flag, this can speed up the conversion"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "ignore xattrs and ACLs of files"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "disable inlining of small files to metadata blocks, this will decrease the metadata consumption and may help to convert a filesystem with low free space"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "set filesystem nodesize, the tree block size in which btrfs stores its metadata. The default value is 16KiB (16384) or the page size, whichever is bigger. Must be a mul‐ tiple of the sectorsize, but not larger than 65536. See mkfs.btrfs(8) for more de‐ tails."
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "rollback to the original ext2/3/4 filesystem if possible"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "set filesystem label during conversion"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "use label from the converted filesystem"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "A list of filesystem features enabled the at time of conversion. Not all features are supported by old kernels. To disable a feature, prefix it with ^. Description of the features is in section FILESYSTEM FEATURES of mkfs.btrfs(8). To see all available features that btrfs-convert supports run: btrfs-convert -O list-all"
        },
        {
            "flag": "",
            "long": null,
            "arg": null,
            "description": "show progress of conversion (a heartbeat indicator and number of inodes processed), on by default"
        },
        {
            "flag": "",
            "long": "--no-progress",
            "arg": null,
            "description": "disable progress and show only the main phases of conversion --uuid <SPEC> set the FSID of the new filesystem based on 'SPEC': • new - (default) generate UUID for the FSID of btrfs • copy - copy UUID from the source filesystem • UUID - a conforming UUID value, the 36 byte string representation"
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "mkfs.btrfs",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/mkfs.btrfs/8/json"
        }
    ]
}