Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How can I control size of /run (tmpfs)?
Date: Sat, 26 May 2012 20:47:32
Message-Id: 4FC140AA.4050101@wonkology.org
In Reply to: Re: [gentoo-user] How can I control size of /run (tmpfs)? by Dale
1 Dale writes:
2
3 > Jarry wrote:
4 >> On 26-May-12 22:01, Dale wrote:
5 >>> Jarry wrote:
6 >>>>
7 >>>> after updating baselayout from 2.0.3 to 2.1-r1 /run is mounted
8 >>>> as tmpfs. But I can not find any mount-option for controlling
9 >>>> how much memory is (or could be) used for it.
10 >>>>
11 >>>> Filesystem 1K-blocks Used Available Use% Mounted on
12 >>>> tmpfs 8223848 224 8223624 1% /run
13 >>>>
14 >>>> I know it does not use 8GB right now, yet I'd like to reduce
15 >>>> it to some lower value, not half of my physical memory.
16 >>>> How can I do it? Can I simply add line in fstab like:
17 >>>>
18 >>>> none /run tmpfs size=128m 0 0 ???
19
20 Just try it :) I don't know if this would work, probably yes. But you
21 can change it later with mount -o remount,size=128m /run
22
23 >>> Holy smoke ! Mine is doing the same thing.
24 >>> tmpfs 7.9G 260K 7.9G 1% /run
25 >>>
26 >>> But I also have this:
27 >>> tmpfs 7.9G 0 7.9G 0% /var/tmp/portage
28
29 Now have a look at /dev/shm...
30
31 >>> So, between those two, I could run out of ram since I have 16Gbs.
32
33 But only if you copy stuff to /run yourself, otherwise this will never
34 happen.
35
36 >>> There is now TWO people that needs a answer to this question. Why does
37 >>> it need that much anyway? It looks to me like a few hundred Mbs, like
38 >>> Jarry posted, would be plenty. Jeepers creepers. lol
39
40 It doesn't need it, it's just the maximum sitze, which it will never reach.
41
42
43 >> I suppose default size for tmpfs is half of physical memory,
44 >> if it is not configured somewhere else.
45 >>
46 >> BTW, is there any way to turn this great feature off?
47 >> What is it good for? I do not see any advantage in having
48 >> /run on tmpfs...
49
50 In case of power failure or lockup, the contents are lost, and will not
51 cause confusion on the next reboot when /run is still populated by
52 stuff. Just an idea, I do not know if it would really matter.
53 But it does no harm, so why not juest keep it like it is.
54
55
56 > I had no idea it was doing this either until your post. I got the same
57 > questions as you do. Why is it there? Why so much is allocated to it?
58 > Where can we change the settings for this questionable "feature"?
59 >
60 > I'm hoping someone will come along and answer both our questions. I'm
61 > really hoping for a place we can change the settings. I don't mind it
62 > being there so much if it is useful. I would like to know its purpose
63 > tho.
64
65 I don't know the details, but I'd think it does not matter. There will
66 nothing be put into /run that uses a lot of memory, so it will never
67 actually use its default size of half of your RAM.
68
69 Wonko