Subject: Re: Disk partitioning.
To: Rodney M. Hopkins <rhopkins@sunflower.com>
From: Colin Wood <cwood@ichips.intel.com>
List: port-mac68k
Date: 09/20/1997 20:01:59
Rodney M. Hopkins wrote:
> 
> I'm in the process of deciding on a partitioning scheme to use for my
> MacBSD disk.
> 
> The question I have is what is the /tmp directory used for and what do I
> gain by placing it on a separate partition as I have seen recommended here
> recently? 

Depending on what programs you use, the /tmp directory gets written to a
lot.  Having it on a separate partition from your root partition means
that writes to your root partition are less frequent.  This is generally
probably a good thing.  Also, if you choose to do so, you can mount /tmp
using MFS.  This means that the filesytem is actually in memory.  If you
have enough real memory, this should significantly speed up access to
files in the MFS-mounted filesystem.  Since stuff like kernel compiles
makes a lot of use of the /tmp directory (at least I think that gcc uses
/tmp for temporary files) this could speed up compiles.  If anyone knows
why this theory is wrong, please let me know :-)

> How does /tmp differ from the swap partition?

Significantly!  The swap partition serves as extra (and much slower)
memory for the VM (virtual memory) system.  When the programs you are
running start using more memory than you physically have on your machine,
the vm system will move the least-recently used (well, that's not the
exact algorithm) pages of memory out to the swap partition, thus freeing
up real memory for use by the programs that are currently running (this is
called paging, swapping is a bit different).

However, the /tmp directory has no real relationship to a swap partition.
The /tmp directory is generally used as a place to keep temporary files
and is usually writable by anyone on the system.  This is useful to have
b/c on occasion people need space that wouldn't fit within their quota,
and also for those daemon programs that might not have their own home
directories.

> And given my
> setup (Mac SE/30, 20M RAM, 1.2GB HD) what size should /tmp be?  100M as I
> saw recommended here recently be Collin?  Larger?  Smaller?

100MB was just my general suggestion.  In all reality, that's probably
bigger than you need.  I have my /tmp directory still on my root partition
(I'll deal with MFS one of these days ;-), and my root partition is about
50MB in size.  So, you could get away with a much smaller /tmp directory.
I figure that 20MB is probably big enough for ordinary use.  Then again,
you might not even bother creating a separate /tmp partition.  You might
find the extra space more useful to store a copy of the complete NetBSD
source tree or something like that (assuming that the source will even fit
in 100MB, that is :-)  In all reality, how much space you give to
different partitions is up to you (provided that you have a minimum
amount, that is).

Does this help?

Later.

-- 
Colin Wood                                 cwood@ichips.intel.com
Component Design Engineer - MD6                 Intel Corporation
-----------------------------------------------------------------
I speak only on my own behalf, not for my employer.