[5853] in RedHat Linux List

home help back first fref pref prev next nref lref last post

Re: Is it safe to rm /tmp?

daemon@ATHENA.MIT.EDU (Mike Sangrey)
Sun Nov 24 17:01:16 1996

To: redhat-list@redhat.com
In-reply-to: Your message of "Sun, 24 Nov 1996 11:00:04 PST."
             <32989B34.55DD2DE8@iceonline.com> 
Date: Sun, 24 Nov 1996 16:58:45 -0500
From: Mike Sangrey <mike@sojurn.lns.pa.us>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com

Borg wrote:
> Johnie Stafford wrote:
> ........
> > Only if you put something in the bootup process to recreate it. I
> > delete /tmp and recreate it early in the boot process. Under the
> > RedHat init scheme I'd say right after /etc/mtab get cleared. Its
> > probably in rc.sysinit.
> > 
> > # Clear /tmp
> > rm -fr /tmp
> > mkdir /tmp
> > chmod 1777 /tmp
> > 
> >  b> What's a recommended partition size for /tmp? Is 4
> >  b> MB enough for everything that I can possibly do?
> > 
> > I just leave /tmp as part of my root file system.
> 
> Yes, and I want /tmp mounted in memory using ramdisk. When
> I shutdown, memory gets emptied and I was just wondering if
> all those directories and files:

> will be re-created automatically on the next system bootup,
> or do I need to run a script in order to re-create them
> with "mkdir" and "touch" and if yes, which ones and in what
> consequence. That's why I also asked about a recommended
> size for /tmp.

A ramdisk for /tmp seems like a really great idea.  However, I'm of the opinion it really doesn't buy you much.  Linux will use the memory more efficiently since it has the information it needs to dynamically allocate memory to applications as it sees fit.  This includes an application's use of disk blocks which are in turn cached in memory.  In other words, as an application is using /tmp, the disk blocks associated with /tmp are cached in memory anyway.  So, what's the point of the ramdisk?  I'd just let Linux do what it does and be done with it.  There are arguments the other way; I just think they're weaker.

Secondly, and perhaps more importantly, the size of /tmp depends on what you're going to be running.  Say you sort 100 meg files, for example.  You're going to need a big /tmp.  Say you are using your linux box as an Xterminal only.  You can get away with a /tmp of a couple meg.

Anyway, I usually figure 40-80Meg.  (At work we have 4Gig /tmp on an DEC Alpha Unix box -- it was the smallest we thought we could get away with and we were right:-)  You don't want to create it too small since it's a little unhandy to make it bigger.  I had a /tmp of 20-30Meg once and ran out of space doing something.  I had to play games with symlinks to get the job done.

Lastly, /tmp by definition is temporary.  Some Unix systems empty /tmp upon boot up, all though more modern ones only do that with /var/tmp.  I admit that I've never tried what you are suggesting, but it should work.
-- 
  Mike Sangrey	<mike@sojurn.lns.pa.us>	(Home)
		<Mike.Sangrey@specmarkmet.com>(Work)
	"I've trademarked `William Della Croce, Jr.(tm)'.
		  Anyone using this name owes me $1,000,000."



--
  PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
  ________________________________________________________________________
  http://www.redhat.com/RedHat-FAQ   http://www.redhat.com/RedHat-Errata
  http://www.redhat.com/RedHat-Tips  http://www.redhat.com/mailing-lists
  ------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post