tmpfs in a jail

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
 
It should work fine on 9.x too. Poudriere makes heavy use of it.
 
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.
 
Explain the sequence of steps you used to enable tmpfs inside of a jail. Maybe you’re just doing it in wrong order.
 
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
 
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.
 
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
 
Back
Top