<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Reserved Space on Wimpy's World</title><link>https://blog.wimpys.world/tags/reserved-space/</link><description>Recent content in Reserved Space on Wimpy's World</description><generator>Hugo -- gohugo.io</generator><language>en-gb</language><managingEditor>martin@wimpress.com (Martin Wimpress)</managingEditor><webMaster>martin@wimpress.com (Martin Wimpress)</webMaster><lastBuildDate>Thu, 07 Jan 2010 20:42:04 +0000</lastBuildDate><atom:link href="https://blog.wimpys.world/tags/reserved-space/rss.xml" rel="self" type="application/rss+xml"/><item><title>Recovering reserved space from ext4</title><link>https://blog.wimpys.world/posts/recovering-reserved-space-from-ext4/</link><pubDate>Thu, 07 Jan 2010 20:42:04 +0000</pubDate><author>martin@wimpress.com (Martin Wimpress)</author><guid>https://wimpysworld.com/posts/recovering-reserved-space-from-ext4/</guid><description>&lt;p&gt;The Ext4 file system, like Ext3, reserves 5% of the blocks on the file system
for the root user. The reserved blocks are there for root&amp;rsquo;s use as a safe
guard if the filesystem gets full, it provides some wiggle room to enable the
really important programs to still function. But in some cases there&amp;rsquo;s not
much point in having space reserved for root. I&amp;rsquo;ve recently upgrade my
workstation with a 6TB internal RAID 0 array for data storage (music, videos,
photos, etc) and an external 6TB RAID 0 array as a backup. My OS boot from a
1TB drive. For my 6TB arrays I want the maximum available storage and was
interested to see what effect removing the reserved space would have. So, this
is what I did. First I made the Ext4 file system, mounted it and queried how
much space was available.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkfs.ext4 /dev/sdh1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mount /dev/sdh1 /mnt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;df -h
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Looks like I have 5.1TB of available space.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/dev/sdh1             5.4T  186M  5.1T   1% /mnt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then I unmounted the file system, removed the reserved blocks, checked the
consistency of the file system, mounted it and queried how much space was
available.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo umount /mnt
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo tune2fs -m &lt;span class="m"&gt;0&lt;/span&gt; /dev/sdh1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo e2fsck /dev/sdh1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;df -h
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Looks like I have 5.4TB available now, a saving of 300GB.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/dev/sdh1             5.4T  186M  5.4T   1% /mnt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, I could have simply created the files system without the reserved blocks
in the first place, but I was interested to see the comparison.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo mkfs.ext4 -m &lt;span class="m"&gt;0&lt;/span&gt; /dev/sdh1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Before you start removing the reserved blocks from your ext3/ext4 file systems
do a bit a research first.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://ubuntuforums.org/showthread.php?t=215177"&gt;Disk capacity, free space, and Ext3 reserved blocks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://wiki.archlinux.org/index.php/Ext3_Filesystem_Tips"&gt;Ext3 Filesystem Tips&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;</description><summary>Reclaim the 5% of disk space Ext4 reserves by default</summary></item></channel></rss>