# How big should /var/tmp be?



## JoshuaBranson (Jul 29, 2011)

I plan on installing a couple of programs using source code: FireFox, AbiWord, Xfce, etc. 
How big should I make my /var/tmp? I'd also like to download the source code for the FreeBSD kernel. Does FreeBSD install source into /var/tmp?


----------



## Bunyan (Jul 29, 2011)

*/var/tmp* is used as temporary place for an unpacked packages, before being installed.
A good idea is to delete that directory
*rm -rf /var/tmp* 
and create a softlink to */tmp* instead of this
*ln -s /tmp /var/tmp*
And better is to move */tmp* into SWAPSACE
by editing */etc/rc.conf*

```
tmpmfs="YES"
tmpmfs_flags="-m 0 -o async,noatime -S -p 1777"
tmpsize="768m"
```
Now I have allocated 768 Mb of SWAP area for temporary storage.
That will do for any heavy compile or large package install.


----------



## rusty (Jul 29, 2011)

Programs that are built from ports use a work dir which resides inside its port directory, so /usr/ports/
The downloaded *.tar.gz's are placed in /usr/ports/distfiles/.

FreeBSD sources are installed to /usr/src/

N.B. One can set *WRKDIRPREFIX=</path/to/dir>* in /etc/make.conf if you wish to build ports elsewhere, ie NFS ro mounts as an example.


----------



## fonz (Jul 29, 2011)

JoshuaBranson said:
			
		

> How big should I make my /var/tmp?
> [snip]
> Does FreeBSD install source into /var/tmp?


FreeBSD kernel source code goes in /usr/src/sys.
Ports (distfiles plus build directories) go in /usr/ports.
Packages unpack in /var/tmp but normally get removed afterwards.
The only other thing I can think of right now that uses /var/tmp is editors/vim, for its recovery files.

I don't usually make /var/tmp a seperate filesystem because my /var is large enough already. You could also remove /var/tmp and (re)symlink it to /tmp if you like - and if /tmp is large enough of course.

Because /var/tmp is mostly used for package unpacking, I'd say that 500 MB ought to be enough, you can probably even do with less. Having said that, I wouldn't make /var/tmp a seperate partition in the first place.

I do tend to make seperate partitions for /usr/src though. The FreeBSD kernel source code is around 150-200 MB _[Edit: actually, that's *all* source, not just the kernel - my bad, sorry]_ but you'll also need space for the actual build (object files and stuff), so I'd say reserve at least 500 MB for that.

Hope this helps,

Fonz


----------



## UNIXgod (Jul 29, 2011)

It's a good idea to read tuning()(7)


----------

