Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Aug 2012 23:21:12 +0100
From:      RW <rwmaillists@googlemail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: /tmp filesystem full
Message-ID:  <20120822232112.07ac3517@gumby.homeunix.com>
In-Reply-To: <CAHu1Y72xwNevgKQ8eVYYOzGC80-511DtDe8kJMWbYJm5Tq28CA@mail.gmail.com>
References:  <201208221934.q7MJYfwM063804@mail.r-bonomi.com> <1345664911.2501.8.camel@z6000.lenzicasa> <CAHu1Y72xwNevgKQ8eVYYOzGC80-511DtDe8kJMWbYJm5Tq28CA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 22 Aug 2012 14:14:17 -0700
Michael Sierchio wrote:

> This will happen automatically if you go to multiuser without a
> writeable /tmp.  See /etc/rc.d/tmp

It doesn't, the default is an old-fashioned md device, not tmpfs.


> I have a problem with the semantics of the rc scripts for this and
> var, though - if you are going to use a memory-backed filesystem, you
> should reserve all the space at the outset.  

It defaults to 20MB. There's no such thing as an unlimited md-backed
device


> "Bad things" can occur as
> you approach the memory limit (like a kernel panic) otherwise.

Provided that you have swap you can have a /tmp that's much bigger
than memory with either md or tmpfs.

> I'd prefer something like this:
> 
>         _mdunit=`mdconfig -a -n -t malloc -o reserve -s ${tmpsize}`

It's a bad idea to use a malloc device as it uses wired kernel memory, the default allows the files to be written out
to swap rather than panic the kernel.

>         newfs /dev/md${_mdunit} > /dev/null 2>&1
>         mount -o ${tmpmfs_flags} /dev/md${_mdunit} /tmp
> 
> But that's just me. mount_md doesn't quite do this.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120822232112.07ac3517>