Wednesday, May 12, 2010

Making use of all the space on a hard drive

If you have a big data drive, there's a good chance that Linux is reserving 5% of it's available space for "emergencies".

This is necessary for your root filesystem as if the disk fills up there may be no way for root to log in and clean things up without this buffer of space for log files etc. to be written into.

However, I have a couple of large drives that store only data and 5% is 100GB I'd rather be able to use.

Fortunately, it's easy to reclaim the space, the following will remove all "reserved blocks":

sudo tune2fs -m 0 /dev/sdXX

This can be reset back to the default 5% (or any percentage) if you need to:

sudo tune2fs -m 5 /dev/sdXX