Get more diskspace

The default settings for a ext{2,3} file system is to reserve 5% of the file system so that only root can access it.

This was great back in the day when user accounts filled a drive to the max and everything was on one partition - not so when we're lean and mean and want some extra space.

To change your reserved block count to something a little more nice simply do this.

#tune2fs -m 1 /dev/udba 

Where /dev/udba is the partition you want to change. On a 1gig partition, you're looking at about 60Meg free increase. Of course it's expotential to larger drives, so a 80 gig partition might regain 5gig of space.

To check out what your file system is doing, simply use tune2fs again.

#tune2fs -l /dev/udba 

9 Replies

That is such an obvious command to run on all the template filesystems …. Thanks :)

-Chris

The platform manager now sets "tune2fs -m 1" when you create a new ext2/ext3 image, when you deploy, and when you resize (up or down).

-Chris

Glad to be of help!

Yes it is quite obvious, and it seems not too many people do it.

just changed the reserved size on my home machine and just got 2 gig extra space, thanks ;)

Indeed nice … the little pleasures of life :)

> The platform manager now sets "tune2fs -m 1" when you create a new ext2/ext3 image, when you deploy, and when you resize (up or down).

My little 3 gig Linode 64 reserved 0% on all partitions, so you'd be increasing the blocks reserved by 1%, right?… Maybe this is a good thing?

Hal Williams

@hwilliams:

My little 3 gig Linode 64 reserved 0% on all partitions, so you'd be increasing the blocks reserved by 1%, right?… Maybe this is a good thing?
That doesn't sound right. You always want some disk space dedicated to the root user to prevent any kind of disk-space eating attack. (Log flooding comes to mind.)

There is much reasoning behind this, the first is that the root still has space to get the job done. Secondly because most important daemons are run as the root user, and therefore they too have access to this reserved space. (However syslog somewhat defeats this being that its run by the root user)

Bill Clinton

You don't need to have space reserved on every partition, though. For those of you out there who actually do have several partitions of different sizes at different mount points, reserving space on all of them isn't necessary. Some reserved space on / and probably /var (and wherever /root is, if it's not on /) are important. But, if I have a mount point for, say, squid, or freecache, then there's no need to reserve space for root there.

And, since I use LVM, I have pretty tightly-defined partitions for many of my defined applications. But I also use reiser, which I don't think does reservation quite the same (or at all?)

@bpendleton:

You don't need to have space reserved on every partition, though.
Indeed. On my network at home I have a server which acts as a file/print server to the rest of my machines, and also acts as a backup storage device (each machine does a "dump" to this by NFS). For offsite storage I have removable disks which I rsync the dump areas to. These removable disks have been tuned to zero reserved space

% dumpe2fs -h /dev/hdg1 | grep -i reserved
dumpe2fs 1.34 (25-Jul-2003)
Reserved block count:     0
Reserved blocks uid:      0 (user root)
Reserved blocks gid:      0 (group root)

Now if only I could get IDE detach/reattach working properly without needing a reboot!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct