# TMPFS /dev/shm and /dev/run Questions [SOLVED]

## splurben

I am preparing a new system with an SSD and have been looking over some docs on various partitioning / usage schemes.

I've noticed that two of my Gentoo machines are mounting two TMPFS filesystems:

```
Filesystem            Size  Used Avail Use% Mounted on

...

tmpfs                15.9G  628K  15.9G   1% /run

...

shm                  15.9G   72K  15.9G   1% /dev/shm
```

A puerile assumption is that all 32GB of memory is used up, clearly it isn't.

Do I need both of these TMPFS file systems or have a missed a memorandum on a previous upgrade?

Do these file systems really need half of my memory? Or, should I configure them down to 2 or 3 GiB each?

I'm running x86_64 Gentoo kernel 3.5.2, BaseLayout 2.2, udev 189

Emerge info: http://gist.github.com/3495304

----------

## gorkypl

The are taking as much memory as they need, 'mount' shows only the upper limit.

If the limit makes you sleep bad, you can set the 'size' option in /etc/fstab

And while we are at it, I suggest putting /tmp and /var/tmp on tmpfs, especially with SSD and huge RAM.

----------

## splurben

 *gorkypl wrote:*   

> The are taking as much memory as they need, 'mount' shows only the upper limit.
> 
> If the limit makes you sleep bad, you can set the 'size' option in /etc/fstab

 

I'll keep an eye on them but I've never seen more than 20MiB in there.

 *gorkypl wrote:*   

> And while we are at it, I suggest putting /tmp and /var/tmp on tmpfs, especially with SSD and huge RAM.

 

Questions about using TMPFS for /var/tmp :

I'm using CCACHE, I'm assuming that /var/tmp/ccache will be moved to my LVM 3TB RAID5 storage (which does mount at boot) and adjust CCACHE_DIR in make.conf .

If I mount /var/tmp on TMPFS what will happen if the /var/tmp/portage directory doesn't exist after a reboot -- will portage recreate that directory on /var/tmp after a reboot?

Cheers

----------

## gorkypl

 *splurben wrote:*   

> 
> 
> I'll keep an eye on them but I've never seen more than 20MiB in there.
> 
> 

 

And you probably won't see more  :Smile: 

 *Quote:*   

> 
> 
> I'm using CCACHE, I'm assuming that /var/tmp/ccache will be moved to my LVM 3TB RAID5 storage (which does mount at boot) and adjust CCACHE_DIR in make.conf .
> 
> 

 

Yes, just remember to mount it after /var/tmp or put it in /var/ccache.

Aside of this, consider abandoning CCACHE, as it may give strange errors sometimes and is not a suggested feature anymore. You probably do not compile libreoffice five times a day?

On a powerful machine with /var/tmp in RAM the compilation times are rarely worth the overload of using CCACHE.

 *Quote:*   

> 
> 
> If I mount /var/tmp on TMPFS what will happen if the /var/tmp/portage directory doesn't exist after a reboot -- will portage recreate that directory on /var/tmp after a reboot?
> 
> 

 

Not after reboot, but during the first compilation. Anyway - no worries.

----------

## splurben

Thank you gorkypl

I will repost here if I find space limitations with this method.

Currently, with 16GB RAM, I am going fine with the following lines in my FSTAB:

```
tmpfs     /var/tmp/portage     tmpfs     size=7G     0 0

tmpfs     /tmp                 tmpfs     size=1G     0 0
```

----------

