You are not logged in.

#1 2009-11-17 03:43:01

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Tune2fs reserve space?? Anyone done this?

I came across this nice article from TuxRadar: Command Line Tricks for Smart Geeks
http://www.tuxradar.com/content/command-li...cks-smart-geeks
I read this and was wondering if anyone had any experience with this:

Reclaim disk space


Filling a partition to 100% can have an unpleasant effect on your system. When services and other programs cannot write to their log files, or cannot save data in /var, you could be in trouble. These programs won't be able to save their data, and typically quit out (or, in some extreme cases, crash dramatically!). To avoid this, the ext2 and ext3 filesystems reserve 5% of their capacity for only root processes to use. This is a good idea, but 5% is a lot on large drives - for instance, it's 25GB on a 500GB drive. Also, there is no need to reserve any space on a filesystem not used for root files, such as /home.

The good news is that not only is this 5% not hardcoded into the filesystem, it can be changed on the fl y without disturbing the your data and files. Tune2fs is used to tune various parameters of an ext2 (or ext3) filesystem. It can be used to change the volume label or the number of mounts between forced execution of fsck and a host of other, more esoteric settings, but the options we are interested in here are -m and -r. The former changes the percentage of filesystem blocks reserved for the root user, while the latter uses an absolute number of blocks. So:

tune2fs -m 2 /dev/sda1

reduces the reserved area to 2% of the filesystem, which may be more appropriate for if you have a large / or /var filesystem. If you're using a drive of 500GB or larger, this is the best option.

This line of code:

tune2fs -r 0 /dev/sda1

sets the filesystem to have no reserved blocks, a good setting for /home that doesn't need a reserved area for the superuser.

My root partition is only 20gb but my home partition is 718gb, I thought doing this would be a good ideal since going by the article I probably have like 40gb of reserve on my /home partition. The problem is I have all my data on this partition and do not want to risk loosing anything even though I have most of it backed up. So I was wondering has anyone done this before?

Thanks

Last edited by securitybreach (2009-11-17 03:44:27)


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

#2 2009-11-17 03:51:11

dmz
Member
From: Sweden
Registered: 2008-08-27
Posts: 881
Website

Re: Tune2fs reserve space?? Anyone done this?

Yep. I did it on all of my external drives, but I came to experience some weird behaviour ( can not recall exactly what is was now) when I changed from 5% to 0%.
Try 1% - works nice for me.

Offline

#3 2009-11-17 03:57:50

securitybreach
Member
From: In front of my computers
Registered: 2007-11-18
Posts: 416
Website

Re: Tune2fs reserve space?? Anyone done this?

cool thanks alot.


Thanks


"Every normal man must be tempted at times to spit upon his hands, hoist the black flag, and begin slitting throats." -- H.L. Mencken
Website      Configs
Forum Admin: Bruno's All Things Linux   
securitybreach<a>archlinux.us

Offline

Board footer

Powered by FluxBB