/tmp filesystem full
John Hein
jhein at symmetricom.com
Wed Aug 22 13:47:05 UTC 2012
Andy Wodfer wrote at 12:59 +0200 on Aug 22, 2012:
> Hi,
> I have about 500MB in my /tmp and it seems to be too small when the
> periodic LOCATE script runs every week.
>
> What's the best way to increase the size of /tmp ? Could I simply remove it
> and create a symbolic link ln -s to say /usr/tmp instead (where I have
> several hundred GBs free)?
>
> PS! This is on a live server and I would like to keep downtime and
> problems to a minimum. :-)
One way is to work around your problem is to add
'TMPDIR=/path/to/bigger/filesystem' in /etc/crontab
and/or 'export TMPDIR=/path/...' in /etc/periodic.conf.
No downtime for that.
But yes, you can make /tmp a sym link. You may have to worry about
edge cases regarding booting (like if the filesystem you point to is
not available early enough at boot time). In the typical case (e.g.,
locally mounted ufs), it should work fine. There may be very rare
cases of software that gets confused by a sym link for /tmp, but
certainly the stock periodic scripts should work with it.
Depending on what processes have files open on /tmp, you may decide to
use some down time to make the sym link. You can't use mv(1) to
rename a mounted mount point. If you can umount /tmp, then you can
rename it and make the sym link. But it's possible some processes
have files open in /tmp preventing a normal umount (see lsof(8),
fstat(1)). You would have to convince those processes to close the
/tmp file descriptors.
More information about the freebsd-questions
mailing list