homes nullfs mounted in jail, but empty

Hi,

On my home server ...
Code:
FreeBSD termite 9.0-RELEASE-p2 FreeBSD 9.0-RELEASE-p2 #1: Sat Jun  2 01:09:13 CEST 2012     root@termite:/usr/obj/usr/src/sys/GENERIC  amd64

I have each of my home-Directories stored on a separate ZFS filesystem.
Code:
ztank/storage/home         1.64M  1.25T   224K  /usr/home
ztank/storage/home/hmk      618K  1.25T   501K  /usr/home/hmk
ztank/storage/home/jg       341K   300G   234K  /usr/home/jg
ztank/storage/home/rwa      373K   300G   245K  /usr/home/rwa

The files stored in each home are fully available.
Code:
# ls -l /usr/home/jg/
total 48
-rw-r--r--  1 jg  jg  763 Sep 29 10:28 .cshrc
-rw-r--r--  1 jg  jg  261 Sep 29 10:28 .login
-rw-r--r--  1 jg  jg  171 Sep 29 10:28 .login_conf
-rw-------  1 jg  jg  383 Sep 29 10:28 .mail_aliases
-rw-r--r--  1 jg  jg  343 Sep 29 10:28 .mailrc
-rw-r--r--  1 jg  jg  757 Sep 29 10:28 .profile
-rw-------  1 jg  jg  288 Sep 29 10:28 .rhosts
-rw-r--r--  1 jg  jg  982 Sep 29 10:28 .shrc

So far everything works but I also have the /usr/home-filesystem rw-mounted (through nullfs) in one of my jails (the one serving Samba).

/etc/fstab.samba:
Code:
[...]
/usr/home /usr/local/jails/samba/usr/home nullfs rw,noatime 0 0
[...]

As long as the jail is not running this is not mounted (as intended) and the nullfs-mountpoint is empty.
Code:
# ls -l /usr/local/jails/samba/usr/home/
total 0

After starting the jail /usr/home is mounted and listing it within the jail shows all the subdirectories (ZFS filesystems) in it. So far this also works as intended.
Code:
# mount | egrep 'samba/usr/home'
/usr/home on /usr/local/jails/samba/usr/home (nullfs, local, noatime)
Code:
samba# ls -l /usr/home/
total 33
drwxr-xr-x  2 hmk  hmk  2 Sep 29 11:47 hmk
drwxr-xr-x  2 jg   jg   2 Sep 29 10:27 jg
drwxr-xr-x  2 rwa  rwa  2 Sep 29 09:49 rwa

But when I list the content of each home directory itself I get an empty diretory:
Code:
samba# ls -l /usr/home/jg/
total 0
The home diretories are also empty when I list that directory from outside the jail (when the jail is running):
Code:
termite# ls -lR /usr/local/jails/samba/usr/home/
total 33
drwxr-xr-x  2 hmk  hmk  2 Sep 29 11:47 hmk
drwxr-xr-x  2 jg   jg   2 Sep 29 10:27 jg
drwxr-xr-x  2 rwa  rwa  2 Sep 29 09:49 rwa

/usr/local/jails/samba/usr/home/hmk:
total 0

/usr/local/jails/samba/usr/home/jg:
total 0

/usr/local/jails/samba/usr/home/rwa:
total 0

I don't understand why I get an empty directory here, since all files are available from the home servers shell. But in the "same" nullfs-mounted directories, the subdirectories available but empty. Where is my mistake in this setup?

Thanks in advance for any help.
 
skaven said:
Hi,

I have each of my home-Directories stored on a separate ZFS filesystem.
Code:
ztank/storage/home         1.64M  1.25T   224K  /usr/home
ztank/storage/home/hmk      618K  1.25T   501K  /usr/home/hmk
ztank/storage/home/jg       341K   300G   234K  /usr/home/jg
ztank/storage/home/rwa      373K   300G   245K  /usr/home/rwa

I don't understand why I get an empty directory here, since all files are available from the home servers shell. But in the "same" nullfs-mounted directories, the subdirectories available but empty. Where is my mistake in this setup?

I think you have to nullfs mount /usr/home/(hmk,jg,rwal) into your destination also, not only /usr/home because they are different filesystems.

Regards.
 
Back
Top