SUMMARY : Is it possible to redirect /tmp ?

From: RAFFAELE CALOGERO <CALOGERO_at_CHEMNA.DICHI.UNINA.IT>
Date: Thu, 07 Dec 1995 14:03:29 +0100 (CET)

Thanks to everybody for the help!
Raffaele Calogero
Dip. Genetica, Biologia Generale e Molecolare
via Mezzocannone 8, 80134 Napoli Italy
tel ++39 81 55 267 208
fax ++39 81 55 27 950
e_mail calogero_at_chemna.dichi.unina.it


Raffaele question:
> I have a dec alpha 400 4/166 server. Recently the system was bocked because a
> huge mail message (13 MB!) was send to the pop server and it got stuck in
> the /tmp directory filling it up.
>
> I would like to know if it is possile to redirect the /tmp directory in an
> other file system where I have more space in order to overcome the small
> space available on the /tmp of the system disk.
>
> Moreover, if I cannot redirect the /tmp is it possible to define a limit
> in the size of mail message that can be accepted by the server ?



Eric R Showalter wrote:
Use a symbolic link to say /usr/tmp or any other file you want to direct it to.
We use this method all the time.

Dale Blasingam wrote:
I can think of a couple of possibilities. The one I would chose would
be to mount this "other" filesystem you mention on /tmp; that way you
can make /tmp as big as you like, up to the limits of the filesystem
you mount there. It's still a good idea, I've found, to have some spare
space on the / filesystem (10-20 MB?, more?) so that if the filesystem you
mount on /tmp is unavailable, you still have enough temp space to do things
like edit files or build a kernel.

Another option is to make a symbolic link from /tmp to another mounted file-
system with more space. I don't like this option; it will bite you when
you're doing system maintenance (like OS upgrades) or when you're in
single user with nothing mounted but /. It will work, though.

Marcel Bernard wrote:
Symlinking /tmp is not a very good idea, since you may not have
the directory avalable in single user mode.
You can mount a separate /tmp filesystem
We have that on a number of AXP crunchers here.
(1GB /tmp)

Thomas P. Blinn wrote:
I can not speak for the pop server. However, if you have a partition free
that you can use for /tmp, then just create a file system on it (either UFS
or AdvFS if you prefer) and mount it on /tmp in your /etc/fstab. You can
also have /tmp be a memory file system, but that doesn't win if you've got
undisciplined uses.

Rob Naccarato wrote:
You can make /tmp an mfs. You can use a line like:
        -s65536 /tmp mfs rw 0 0
in /etc/fstab. This ends up making a memory file system about 32MB. Should
speed up things as well (if you've got a good amount of RAM).
You can mount /tmp anywhere you want, just like any other filesystem.
You also might want to make /tmp ADVFS. From what I've read, you can change
the size of ADVFS file systems on the fly (by adding a new volume to the
system). We haven't done this ourselves, but it looks promising.

Paul E. Rockwel wrote:
Better mount a larger file system on /tmp at system startup via
/etc/fstab. I've seen folks do symbolic links of /tmp to other file
systems but this is not recommended as you will not have a /tmp directory
when you are in single user mode at boot time.


Don Ritchey wrote:
In the /sbin/init.d directory is a file 'sendmail'. Inside that file,
before the line that starts the sendmail program, define the
environment variable TMPDIR to be /usr/tmp (which is usually on a file
system with much more room than /tmp). This should tell sendmail to
use the /usr/tmp directory for temporary files.
         
Dave Hinkle wrote:
I had this same problem with a Linux box that we use as a mail
server. Anyway, I just got the source for the pop server and
modified where it put its temp files, recompiled and everything works
great now! I don't think its wise to redirect the /tmp directory
because it might be used when the system is starting up, and if it is
linked to some other disk that is not mounted yet, might cause some
wierd problems.

Paul S. Sears wrote:
Option one (as root):
# rm /tmp
# ln -s /usr/tmp /tmp
Option two (as root):
# /sbin/mount /dev/rz?? /tmp <---- Mount a disk as tmp.

Jason Neil wrote:
Yes you can. use ln -s to create a symbolic link to, say, the
/usr/var/tmp directory. I think you can also limit the size of your mail
messages, but don't know how. try man sendmail.

Julie wrote:
It's pretty easy in the operating system to redirect /tmp.
1. Find a file system with lots of space on it.
2. cd to that file system
3. mkdir tmp
4. cd /
5. umount /tmp
6. rmdir /tmp
7. ln -s _big_file_system_/tmp /tmp
8. This will disable the currently allocated disk space or volume-managed
   virtual disk space and instead use the newly created directory as the
   new /tmp.
There are lots of ways to take care of this problem, so if this option is
unacceptable, please write back to me, and I'll make another suggestion.
Also, for the profiles of individuals, if you set the environment variable
TMPDIR to some other directory other than /tmp, then they will also use an
alternate location for temporary files such as those created by "vi".
Bourne/Korn shell syntax: export TMPDIR=/alternate/location
Where alternate location is the path name to a directory to be used for
temp space. c-shell syntax: setenv TMPDIR /alternate/location
      p.s. There may be solutions within the pop server, but you may
      have problems with other applications trying to use /tmp
      too, that is why I suggested an operating system solution.
      Also, you will probably want to utilize the old /tmp space
      to some other file system.

Alan wrote:
        If you have a spare partition, the easiest thing to do
        is give /tmp its own file system. You may be able to
        link /tmp to /var/tmp (or another of you chosing), but
        you have to watch out for startup scripts that clear
        /tmp. It may remove everything in /var/tmp or will
        remove the link instead.
        It may also cause problems running single user, if the
        other end of the link doesn't exist before the file
        systems are mounted.

Carl Privitt wrote:
 I do it on every OSF/1 machine
 Here's a typical disk layout.
% df -k
Filesystem 1024-blocks Used Avail Capacity Mounted on
/dev/rz3a 63231 39950 16957 70% /
/dev/rz3g 770036 274686 418346 40% /usr
/dev/rz5c 1991325 176945 1615247 10% /home
 This sytem has a 1.05GB disk for the OS ( rz3 -> / and /usr ). I am
 only using 40% of /usr. I happen to know that /var is a pointer to
 /usr/var where there already exist a temporary directory, i.e. /var/tmp.
 So I rename the existing temporary directory (so that processes with
 open files in /tmp won't have problems) and place a symbolic link pointing
 to /var/tmp which resides on /usr.
 # cd /
 # mv tmp tmp.old
 # ln -s /var/tmp /tmp
 # ls -ld /tmp
 lrwxrwxrwx 1 root system 8 Nov 3 20:48 /tmp -> /var/tmp
 There's nothing magical about /usr. If I wanted to, I could create a
 new temporary directory on /home and point /tmp there.
 # cd /
 # mv tmp tmp.old
 # mkdir /home/tmp
 # chmod 1777 /home/tmp
 # ln -s /home/tmp /tmp


Marco Luchini wrote:
Can't you just make /tmp a soft link to /usr/tmp or /home/tmp or
whatever? I've often done it in reverse, actually, creating a large
/tmp partition and soft-linking /usr/tmp and /var/tmp to it so that /usr
is a true read-only partition (which has some advantages).

Steve wrote:
 many systems symlink /tmp to /var/tmp if it's on
 a different filesystem. If /var is on a different
 filesystem and that filesystem has more available
 space, use /var/tmp. For example;
 HOST> cd /
 HOST> mv /tmp /tmp.sav
 HOST> ln -s /var/tmp tmp
 This will create the symbolic link.

--Boundary (ID L3k4290miV18mXUfuW11Zg)--
Received on Thu Dec 07 1995 - 14:42:50 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:46 NZDT