1 |
On Wed, 29 Feb 2012 00:25:00 +0100 |
2 |
Alex Schuster <wonko@×××××××××.org> wrote: |
3 |
|
4 |
> Neil Bothwick writes: |
5 |
> |
6 |
> > On Tue, 28 Feb 2012 14:01:50 +0100, Alex Schuster wrote: |
7 |
> > |
8 |
> > > If you instantly need more space, reduce the amount of reserved |
9 |
> > > space for the superuser, which is 5% as default: |
10 |
> > > tune2fs -m 2 /dev/your/partition |
11 |
> > > Don't reduce it to 0, the lower this value is, the more |
12 |
> > > fragmentation you will get. |
13 |
> > |
14 |
> > Why is that? I would have expected more usable space to reduce the |
15 |
> > need for fragmentation. I routinely use 0 on non-system filesystems. |
16 |
> |
17 |
> I read this often, and to me it seems to make sense. When a file |
18 |
> system is nearly full, writing a last big file will make the file |
19 |
> being cluttered along all those tiny places where some free space is |
20 |
> still left. And this probably already happens to some extent before |
21 |
> the filesystem is completely full. |
22 |
> |
23 |
> Now, which values for reserved percentage are good, I don't know. |
24 |
|
25 |
The 5% figure is completely arbitrary and dates back many years. There |
26 |
was no good reason then for it to be exactly 5%, it just happened to |
27 |
mostly work fine. Remember that was a time when 250M was a BIG drive. 5% |
28 |
is 2.5K and that is about the size of the largest single file people |
29 |
realistically were using. |
30 |
|
31 |
So 5% wiggle room for root lets you manipulate the last single file |
32 |
you were using when the drive filled up, and hence save the day. These |
33 |
days 2TB file systems are common and 5% means 20G. |
34 |
|
35 |
How many 20G files do you routinely have on a single file system? Media |
36 |
drives aside, a few meg is still about the broad average file size. It |
37 |
is just not realistic to reserve emergency wiggle room for root that |
38 |
amounts to 20,000 average files. |
39 |
|
40 |
It means there's no single sane default anymore. On my servers I set |
41 |
reserved space to 100M or so as that's what I need. I reckon the |
42 |
average person should keep it to somewhat larger than the biggest |
43 |
single file you expect to store on that file system. |
44 |
|
45 |
|
46 |
|
47 |
> This probably depends much on the typical size of files on that |
48 |
> partition, and usage patterns. For large movies on your data |
49 |
> partition, it probably does not matter, but for my system partitions |
50 |
> (/root, /usr, /var, /tmp, portage stuff) I just keep it at 5%. |
51 |
> |
52 |
> With the benefit that I can instantly free some space in /var when |
53 |
> it's just become full, without needing to decide what to delete. |
54 |
> Okay, in practice this does not matter much because resizing the LVM |
55 |
> and resizing the FS is also a matter of seconds only. |
56 |
> |
57 |
> Wonko |
58 |
> |
59 |
|
60 |
|
61 |
|
62 |
-- |
63 |
Alan McKinnnon |
64 |
alan.mckinnon@×××××.com |