/tmp and swap space

David Wolfskill david at catwhisker.org
Thu Jul 29 16:33:08 UTC 2010

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 at 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

> 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

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

# 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).

david   (a fan of swap-backed /tmp)
David H. Wolfskill				david at 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20100729/f99be26f/attachment.pgp

More information about the freebsd-current mailing list