Why is /var/tmp not mounted on swap?

  • Follow


Why is /var/tmp not mounted on swap like /tmp?

/var/tmp seems to accumulate old files and could also be used to fill
/.

..

0
Reply greek_philosophizer (42) 8/29/2006 1:49:52 PM

On 29 Aug 2006 06:49:52 -0700
"greek_philosophizer@hotmail.com" <greek_philosophizer@hotmail.com>
wrote:

> Why is /var/tmp not mounted on swap like /tmp?

Because it would then also encroach on, and be limited to, the size of
virtual memory. Now it can be used to hold temporary files of arbitrary
size (at least if /var is adequately dimensioned).

> /var/tmp seems to accumulate old files

So does /tmp if you don't reboot often. If it bothers you, write a
script to clean /var/tmp.

> and could also be used to fill /.

/var should be on a separate slice. 

Take care,

-- 
Stefaan A Eeckels
-- 
A journalist is someone whose business it is to explain to others 
what he personally does not understand	     -- Alfred Northcliff
0
Reply Stefaan 8/29/2006 1:58:55 PM


>> On 29 Aug 2006 06:49:52 -0700,
>> "greek_philosophizer@hotmail.com" <greek_philosophizer@hotmail.com> said:

> Why is /var/tmp not mounted on swap like /tmp?  /var/tmp
> seems to accumulate old files and could also be used to
> fill /.

/tmp is usually meant to be volatile, i.e. files can
disappear across reboots.

/var/tmp is for things that should be preserved across
reboots, e.g. vi session recovery files.

hth
t
0
Reply Tony 8/29/2006 1:59:08 PM

"Stefaan A Eeckels" <hoendech@ecc.lu> wrote:
> > /var/tmp seems to accumulate old files
> 
> So does /tmp if you don't reboot often. If it bothers you, write a
> script to clean /var/tmp.

That requires some care, or your script will delete files which
are essential for various applications and processes.


Thomas
0
Reply Thomas 8/29/2006 4:58:18 PM

On Tue, 29 Aug 2006 18:58:18 +0200
"Thomas Dehn" <thomas-usenet@arcor.de> wrote:

> 
> "Stefaan A Eeckels" <hoendech@ecc.lu> wrote:
> > > /var/tmp seems to accumulate old files
> > 
> > So does /tmp if you don't reboot often. If it bothers you, write a
> > script to clean /var/tmp.
> 
> That requires some care, or your script will delete files which
> are essential for various applications and processes.

I know ;-)

-- 
Stefaan A Eeckels
-- 
   The one thing IT really needs to outsource is the freakin' clueless
 managers that don't understand that there are more possibilities than
chaos on the one hand and the reduction of alternatives to zero on the
other.                    -- Richard Hamilton in comp.sys.sun.hardware
0
Reply Stefaan 8/29/2006 6:49:12 PM

In article <1156859392.730382.215450@h48g2000cwc.googlegroups.com>,
 "greek_philosophizer@hotmail.com" <greek_philosophizer@hotmail.com> 
 wrote:

> Why is /var/tmp not mounted on swap like /tmp?
> 
> /var/tmp seems to accumulate old files and could also be used to fill
> /.
> 
> .


<nit>
/tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k 
lies when it says "swap" for /tmp.
</nit>

I feel better now :).

-- 
Ken

Remove pants before e-mailing!

krgray@pantsverizon.net
0
Reply Ken 8/29/2006 8:27:19 PM

Ken Gray <see-sig@nowhere.invalid> wrote:
> /tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k 
> lies when it says "swap" for /tmp.

If tmpfs uses swap for the storage, why is df incorrect to show "swap"
as the device?

I don't see the error.  It's true that not *all* of swap is available to
tmpfs, but I don't think that's what you're referring to.

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 8/29/2006 10:13:25 PM

In article <9_2Jg.1632$Cq4.510@newssvr25.news.prodigy.net>,
 Darren Dunham <ddunham@redwood.taos.com> wrote:

> Ken Gray <see-sig@nowhere.invalid> wrote:
> > /tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k 
> > lies when it says "swap" for /tmp.
> 
> If tmpfs uses swap for the storage, why is df incorrect to show "swap"
> as the device?
> 
> I don't see the error.  It's true that not *all* of swap is available to
> tmpfs, but I don't think that's what you're referring to.

I was over-simplifying, but the reason why I say that df lies about swap 
is that you'll see the numbers change based on the allocations made by 
tmpfs - so what it's showing you is how much of the swap reserve tmpfs 
is using, not the amount of swap available.

It's not really an error, just an annoyance to me. I seem to have many 
things these days that annoy me :).

-- 
Ken

Remove pants before e-mailing!

krgray@pantsverizon.net
0
Reply Ken 8/29/2006 11:02:26 PM

Ken Gray <see-sig@nowhere.invalid> writes:
>In article <9_2Jg.1632$Cq4.510@newssvr25.news.prodigy.net>,
> Darren Dunham <ddunham@redwood.taos.com> wrote:

>> Ken Gray <see-sig@nowhere.invalid> wrote:
>> > /tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k 
>> > lies when it says "swap" for /tmp.
>> 
>> If tmpfs uses swap for the storage, why is df incorrect to show "swap"
>> as the device?
>> 
>> I don't see the error.  It's true that not *all* of swap is available to
>> tmpfs, but I don't think that's what you're referring to.

>I was over-simplifying, but the reason why I say that df lies about swap 
>is that you'll see the numbers change based on the allocations made by 
>tmpfs - so what it's showing you is how much of the swap reserve tmpfs 
>is using, not the amount of swap available.


Just as aside back onto the thread topic, one thing that is kind of
anoying about tempfs is that it doesn't allocated very many inodes.

Since /tmp isn't that much space, but /var/tmp is usually much more on
many systems such that I tend to use it for large temp operations, I
can see many people going nuts trying to figure out why /var/tmp is
broken with plenty of space left because it ran out of inodes. 
Last time I checked, this wasn't a tunable either. 

Another problem in some rare environments is that quotas don't work on
tempfs.. You may not need to quota /tmp, but some people do. :)
0
Reply Doug 8/29/2006 11:48:47 PM

In article <44f4d25f$0$28274$892e0abb@auth.newsreader.octanews.com>,
 Doug McIntyre <merlyn@geeks.org> wrote:

> 
> Just as aside back onto the thread topic, one thing that is kind of
> anoying about tempfs is that it doesn't allocated very many inodes.
> 
> Since /tmp isn't that much space, but /var/tmp is usually much more on
> many systems such that I tend to use it for large temp operations, I
> can see many people going nuts trying to figure out why /var/tmp is
> broken with plenty of space left because it ran out of inodes. 
> Last time I checked, this wasn't a tunable either. 
> 

Ah, another annoying thing :). I wish it would say "no inodes" instead 
of "no space"...

The only way to "tune" it [/var/tmp, assuming UFS] is to change the 
number of bytes per inode when creating the filesystem (newfs -i ###). 
It'd be nice to do it on the fly, but it would be a nightmare to 
implement and keep the fs sane.

> Another problem in some rare environments is that quotas don't work on
> tempfs.. You may not need to quota /tmp, but some people do. :)

Well, quotas only work on UFS (I'm not including ZFS, QFS, etc., because 
I tend to doubt that anyone would put /tmp on one of those and I'm 
sticking with "stock" Solaris), so if /tmp is tmpfs, you're out of luck 
on that score. You could make /tmp UFS, but that has issues of its own. 
Or you could limit the size of /tmp with the size= option when mounted. 
Only problem with that is Oracle tends to get cranky if you make it too 
small.

-- 
Ken

Remove pants before e-mailing!

krgray@pantsverizon.net
0
Reply Ken 8/30/2006 12:58:35 AM

Ken Gray wrote:
> In article <1156859392.730382.215450@h48g2000cwc.googlegroups.com>,
>  "greek_philosophizer@hotmail.com" <greek_philosophizer@hotmail.com>
>  wrote:
>
> > Why is /var/tmp not mounted on swap like /tmp?
> >
> > /var/tmp seems to accumulate old files and could also be used to fill
> > /.
> >
> > .
>
>
> <nit>
> /tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k
> lies when it says "swap" for /tmp.
> </nit>
> 

tmpfs will use up memory first, then swap.  

Victor

0
Reply victorfeng1973 8/30/2006 3:10:38 AM

victorfeng1973@yahoo.com wrote:
>> <nit>
>> /tmp is NOT mounted on swap - it's tmpfs, which is backed by swap. df -k
>> lies when it says "swap" for /tmp.
>> </nit>
>> 

> tmpfs will use up memory first, then swap.  

That's only true if you think of 'swap' as being the stuff on disk. 

Most utilities (and tmpfs) consider 'swap' the unified view of all pages
in RAM and swapfiles.  So you might say that the VM system will tend to
allocate pages in RAM first, then on disk, but I would not refer to
either of those singly as "swap".

-- 
Darren Dunham                                           ddunham@taos.com
Senior Technical Consultant         TAOS            http://www.taos.com/
Got some Dr Pepper?                           San Francisco, CA bay area
         < This line left intentionally blank to confuse you. >
0
Reply Darren 8/31/2006 6:17:57 PM

11 Replies
407 Views

(page loaded in 0.103 seconds)

Similiar Articles:


















7/21/2012 5:14:09 PM


Reply: