This one came in handy when I bought a 1TB hard drive last week. Most linux distributions reserve 5% of new partitions for the root user and system services. The idea here is even when you run out of disk space, the root user should still be able to log in and system services should still run… this won’t happen if there is no space on the root partition. This policy may have been appropriate in the 90s when hard disk capacities were relatively low but this is 2010 and one can get a 1TB hard drive for a couple of hundred Ghana Cedis. 5% of that is about 51GB and those system services need only a couple of hundred megabytes.
So I decided to reclaim all that disk real estate with this command:
sudo tune2fs -m 0 /dev/sdb1
This sets the reserved blocks to 0%. This is an additional storage drive, I have no need to reserve disk space for system services. You can verify that this actually worked with:
sudo tune2fs -l /dev/sdb1 | grep ‘Reserved block count’
As usual, modify /dev/sdb1 to suit your partition setup. Have fun. 😀
fantastic !
thank u man
By: Abdulrhman on February 21, 2010
at 10:46 am
Nice..
Thanks!
By: Greatest on June 3, 2010
at 3:33 am
OH YEAH, u just gave me back 370Gb of my 8Tb RAID. Thank You!!!
By: Faxedhead on July 26, 2010
at 9:13 am
Got an extra 200GB back on my home partition!
By: Cr0t on April 17, 2011
at 4:28 pm
Hi – would it be any different for trying to reclaim the 5% of a drive that is NOT where the OS sits? I installed a 1TB drive and only 870GB are free to use. I did ‘sudo tune2fs -m 0 /media/media-1’ (media-1 being the name of the drive) and I got back ‘tune2fs: is a directory while trying to open /media/media-1 Couldn’t find valid filesystem superblock’
Thanks for any help!
By: Brian McCabe on May 15, 2011
at 2:32 pm
Brian, you need to give tune2fs the block device behind your filesystem, not the mount point.
run #mount without any arguments to find out which block device you must use.
By: brain on June 4, 2011
at 4:10 pm
Thank you! It helped me with my new hard driver 🙂
Why isn’t this reserve space is not different by default?
e.g. If the HD is bigger than 100 GB, then reserve 500 MB, or only 1%, or something like this?
By: sibannac on July 28, 2011
at 10:20 pm
freed 65Gb of lost space, thanx 🙂
By: Hutabfraumuetze on September 13, 2013
at 8:31 am
[…] T 的空间 50 G的空间都白白浪费了,太可惜了) 参考 https://odzangba.wordpress.com/2010/02/20/how-to-free-reserved-space-on-ext4-partitions/ tune2fs -m 0 /dev/sdb1(将保留空间设置为 0% ) sudo tune2fs -l /dev/sdb1 | grep […]
By: 在 Debian 系统安装 3T 硬盘逐步教程 | 培培的小站 on December 4, 2013
at 4:05 am
Sorry, but this is so hilarious. Just built a 9TB NAS and found out that even up to date distros still reserve those 5% regardless of the block device size! This is about 450GB of space plainly wasted for exactly what?
I did not expect sub-1% values to work but amazingly they did, so i chose .002%, which is more like it in my book 🙂
Many thanks and thumbs up for posting this!
By: Jonny on August 4, 2014
at 6:56 am
I thought this was used for ext’s proactive defragmentation. I set mine lower than stock but I don’t set mine to 0. I read an article suggesting that in ext4 it is less necessary than in ext3.
By: homeawesomation on October 22, 2014
at 1:41 am
Awesome. Get rid of those shitty blocks, nibbling away our precious free disk space.
By: Bernhard on March 3, 2015
at 11:56 pm
Thanks man.
Claimed back lots of space on my second hdd 🙂
By: Jeff on October 15, 2015
at 7:37 pm
What about the performance if disk goes above 95%, the algorithm for reserving 5% is to avoid filesystem fragmentation when you get above 95% full & that becomes mess. Though , its good with ext4 FS where it provides multi block allocation standard.
By: Karn on January 14, 2016
at 7:20 pm
[…] ссылки: https://odzangba.wordpress.com/2010/02/20/how-to-free-reserved-space-on-ext4-partitions/ […]
By: Свободное место и ext4 | ExtraLAN.ru on May 10, 2016
at 8:45 am
Thank you. I finally found the reason my filesystem was 100% full 🙂
By: michael on August 17, 2018
at 10:20 am
[…] Also, in Debian (and other Linux distros) there is 5% of space on every drive reserved for root. Turn that off on your ZoneMinder drive and tadah, you have 300 GB extra space (on 6 TB drive). Basically run sudo tune2fs -m 0 /dev/sdX, where /dev/sdX is of course your ZoneMinder drive. More info here. […]
By: Tips to make ZoneMinder run better - jpavlik.cz on November 15, 2018
at 1:45 pm
This info really help why disk space has been reserved for every File system.
Nice one!! 🙂
By: Amar on January 18, 2019
at 4:59 am
Thank you! Great tip 🙂
By: uselinuxnotwindows on February 4, 2019
at 8:24 pm
Thank you. I wish i knew it earlier. More than 30gb of 1TB filesystem were wasted and that`s by default. Nobody asked me do i wish to reserve something when i formatted my torrents drive back in 2012.
By: Oleg on April 2, 2019
at 3:07 pm
Thanks for sharing!!! I got back 400GB of a 8 TB samba disk. Thank you.
By: nuyusite on November 2, 2019
at 6:21 pm
When doing this, bear in mind, it can cause ext4 to fragmantate on the disk.
By: kolega007 on December 11, 2019
at 10:46 am
thank you saved me little over 700gigs
By: Rolder on October 8, 2020
at 1:25 am
Thanks man! Greetings from Poland!
By: Tooom on March 12, 2022
at 1:36 am