Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How can I control size of /run (tmpfs)?
Date: Sun, 27 May 2012 12:43:03
Message-Id: 1338122462.12863.5.camel@moriah
In Reply to: Re: [gentoo-user] How can I control size of /run (tmpfs)? by Alan McKinnon
1 On Sun, 2012-05-27 at 09:59 +0200, Alan McKinnon wrote:
2 > On Sun, 27 May 2012 09:05:46 +0200
3 > Jarry <mr.jarry@×××××.com> wrote:
4 >
5 > > I have read through all replies, but I still did not find
6 > > answers to my original questions:
7 > >
8 > > Q1: Can I somehow reduce the size of /run? I know it is tmpfs
9 > > and I know this is upper limit normally never achieved, but
10 > > I want to reduce this upper limit. Is it possible, or is it
11 > > hard-coded to half of physical memory?
12 >
13 > I think this works IIRC:
14 >
15 > List it in /etc/fstab. Max size goes in the options field using the
16 > syntax described in man mount
17 >
18 >
19 > > Q2: Can I turn this "/run in tmpfs" feature off? I do not
20 > > see *any* advantage in vasting memory for /run (although
21 > > I agree there might be some point in moving "run" from
22 > > /var/run to /run). But I see one big problem:
23 >
24 >
25 > If if limit the tmpfs to say 100M or so then this is not a problem at
26 > all
27 >
28 >
29 > >
30 > > If badly written application starts writing some crap in
31 > > /run, it could deadlock my computer quite easily. And before
32 > > you ask, no it is not so easy to do with /run on hard-drive
33 > > because I have plenty of TB there and monitoring software
34 > > running which alerts me as soon as any partition is half
35 > > full. Unfortunatelly this does not work for tmpfs because
36 > > with given read/write speed of ram-disk it would be full
37 > > in a few seconds before I had any chance to act...
38 > >
39 > > Jarry
40 > >
41 >
42 >
43 >
44
45 all on one line:
46
47 tmpfs /tmp tmpfs
48 size=2500M,mode=1777,noatime,auto 0 0
49
50
51 4G ram (diskless, atom board) works well
52 3G on an otherwise similar system goes bang when compiling glibc or gcc
53 as portage and portage tmp in /tmp and ram needed for compiling meet in
54 the middle :)
55
56 Helped by swap on an NDB and mapping some space over NFS when really
57 needed.
58
59 BillK