Posted by: Odzangba | February 20, 2010

How To Free Reserved Space On EXT4 Partitions

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.😀


Responses

  1. fantastic !

    thank u man

  2. Nice..
    Thanks!

  3. OH YEAH, u just gave me back 370Gb of my 8Tb RAID. Thank You!!!

    • Got an extra 200GB back on my home partition!

  4. 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!

    • 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.

  5. 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?

  6. freed 65Gb of lost space, thanx🙂

  7. […] 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 […]

  8. 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!

  9. 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.

  10. Awesome. Get rid of those shitty blocks, nibbling away our precious free disk space.

  11. Thanks man.

    Claimed back lots of space on my second hdd🙂

  12. 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.

  13. […] ссылки: https://odzangba.wordpress.com/2010/02/20/how-to-free-reserved-space-on-ext4-partitions/ […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: