{"id":3195,"date":"2022-12-20T16:43:46","date_gmt":"2022-12-20T19:43:46","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/btrfsconvert-man8\/"},"modified":"2022-12-20T16:43:46","modified_gmt":"2022-12-20T19:43:46","slug":"btrfsconvert-man8","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/btrfsconvert-man8\/","title":{"rendered":"BTRFS&minus;CONVERT (man8)"},"content":{"rendered":"<h1 align=\"center\">BTRFS\u2212CONVERT<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#OPTIONS\">OPTIONS<\/a><br \/> <a href=\"#EXIT STATUS\">EXIT STATUS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">btrfs-convert \u2212 convert from ext2\/3\/4 or reiserfs filesystem to btrfs in\u2212place<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><b>btrfs\u2212convert<\/b> [options] <i><device><\/i><\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i><b>btrfs\u2212convert<\/b><\/i> is used to convert existing source filesystem image to a btrfs filesystem in\u2212place. The original filesystem image is accessible in subvolume named like <i>ext2_saved<\/i> as file <i>image<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Supported filesystems:<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 ext2, ext3, ext4 \u2014 original feature, always built in<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 reiserfs \u2014 since version 4.13, optionally built, requires libreiserfscore 3.6.27<\/p>\n<p style=\"margin-left:17%; margin-top: 1em\">\u2022 ntfs \u2014 external tool <b><font color=\"#0000FF\">https:\/\/github.com\/maharmstone\/ntfs2btrfs<\/font><\/b><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The list of supported source filesystem by a given binary is listed at the end of help (option <i>\u2212\u2212help<\/i>).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><b><big>Warning<\/big><\/b> <br \/> If you are going to perform rollback to the original filesystem, you should not execute <b>btrfs balance<\/b> command on the converted filesystem. This will change the extent layout and make <b>btrfs\u2212convert<\/b> unable to rollback.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The conversion utilizes free space of the original filesystem. The exact estimate of the required space cannot be foretold. The final btrfs metadata might occupy several gigabytes on a hundreds\u2212gigabyte filesystem.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">If the ability to rollback is no longer important, the it is recommended to perform a few more steps to transition the btrfs filesystem to a more compact layout. This is because the conversion inherits the original data blocks&#8217; fragmentation, and also because the metadata blocks are bound to the original free space layout.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Due to different constraints, it is only possible to convert filesystems that have a supported data block size (ie. the same that would be valid for <i>mkfs.btrfs<\/i>). This is typically the system page size (4KiB on x86_64 machines).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>BEFORE YOU START<\/b><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The source filesystem must be clean, eg. no journal to replay or no repairs needed. The respective <i>fsck<\/i> utility must be run on the source filesytem prior to conversion. Please refer to the manual pages in case you encounter problems.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">For ext2\/3\/4:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># e2fsck \u2212fvy \/dev\/sdx<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">For reiserfs:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># reiserfsck \u2212fy \/dev\/sdx<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Skipping that step could lead to incorrect results on the target filesystem, but it may work.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>REMOVE THE ORIGINAL FILESYSTEM METADATA<\/b><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">By removing the subvolume named like <i>ext2_saved<\/i> or <i>reiserfs_saved<\/i>, all metadata of the original filesystem will be removed:<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># btrfs subvolume delete \/mnt\/ext2_saved<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">At this point it is not possible to do a rollback. The filesystem is usable but may be impacted by the fragmentation inherited from the original filesystem.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>MAKE FILE DATA MORE CONTIGUOUS<\/b><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">An optional but recommended step is to run defragmentation on the entire filesystem. This will attempt to make file extents more contiguous.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># btrfs filesystem defrag \u2212v \u2212r \u2212f \u2212t 32M \/mnt\/btrfs<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Verbose recursive defragmentation (<i>\u2212v<\/i>, <i>\u2212r<\/i>), flush data per\u2212file (<i>\u2212f<\/i>) with target extent size 32MiB (<i>\u2212t<\/i>).<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>ATTEMPT TO MAKE BTRFS METADATA MORE COMPACT<\/b><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Optional but recommended step.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">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.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">Note that balance operation takes a lot of time, please see also <b>btrfs\u2212balance<\/b>(8).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"># btrfs balance start \u2212m \/mnt\/btrfs<\/font><\/p>\n<h2>OPTIONS <a name=\"OPTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212\u2212csum <i><type><\/i>, \u2212\u2212checksum <i><type><\/i><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Specify the checksum algorithm. Default is <i>crc32c<\/i>. Valid values are <i>crc32c<\/i>, <i>xxhash<\/i>, <i>sha256<\/i> or <i>blake2<\/i>. To mount such filesystem kernel must support the checksums as well.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212d|\u2212\u2212no\u2212datasum<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>disable data checksum calculations and set the NODATASUM file flag, this can speed up the conversion<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212i|\u2212\u2212no\u2212xattr<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>ignore xattrs and ACLs of files<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212n|\u2212\u2212no\u2212inline<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>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<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212N|\u2212\u2212nodesize <i><SIZE><\/i><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>set filesystem nodesize, the tree block size in which btrfs stores its metadata. The default value is 16KB (16384) or the page size, whichever is bigger. Must be a multiple of the sectorsize, but not larger than 65536. See <b>mkfs.btrfs<\/b>(8) for more details.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212r|\u2212\u2212rollback<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>rollback to the original ext2\/3\/4 filesystem if possible<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212l|\u2212\u2212label <i><LABEL><\/i><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>set filesystem label during conversion<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212L|\u2212\u2212copy\u2212label<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>use label from the converted filesystem<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212O|\u2212\u2212features <i><feature1><\/i>[,<i><feature2><\/i>&#8230;]<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>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 <i>^<\/i>. Description of the features is in section <i>FILESYSTEM FEATURES<\/i> of <b>mkfs.btrfs<\/b>(8).<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>To see all available features that btrfs\u2212convert supports run:<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big><b>btrfs\u2212convert \u2212O list\u2212all<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212p|\u2212\u2212progress<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>show progress of conversion (a heartbeat indicator and number of inodes processed), on by default<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212\u2212no\u2212progress<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>disable progress and show only the main phases of conversion<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\u2212\u2212uuid <i><SPEC><\/i><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>set the FSID of the new filesystem based on <i>SPEC<\/i>:<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 <i>new<\/i> \u2212 (default) generate UUID for the FSID of btrfs<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 <i>copy<\/i> \u2212 copy UUID from the source filesystem<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>\u2022 <i>UUID<\/i> \u2212 a conforming UUID value, the 36 byte string representation<\/big><\/font><\/p>\n<h2>EXIT STATUS <a name=\"EXIT STATUS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big><b>btrfs\u2212convert<\/b> will return 0 if no error happened. If any problems happened, 1 will be returned.<\/big><\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big><b>mkfs.btrfs<\/b>(8)<\/big><\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  btrfs-convert \u2212 convert from ext2\/3\/4 or reiserfs filesystem to btrfs in\u2212place <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[5,52,337,4],"class_list":["post-3195","post","type-post","status-publish","format-standard","hentry","category-8-administracion-del-sistema","tag-5","tag-administracion","tag-btrfs-convert","tag-man8"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3195","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=3195"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/3195\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=3195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=3195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=3195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}