Bug 661179

Summary: Set reserved block count on / to sane default
Product: [openSUSE] openSUSE 11.4 Reporter: Sascha Peilicke <speilicke>
Component: YaST2Assignee: Thomas Fehr <fehr>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Enhancement    
Priority: P4 - Low CC: aschnell, coolo, jack
Version: Milestone 5 of 6   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Sascha Peilicke 2010-12-23 08:51:05 UTC
Currently, new (ext*) filesystems have of 5% of their available blocks reserved for root. However, for modern (speak big) discs, this results in several gigabytes wasted.

Therefore I suggest setting a fixed amount of blocks reserved for root. If the disc runs full, you only want to login and remove files, which means you need enough space to allow ssh + shell spawning. I'd say some 4 megabytes should suffice for that.

So, after mkfs, we should do a tune2fs -r 4096 (given a 4k block size).
Comment 1 Stephan Kulow 2011-01-12 11:33:25 UTC
http://www.linux-archive.org/ext3-users/233104-reserved-block-count-large-filesystem.html sounds like Ted agrees. So if Jan agrees too, I would go for it with ext4.
Comment 2 Jan Kara 2011-01-12 15:21:08 UTC
Yes, I agree as well. 5% tends to be too much these days. I remember we had some discussion about this with other ext? developers. There is some uncertainty how (bad) the allocator performs when the file system gets really full under various loads but it shouldn't be too bad.

I'd be maybe a bit conservative and choose the amount of reserved space as min(1GB, 5%) so that the expression works for big and small file systems and we leave enough space for syslogs etc... (16 MB seems too tight to me).
Comment 3 Arvin Schnell 2011-01-12 16:37:05 UTC
We already have the "Percentage of blocks reserved for root" option in the
format options dialog. Just give us a formula to calculate the percentage
from the volume size (so far this detail seem controversial).
Comment 4 Jan Kara 2011-01-12 16:54:54 UTC
OK, so I suggest:
double pc = min(((double)(1 << 30))/size, 0.05);

Coolo?
Comment 5 Jan Kara 2011-01-12 16:56:43 UTC
Oh, multiply the result by 100 if it should be really percentage (which is what mke2fs takes).
Comment 6 Sascha Peilicke 2011-01-13 08:01:51 UTC
@Jan: Do we really need 1G?

@Arvin: So the formula will be used the default value and the option then allows to override it?
Comment 7 Arvin Schnell 2011-01-13 09:15:50 UTC
Yes, the formula will be used as default but the user can edit the value
(as the user can already now).
Comment 8 Stephan Kulow 2011-01-13 09:57:14 UTC
@Sascha: you don't have fun if you fill a TB up to the last GB anyway. The file system will frag like hell. 

The only addition I have is rounding the value a bit, so it doesn't look too made up - having a default value proposed of 0.0017271 looks strange, so I would go for a minimum of 0.1 - this should drive the fragment search already pretty much insane for large file systems.
Comment 9 Stephan Kulow 2011-01-13 10:15:32 UTC
btw, e2fsprogs has 1.14.14 released ...
Comment 10 Thomas Fehr 2011-01-17 16:25:08 UTC
Ok, implemented as suggested.

Default now tries to reserve about 1Gig, but at most 5% and at least 0.1%.
Default has exactly one digit after decimal point. 
User may modify default to anything between 0 and 99.

Should this still go into 11.4 or SVN head?
Comment 11 Stephan Kulow 2011-01-17 16:31:47 UTC
there should still be enough time for 11.4
Comment 12 Thomas Fehr 2011-01-18 11:13:05 UTC
fix is in 11.4 branch and in svn head