# tmpfs in a jail



## johng (Aug 24, 2013)

Hi,

I'm a new FreeBSD user, and so far I love the stability and cohesiveness of the system. I have a fresh install (UFS) that I am setting up as a webserver. I'm using ezjail to administer the jails. I will be using nginx with php-fpm and fast_cgi cache. Tonight I spent many hours attempting to mount a tmpfs for the cache to reside in. I was never able to mount the tmpfs. I included an entry in the host's /etc/fstab.jailname file. I attempted it within the jail. I could see the tmpfs using lsvfs, but mounting was permitted. 

I have read the man pages, searched the forums, and Google with no luck. I'm sure it's something stupid that I just looked over. 

Any ideas? I will gladly post any portions of configuration files that would be helpful. 

Thanks,
John


----------



## acheron (Aug 24, 2013)

You need a fresh CURRENT to be able to mount a tmpfs inside a jail, see http://svnweb.freebsd.org/base?view=revision&revision=254741


----------



## SirDice (Aug 26, 2013)

It should work fine on 9.x too. Poudriere makes heavy use of it.


----------



## johng (Aug 27, 2013)

I thought so as well, but I have had a difficult time finding answers in the man pages or the handbook. When I run `lsvfs`, it does not show a jail flag for tmpfs. How does one add that flag?

I assume that it is something simple that I missed somewhere. Thanks for the help.


----------



## fbsd1 (Aug 27, 2013)

Explain the sequence of steps you used to enable tmpfs inside of a jail. Maybe youâ€™re just doing it in wrong order.


----------



## johng (Sep 6, 2013)

Ok. So I have may have been misunderstanding this all along. I was checking mount and lsvfs *within* the jail. Tonight I was inspired by a previous reply to note the use of poudriere's use of tmpfs. Noticed that the host's mount showed the tmpfs, just like my attempts. Within the poudriere jail, it did not show up.

So should I be looking in the host or jail for tmpfs?

Thanks,
John Grasty


----------



## SirDice (Sep 6, 2013)

From within a jail you can't see any other filesystems besides the root filesystem unless you set enforce_statfs to 1 or 0, see jail(8). By default it's set to 2, to only show the root filesystem. Regardless of this setting any other filesystems mounted on the jail root will be accessible. It just won't show up with df, mount and a few other commands.


----------



## johng (Sep 10, 2013)

Thanks so much for the help!

I can't believe I missed that in the man pages. I guess that is what I get for reading them at 4 AM!

Thanks,
John Grasty


----------

