# Mount tmpfs inside jail ?



## bryn1u (Aug 20, 2014)

Hey,

I need to mount tmpfs(5) inside a jail, how can I do that?  I was trying but without any results. Someone can help?


----------



## SirDice (Aug 20, 2014)

bryn1u said:
			
		

> I need to mount tmpfs(5) inside jail, how can I do that?


Mount it from the host. You can use /etc/fstab.<jailname> for it, then it'll be mounted and unmounted when the jail starts and stops.


----------



## bryn1u (Aug 20, 2014)

SirDice said:
			
		

> bryn1u said:
> 
> 
> 
> ...



F... me. It was my fault. You're right.

My /etc/fstab.games

```
linproc /jails/Games/compat/linux/proc linprocfs rw 0 0
tmpfs /jails/Games/dev/shm tmpfs rw 0 0
```

Works like a charm.
Thanks,


----------



## bagas (Jul 1, 2017)

Hello.
And how do I specify the volume for tmpfs?

```
/usr/jails/basejail /usr/jails/place_ru/basejail nullfs ro 0 0
tmpfs /usr/jails/place_ru/tmp tmpfs rw 0
```


----------



## SirDice (Jul 5, 2017)

What do you mean by volume? The size?

tmpfs(5):

```
size    Specifies the total file system size in bytes.  If zero (the
             default) or a value larger than SIZE_MAX - PAGE_SIZE is given,
             the available amount of memory (including main memory and swap
             space) will be used.
```

But it's more common to use tmpfs(5) dynamically. For a set sized RAM disk mdmfs(8) might be more appropriate.


----------

