{"id":1024,"date":"2011-06-19T00:07:32","date_gmt":"2011-06-18T22:07:32","guid":{"rendered":"http:\/\/raftaman.net\/?p=1024"},"modified":"2021-05-15T11:46:39","modified_gmt":"2021-05-15T09:46:39","slug":"converting-an-ext3-partition-to-ext4","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1024","title":{"rendered":"Converting an ext3 partition to ext4"},"content":{"rendered":"<p>Mounting an ext3 partition using ext4 fs drivers will usually speed-up your filesystem without actually changing the on-disk structures. Therefore it&#8217;s possible to revert to the ext3 driver without any problem. This allows you to easily benefit from delayed allocation (delalloc) and multi-block allocation (mballoc).<\/p>\n<p>Further performance enhancements are possible if you do change the on-disk structure, e.g. by using extents. The downside is that you can&#8217;t mount the filesystem any longer with kernel lacking ext4 support and you can&#8217;t revert.<\/p>\n<p>To enable ext4 features on an existing ext3 filesystem, invoke:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntune2fs -O extents,uninit_bg,dir_index \/dev\/DEV \r\n<\/pre>\n<p>Unfotunately, features like flex_bg and >16TB fs support <strong>can only be enabled at format time<\/strong><a name=\"fn001t\" href=\"#fn001f\"><sup>1<\/sup><\/a>.<\/p>\n<p>Your filesystem is now indeed converted to ext4, however, only files that are written after conversion will benefit from ext4 extends. Existing files would have to be rewritten. <code>e4defrag<\/code> is being developed to take care of this but in now meant for production environments as of now.<\/p>\n<p>A workaround would be to use <code>chattr<\/code> to rewrite the files using extends. From the <a href=\"https:\/\/wiki.archlinux.org\/index.php\/Ext4\">archlinux wiki<\/a>:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nfind \/home -xdev -type f -print0 | xargs -0 chattr +e\r\nfind \/home -xdev -type d -print0 | xargs -0 chattr +e\r\n<\/pre>\n<p>It is being recommended though, &#8220;<em>to test this command on a small number of files first, and check if everything is going all right. It may also be useful to check the filesystem after conversion.<\/em>&#8220;<a name=\"fn002t\" href=\"#fn002f\"><sup>2<\/sup><\/a>. Please note their warnings about mercurial repositories and hardlinks in general, too.<\/p>\n<p><a name=\"fn001f\" href=\"#fn001t\">[1] <\/a><a href=\"https:\/\/wiki.archlinux.org\/index.php\/Ext4#Migrating_files_to_extents\">https:\/\/wiki.archlinux.org\/index.php\/Ext4#Migrating_files_to_extents<\/a><br \/>\n<a name=\"fn002f\" href=\"#fn002t\">[2] <\/a><a href=\"https:\/\/ext4.wiki.kernel.org\/index.php\/Ext4_Howto#Converting_an_ext3_filesystem_to_ext4\">https:\/\/ext4.wiki.kernel.org\/index.php\/Ext4_Howto#Converting_an_ext3_filesystem_to_ext4<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mounting an ext3 partition using ext4 fs drivers will usually speed-up your filesystem without actually changing the on-disk structures. Therefore it&#8217;s possible to revert to the ext3 driver without any problem. This allows you to easily benefit from delayed allocation (delalloc) and multi-block allocation (mballoc). Further performance enhancements are possible if you do change the on-disk structure, e.g. by using&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1024\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[39],"class_list":["post-1024","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ext4"],"_links":{"self":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1024"}],"version-history":[{"count":13,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1024\/revisions"}],"predecessor-version":[{"id":1049,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1024\/revisions\/1049"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}