Why is there /tmp in addition to /var/tmp.

Why is there /tmp in addition to /var/tmp.

Post by G. Hugh SO » Wed, 19 Mar 1997 04:00:00



What is the usage difference for /tmp and /var/tmp?  I do not
understand why /tmp is there in the / partition.  Anybody
can fill the / partition and kill the whole system.

Thanks a lot.

G. H. Song


--
G _. _  _H _u _g _h _  _S _O _N _G _
 [5;7m KJIST  [0m
Associate Professor
Ofiice: +82-62-970-2210
Departmental fax: -2204
Home:   +82-62-513-0470

Department of Information and Communications
Kwangju Institute of Science and Technology
572 Sangam-dong, Kwangsan-gu,
Kwangju,  South KOREA

 
 
 

Why is there /tmp in addition to /var/tmp.

Post by David Ann » Thu, 20 Mar 1997 04:00:00




Quote:>What is the usage difference for /tmp and /var/tmp?  I do not
>understand why /tmp is there in the / partition.  Anybody
>can fill the / partition and kill the whole system.

/tmp is a temporary (tmpfs, not ufs) filesystem contained in the swap
partition, not in /. It is wiped out on every re-boot. Filling it will
crash the system, but that's because you've wiped out the swap area,
not because of lack of root space. (Of course, you can limit the size
of /tmp to prevent that).

/var/tmp is a directory in a mounted filesystem. It is only cleaned
out by conscientious system administrators.
********************************************************
** Dave Annis         | With age comes wisdom, if you **
** Sheboygan, WI      |   stay awake along the way!   **
********************************************************

 
 
 

Why is there /tmp in addition to /var/tmp.

Post by Ian Stirlin » Fri, 21 Mar 1997 04:00:00



:
: >What is the usage difference for /tmp and /var/tmp?  I do not
: >understand why /tmp is there in the / partition.  Anybody
: >can fill the / partition and kill the whole system.
: >
:
: /tmp is a temporary (tmpfs, not ufs) filesystem contained in the swap
: partition, not in /. It is wiped out on every re-boot. Filling it will

Not in linux it ain't, YMMV.
(slackware 3.0)

: crash the system, but that's because you've wiped out the swap area,
: not because of lack of root space. (Of course, you can limit the size
: of /tmp to prevent that).
:
: /var/tmp is a directory in a mounted filesystem. It is only cleaned
: out by conscientious system administrators.
: ********************************************************
: ** Dave Annis         | With age comes wisdom, if you **
: ** Sheboygan, WI      |   stay awake along the way!   **
: ********************************************************

--
Ian Stirling.                     Currently designing a new PDA, see homepage.
Homepage:                         http://www.mauve.demon.co.uk/
Money is a powerful aphrodisiac, but flowers work almost as well.
Robert A Heinlein

 
 
 

Why is there /tmp in addition to /var/tmp.

Post by Mark Land » Sat, 22 Mar 1997 04:00:00





>>What is the usage difference for /tmp and /var/tmp?  I do not
>>understand why /tmp is there in the / partition.  Anybody
>>can fill the / partition and kill the whole system.

>/tmp is a temporary (tmpfs, not ufs) filesystem contained in the swap
>partition, not in /. It is wiped out on every re-boot. Filling it will
>crash the system, but that's because you've wiped out the swap area,
>not because of lack of root space. (Of course, you can limit the size
>of /tmp to prevent that).

None of the above is true for /tmp in HP-UX.

Some processes might need some scratch space before it can be guaranteed that
/var (which on most systems is a separate file system) has been mounted --  
thus, /var/tmp is not available yet.

Of course, on some of my systems, /tmp is a separate file system also. Probably
the reason there is a /tmp and a /var/tmp (formerly /usr/tmp) is lost in the
mists of UNIX history. Like why tar can do all kinds of very bad things to
important files if you are not careful....looking back, it makes no sense, but
that's the way it happened, and now the refrain of "we can't fix because it
would break existing scripts" is used to perpetuate the madness. :)

--
Mark Landin
T. D. Williamson, Inc.
UNIX Sys. Admin
"If you take the smooth, you gotta take the rough" -- Rob Halford

 
 
 

Why is there /tmp in addition to /var/tmp.

Post by Stephen Potte » Wed, 26 Mar 1997 04:00:00



Quote:> What is the usage difference for /tmp and /var/tmp?  I do not
> understand why /tmp is there in the / partition.  Anybody
> can fill the / partition and kill the whole system.

/tmp is mostly historical.  That was where it was originally.  Sun later
came up with the bright idea of moving it off of the root slice and putting
it elsewhere.  However, they've never updated all software to point to the
new location, so /tmp stays around.  A better idea than having /tmp on the
root slice is to make it a tmpfs and mount it as swap.  It's not likely
that anyone will completely use up all available swap in temp files (you
can watch and make sure), plus it won't crash your machine, only seriously
degrade the performance.

-spp
--
Stephen P Potter        Pencom Systems Administration         Lucent, Columbus
                        Pencom/PSA, Team "Oh, Yeah!"

        Check out <A HREF="http://www.perl.org/">The Perl Institute</A>

 
 
 

1. Why is there /tmp in addition to /var/tmp?

Why is there /tmp in addition to /var/tmp?  Of course, I set up partions
so that /tmp is in the / partition, while /var/tmp is in /var partition.
Anybody can fill the / partition by running, e.g., vi on a big file.

Am I suppose to do "ln -s /tmp /var/tmp" after "rmdir /tmp"?   Both
Slackware and RedHat distributions have the two directories separately.  I
don't understand why.

Thanks.

G. H. Song

--
G _. _  _H _u _g _h _  _S _O _N _G _
 [5;7m KJIST  [0m
Associate Professor
Ofiice: +82-62-970-2210
Departmental fax: -2204
Home:   +82-62-513-0470

Department of Information and Communications
Kwangju Institute of Science and Technology
572 Sangam-dong, Kwangsan-gu,
Kwangju,  South KOREA

2. News: Sun ports documentation to XML

3. /tmp vs /usr/tmp vs /var/tmp

4. File permission effects

5. How to limit the use of /tmp and /var/tmp by arbitrary users

6. Where can I get libXm.so for redhat linux 5.2?

7. Permissions on /tmp or /var/tmp?

8. dead keys are beautiful

9. difference between /tmp and /var/tmp?

10. Permissions on /tmp or /var/tmp?

11. mfs & /tmp vs /var/tmp

12. /var/tmp -> /tmp (was: Anything wrong with just two disk partitions?)

13. dangers of linking /var/tmp -> /tmp