Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 29 Jul 2010 09:15:19 -0700
From:      David Wolfskill <david@catwhisker.org>
To:        gahn <ipfreak@yahoo.com>
Cc:        free bsd <freebsd-current@freebsd.org>
Subject:   Re: /tmp and swap space
Message-ID:  <20100729161519.GK12818@albert.catwhisker.org>
In-Reply-To: <701277.97445.qm@web52303.mail.re2.yahoo.com>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Thu, Jul 29, 2010 at 08:35:30AM -0700, gahn wrote:
> hi all:
> 
> is it possible to create /tmp directory under swap space?

Certainly; case in point:

localhost(9.0-C)[4] uname -v
FreeBSD 9.0-CURRENT #71 r210558M: Wed Jul 28 07:46:04 PDT 2010     root@localhost:/usr/obj/usr/src/sys/CANARY 
localhost(9.0-C)[5] df -h /tmp
Filesystem    Size    Used   Avail Capacity  Mounted on
tmpfs         2.0G     12K    2.0G     0%    /tmp
localhost(9.0-C)[6] 

> under solaris, it is automatically created under swap unless one specifically instructs the system not to do so..

Quite so.

What I do -- both in CURRENT as well as stable/7 and stable/8 -- is:

localhost(9.0-C)[6] grep tmpfs /etc/fstab
tmpfs                   /tmp            tmpfs   rw,size=2g      0      0
localhost(9.0-C)[7] 

Note: doing this causes a message:

WARNING: TMPFS is considered to be a highly experimental feature in FreeBSD.

to be issued.  That said, I've been using it quite a bit in the last
couple of months, and have never had an issue with it of which I'm aware.

The way I used to set up swap-backed /tmp was to have the following in
/etc/rc.conf:

# tmpmfs="YES"
# tmpsize="2048m"
# tmpmfs_flags="-i4096 -o async"

(but since I'm now using tmpfs, I commented the above out in /etc/rc.conf).


Peace,
david   (a fan of swap-backed /tmp)
-- 
David H. Wolfskill				david@catwhisker.org
Depriving a girl or boy of an opportunity for education is evil.

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (FreeBSD)

iEYEARECAAYFAkxRqRYACgkQmprOCmdXAD05dQCfRpX5dyqVwn0UouQ0C/rHBj9m
zY4AnAq4gBH7VedIWKFl54kmPsfLW4pV
=NgUv
-----END PGP SIGNATURE-----
help

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