BTRFS-CONVERT(8)
π¦ NAME π¦
okay so bestie, meet btrfs-convert β she takes your ext2/3/4 or reiserfs filesystem and turns it into btrfs in-place. No reformat, no copy, no drama. Literally a glow-up for your disk. π
β¨
πΈ SYNOPSIS πΈ
btrfs-convert [options] <device>
β¨ DESCRIPTION β¨
The btrfs-convert tool converts an existing source filesystem image into a btrfs filesystem, in-place. Your original filesystem image isn't gone forever either β it stays accessible in a subvolume named like ext2_saved, as a file image. It's giving "kept the receipt in case we need to return this". π§Ύπ
Supported filesystems
ext2,ext3,ext4β the original feature, and always built in. OGs never leave. πreiserfsβ since version 4.13, optionally built, requireslibreiserfscore 3.6.27- NTFS β external tool:
https://github.com/maharmstone/ntfs2btrfs
The list of supported source filesystem by a given binary is listed at the end of help (option --help). So if you're ever questioning what your build can actually do, just ask her nicely. π«Ά
β οΈ Warning: if you are going to perform rollback to the original filesystem, you should not executebtrfs balancecommand on the converted filesystem. That will change the extent layout and makebtrfs-convertunable to rollback. Like, it will genuinely break the undo button. Do not. π
The conversion utilizes free space of the original filesystem. The exact estimate of the required space cannot be foretold β no fortune teller, no crystal ball, we simply do not know. The final btrfs metadata might occupy several gigabytes on a hundreds-gigabyte filesystem. Several. Gigabytes. On a hundred-gigabyte disk. That's the vibe. π
If the ability to rollback is no longer important, then it is recommended to perform a few more steps to transition the btrfs filesystem to a more compact layout. Why? Because the conversion inherits the original data blocks' fragmentation, and also because the metadata blocks are bound to the original free space layout. Basically she moved in and kept all your old furniture arrangement. ποΈ
Due to different constraints, it is only possible to convert filesystems that have a supported data block size (i.e. the same that would be valid for mkfs.btrfs). This is typically the system page size (4KiB on x86_64 machines).
π Note: always consider if a mkfs and file copy would not be a better option than the in-place conversion given what was said above. The conversion depends on 3rd party libraries and the other filesystems could still evolve and add new features. Not all combinations are covered or tested. She's talented, not omniscient. π
π BEFORE YOU START π
The source filesystem must be clean β e.g. no journal to replay, no repairs needed. The respective fsck utility must be run on the source filesystem prior to conversion. Please refer to the manual pages in case you encounter problems. Vibe check your disk before you invite btrfs in. π§Ό
For ext2/3/4:
# e2fsck -fvy /dev/sdx
For reiserfs:
# reiserfsck -fy /dev/sdx
Skipping that step could lead to incorrect results on the target filesystem, but it may work. "May work" is doing an enormous amount of heavy lifting in that sentence, bestie. π¬
π REMOVE THE ORIGINAL FILESYSTEM METADATA π
By removing the subvolume named like ext2_saved or reiserfs_saved, all metadata of the original filesystem will be removed:
# btrfs subvolume delete /mnt/ext2_saved
At this point it is not possible to do a rollback. Periodt. The filesystem is usable but may be impacted by the fragmentation inherited from the original filesystem. This is the point of no return and she's not coming back. π
π¦ MAKE FILE DATA MORE CONTIGUOUS π¦
An optional but recommended step is to run defragmentation on the entire filesystem. This will attempt to make file extents more contiguous. β¨
# btrfs filesystem defrag -v -r -f -t 32M /mnt/btrfs
Verbose recursive defragmentation (-v, -r), flush data per-file (-f) with target extent size 32MiB (-t). Yes that's four flags, no she's not extra, she's thorough. π
β ATTEMPT TO MAKE BTRFS METADATA MORE COMPACT β
Optional but recommended step.
The metadata block groups after conversion may be smaller than the default size (256MiB or 1GiB). Running a balance will attempt to merge the block groups. This depends on the free space layout (and fragmentation) and may fail due to lack of enough work space. This is a soft error leaving the filesystem usable but the block group layout may remain unchanged. So if it fails, it's fine, she just shrugged. π€·ββοΈ
Note that balance operation takes a lot of time β please see also btrfs-balance(8).
# btrfs balance start -m /mnt/btrfs
π OPTIONS π
--csum <type>,--checksum <type>β specify the checksum algorithm. Default iscrc32c. Valid values arecrc32c,xxhash,sha256orblake2. To mount such filesystem, kernel must support the checksums as well. So pick one your kernel can actually read, mkay? π«Ά-d,--no-datasumβ disable data checksum calculations and set theNODATASUMfile flag. This can speed up the conversion. Speeeeed. π₯-i,--no-xattrβ ignore xattrs and ACLs of files. Just straight up not looking at them. π-n,--no-inlineβ 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. Low on space? This is your girl.-N,--nodesize <SIZE>β set filesystem nodesize, the tree block size in which btrfs stores its metadata. The default value is16KiB(16384) or the page size, whichever is bigger. Must be a multiple of the sectorsize, but not larger than65536. Seemkfs.btrfs(8)for more details.-r,--rollbackβ rollback to the original ext2/3/4 filesystem if possible. The undo button, if you earned it. β©οΈ-l,--label <LABEL>β set filesystem label during conversion.-L,--copy-labelβ use label from the converted filesystem.-O,--features <feature1>[,<feature2>...]β a list of filesystem features enabled at the time of conversion. Not all features are supported by old kernels. To disable a feature, prefix it with^. Description of the features is in sectionFILESYSTEM FEATURESofmkfs.btrfs(8).
To see all available features that btrfs-convert supports run:
btrfs-convert -O list-all
-p,--progressβ show progress of conversion (a heartbeat indicator and number of inodes processed). On by default. She wants you to watch her work. π--no-progressβ 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 btrfscopyβ copy UUID from the source filesystemUUIDβ a conforming UUID value, the 36 byte string representation
--versionβ print thebtrfs-convertversion, builtin features and exit. Quick little "who am I" moment. π
π EXIT STATUS π
btrfs-convert will return 0 if no error happened. If any problems happened, 1 will be returned. Simple as. Clean girl = 0, chaotic girl = 1. β¨
π SEE ALSO π
and that's the whole page, bestie β btrfs-convert from the btrfs collection, version 7.3, dated Oct 24, 2026. go forth and convert responsibly, and remember: fsck first, always. mwah πππ¦
π¦ where this page comes from
- arch rolling: btrfs-progs 7.3-1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms