{"id":1018,"date":"2011-06-01T01:13:06","date_gmt":"2011-05-31T23:13:06","guid":{"rendered":"http:\/\/raftaman.net\/?p=1018"},"modified":"2021-05-15T11:46:39","modified_gmt":"2021-05-15T09:46:39","slug":"free-reserved-space-on-ext4-partitions-or-change-reserved-block-percentage","status":"publish","type":"post","link":"https:\/\/possiblelossofprecision.net\/?p=1018","title":{"rendered":"Free reserved space on ext4 partitions (or change reserved block percentage)"},"content":{"rendered":"<p>By default, 5% of a new ext2\/3\/4 partition will be reserved for important root processes and for fs performance reasons. However, there may be sound reasons to lower that percentage or even disable it completely (non-root partition, data-only storage, huge files, ext4 etc.). <\/p>\n<p>Let me quote Linux filesystem guru <a href=\"http:\/\/en.wikipedia.org\/wiki\/Theodore_Ts%27o\">Ted Ts&#8217;o<\/a> on <a href=\"https:\/\/www.redhat.com\/archives\/ext3-users\/2009-January\/msg00026.html\">this<\/a>:<\/p>\n<blockquote><p>\n    If you set the reserved block count to zero, it won&#8217;t affect performance much except if you run for long periods of time (with lots of file creates and deletes) while the filesystem is almost full (i.e., say above 95%), at which point you&#8217;ll be subject to fragmentation problems. Ext4&#8217;s multi-block allocator is much more fragmentation resistant, because it tries much harder to find contiguous blocks, so even if you don&#8217;t enable the other ext4 features, you&#8217;ll see better results simply mounting an ext3 filesystem using ext4 before the filesystem gets completely full.<\/p>\n<p>    If you are just using the filesystem for long-term archive, where files aren&#8217;t changing very often (i.e., a huge mp3 or video store), it obviously won&#8217;t matter.\n<\/p><\/blockquote>\n<p>You can <strong>change<\/strong> the reserved block percentage by invoking<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntune2fs -m 1 \/dev\/sdb1\r\n<\/pre>\n<p>or <strong>disable<\/strong> it completely:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntune2fs -m 0 \/dev\/sdb1\r\n<\/pre>\n<p>To <strong>check<\/strong>, how many block are reserved on a given filesystem, run<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntune2fs -l \/dev\/sdb1 | grep &quot;Reserved block count&quot;\r\n<\/pre>\n<p>Of course, you have to adjust <code>\/dev\/sdb1<\/code> to your needs.<\/p>\n<p>Resources:<br \/>\n<a href=\"http:\/\/unix.stackexchange.com\/questions\/7950\/reserved-space-for-root-on-a-filesystem-why\">http:\/\/unix.stackexchange.com\/questions\/7950\/reserved-space-for-root-on-a-filesystem-why<\/a><br \/>\nSee also <a href=\"http:\/\/linux.die.net\/man\/8\/tune2fs\">tune2fs manpage<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, 5% of a new ext2\/3\/4 partition will be reserved for important root processes and for fs performance reasons. However, there may be sound reasons to lower that percentage or even disable it completely (non-root partition, data-only storage, huge files, ext4 etc.). Let me quote Linux filesystem guru Ted Ts&#8217;o on this: If you set the reserved block count&#8230; <a href=\"https:\/\/possiblelossofprecision.net\/?p=1018\">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-1018","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\/1018","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=1018"}],"version-history":[{"count":9,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1018\/revisions"}],"predecessor-version":[{"id":2675,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=\/wp\/v2\/posts\/1018\/revisions\/2675"}],"wp:attachment":[{"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1018"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1018"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/possiblelossofprecision.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1018"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}