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. :D

About these ads

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?


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 )

Connecting to %s

Categories

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: