# jail nullfs question



## wonslung (Jun 16, 2009)

is there anyway to make nullfs mounts stay current?

like....let's say i have a folder /mnt/stuff
and i use nullfs to mount it on /usr/jails/ftpjail/stuff
it seems everything that is in the folder at the time of it being mounted shows up from the nullfs mount but anything added to the folder AFTER that doesn't seem to show up.

is there anway to fix this?


----------



## SirDice (Jun 16, 2009)

Are you sure you mounted correctly? 

I use nullfs quite a lot and I never have that issue.


----------



## richardpl (Jun 16, 2009)

Have you read man page, do you understand english?
Maybe you are looking for mount_unionfs?


----------



## vivek (Jun 16, 2009)

You need to mount it correctl. Here is what I put in fstab:

```
/usr/jails/foo /jails/smtpd/foo nullfs ro 0 0
```


----------



## wonslung (Jun 17, 2009)

richardpl said:
			
		

> Have you read man page, do you understand english?
> Maybe you are looking for mount_unionfs?




yes, i did, and i do.


----------



## wonslung (Jun 17, 2009)

vivek said:
			
		

> You need to mount it correctl. Here is what I put in fstab:
> 
> ```
> /usr/jails/foo /jails/smtpd/foo nullfs ro 0 0
> ```



that is EXACTLY what mine looks like.

I did it in a file per jail fstab (/etc/fstab.jailname)
the original directory is a download directory for torrents, the mounted one is an ftp directory inside a different jail.  Perhaps it's a problem with ZFS considering this is all on zfs but for some reasons files that are added after the time of mount don't seem to show up in the ftp jail.


----------



## wonslung (Jun 17, 2009)

i'm wondering now if i need to add an fstab entry for the every folder that is it's own zfs filesystem.
one of the reasons i use zfs is because of the quota and reservation limits you can set...i'll try adding them and report back...

i'm pretty sure it is zfs causing the issue.


edit:

ok, it is defendant zfs causing the issue.  Apparently the zfs directory structure doesn't automatically conform to the normal one, i'm sure it's something to do with the way zfs handles mount points
for instance, i've done something like this:

```
zfs create tank/foo
zfs create tank/foo/bar
zfs create tank/foo/bar2
zfs create tank/foo/bar2/woo
zfs set mountpoint=/usr/jails/wwwjail/foo tank/foo
```
and inside of the jail, i just go to foo and eveyrhting is there.

if i use nullfs to mount foo on another jail, it works but it doesn't preserve the directory structure.

so my question is, short of adding each new zfs mount to fstab.jail manually is there a way to mount just /usr/jails/wwwjail/foo into another jail and preserve the directory structure.


----------



## wonslung (Jun 18, 2009)

so does anyone know of a way to mount a zfs filesystem and all it's children recursively in 2 jails?
is it even possible short of manually mounting each child filesystem with fstab.jail?


----------

