Summary: /tmp and swap Solaris2.4

From: Joe Dietz (
Date: Tue Mar 21 1995 - 04:18:54 CST

Thanks for some great answers! I have moved my /tmp to a partition rather
than make use of the swap area. I have a giant comment in /etc/vfstab to
reminde me to change this back when/if I need to upgrade the OS--thanks for
the tip Sue.


Original Question:

I have looked around at faq and not found a good overall answer....
I have been using SunOS4.1.3 for some time and Solaris 2.4 is still a little

Could someone clear up the association between "swap" and "/tmp" for me....

I am running some software that likes to use /tmp and this eats at my swap
space....I think...I've made swap=/tmp about 70mb for a 32mbRAM system

I would like to move /tmp... but I don't know how this will effect Solaris
2.4...I would like to set up "/tmp" so it is used like a SunOS4.1.3 system.

Original Question:

Summary of Replies:


From: Chris Terry/Computervision


As you have noticed the default action with Solaris 2 is to use tmpfs or any
swap not in use rather than an area on disk (you had to turn it on specifically
in 4.1.3). To turn it off, i believe that you just comment out the swap mount
line in /etc/vfstab.


From: (Rob Tanner)

tmpfs (where swap is used as /tmp) is available both in SunOS4.1.3
and Solaris -- you had to enable it in SunOS4.1.3 and it is the
default in Solaris.
The requirement for backing store in Solaris is greatly reduced by
virtue of virtual swap which is new in Solaris. The 70mb you have
allocated for real physical swap is really overkill, so if you have
some real /tmp hungry applications, don't worry that much unless your
seeing other problem as well.
The command "swap -s" will give you a good idea of the used/available
ratios. Also, look at the last line of output from "vmstat 30 2" (and
ignore the line immediately above it). Under the column labelled swap
you will find the avarage available swap and under free the free
memory (all in Kbytes). swap should be 10,000K or above. Don't worry
about it unless the swap value falls below 10,000k for frequent
periods. The column labelled "sr" is the pagedaemon scan rate. If
it's under 200 you've got lots of memory. If it's near zero, your not
even paging, much less swapping.

Hope this helps.

-- Rob

From: (Michael Seeger)

Under Solaris swap gets mounted on /tmp.
This is done in /etc/vfstab by the line

#device device mount FS fsck mount mount
#to mount to fsck point type pass at boot options
swap - /tmp tmpfs - yes -

So if you start writing to /tmp your available swapspace decreases. This
may cause problems if you have applications that make heavy use of memory,
or a highly loaded system, plus writing a lot to /tmp/.
If you take this out of /etc/vfstab the system works ok, you loose
your fast /tmp-filesystem but your are now free to link /tmp to what ever
you want, for example make /tmp a link to /export/home/tmp.

hope this helps

From: (Bert Robbins)

1) Increase the swap space, either by adding another swap partition or
   creating a file on an existing partition and doing a swap on.

2) Add a disk partition and mount it at the /tmp directory.

Bert Robbins Newbridge Networks Inc.

From: "Susan M. Menig" <>

You can set it up as a regular file system under Solaris 2.x, but I'd recommend
extending your swap space if you've got an unused partition laying around.
Solaris 2.x expects that /tmp is set up as a tmpfs file system (you can also
set it up like that under 4.1.x if you want - see the man page on tmpfs). You
get bit if /tmp is a regular file system when you go to upgrade. At the last
site I worked at, all the servers traditionally had /tmp as a mounted file
system. In the spirit of being consistant, I set up our first Solaris 2.x
server in the same manner. Everything worked just fine until I went to upgrade
to 2.3. Oh boy, that was a long night. The upgrade failed and left the system
in an unrecoverable state (the packages didn't get installed properly). I had
been called away shortly after starting the upgrade - everything looked like
it was going smoothely and by the time I got back :-(... I ended up spending
until around 2 a.m. restoring 2.2 since the machine had to be there in the
morning and I wasn't sure of exactly what had gone wrong. Needless to say, I
experimented on my own workstation to see the error of my ways. As soon as I
used tmpfs for /tmp is was as happy as a pig in sh*t. Moral of the story - if
you do decide to use a mountable /tmp, make sure you remember to change it back
to tmpfs before doing an upgrade (or at least leave notes for your successors -
unless you don't like them). Have fun ;-).


From: Richard Pieri <>

By default under System V R4, the /tmp volume is actually part of your
swap space. Your swap is the virtual memory paging space on whatever
disks you put it on. The reason for putting /tmp there is that access to
swap disk space is faster than standard filesystem read/write, so it's a
win for temporary files that are quickly created and destroyed, such as
cpp output. The drawbacks are that it gets wiped whenever the machine is
rebooted, because in effect /tmp is a RAMdisk, and if /tmp fills up you
can run out of swap space very quickly.

If you want to put /tmp onto a real, physical disk, there's no reason
you can't. You can expect to see a bit of performance degradation with
some apps, but it won't hurt to move it. It's a good idea if you want
your temp space to be a bit less transient.

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:19 CDT