After seeing some odd behaviour with my NFS shares (http://forums.freenas.org/showthread.php?10655) I believe I have found a bug.
Child datasets under NFS sharing do not correctly write data to the ZFS dataset, rather to a normal directory.
Here is how to repeat the issue:
Create ZFS data set with child dataset, for example
/mnt/storage/test
/mnt/storage/test/testchild
Create an NFS share on the higher level /mnt/storage/test location.
Mount the NFS share, I use Ubuntu and AutoFS, but 'mount -t nfs 192.168.1.205:/mnt/storage/test /mnt/test' shows same behaviour.
Any files/folders created in the test/testchild folder do not appear when viewing the files directly from the FreeNAS shell (nor from a CIFS share which is how I found the issue).
For example from my Ubuntu server:
Then from the FreeNAS shell the TXT file does not appear:
I also copied a 'large' file into the 'testchild' folder via NFS to see if the volume used GUI updated - it did not.
Now if I delete the 'testchild' data set, and repeat the check from the FreeNAS shell, i get:
So I think that NFS is treating 'testchild' as a folder, rather than a dataset and ZFS via shell/CIFS hides this folder and uses the dataset instead.
Which with my limited knowledge means that snapshots on these child datasets will snap empty folders.
Anybody able to comment/correct my findings? I am running FreeNAS-8.3.0-RELEASE-p1-x64 (r12825) under ESXi VM.
Mark
Child datasets under NFS sharing do not correctly write data to the ZFS dataset, rather to a normal directory.
Here is how to repeat the issue:
Create ZFS data set with child dataset, for example
/mnt/storage/test
/mnt/storage/test/testchild
Create an NFS share on the higher level /mnt/storage/test location.
Mount the NFS share, I use Ubuntu and AutoFS, but 'mount -t nfs 192.168.1.205:/mnt/storage/test /mnt/test' shows same behaviour.
Any files/folders created in the test/testchild folder do not appear when viewing the files directly from the FreeNAS shell (nor from a CIFS share which is how I found the issue).
For example from my Ubuntu server:
Code:
mark@ubuntuserver:/mnt/test$ mount -l ... snip ... 192.168.1.205:/mnt/storage/test on /mnt/test type nfs (rw,addr=192.168.1.205) mark@ubuntuserver:/mnt/test$ ls -la total 38 drwxrwxr-x 3 root 1001 3 Jan 6 11:08 . drwxr-xr-x 5 root root 0 Jan 6 11:03 .. drwxr-xr-x 2 root 1001 3 Jan 6 11:09 testchild mark@ubuntuserver:/mnt/test$ cd testchild/ mark@ubuntuserver:/mnt/test/testchild$ vi from_ubuntuserver_nfs.txt mark@ubuntuserver:/mnt/test/testchild$ ls -la total 48 drwxr-xr-x 2 root 1001 3 Jan 6 11:09 . drwxrwxr-x 3 root 1001 3 Jan 6 11:08 .. -rw-rw-r-- 1 root 1001 6 Jan 6 11:09 from_ubuntuserver_nfs.txt
Then from the FreeNAS shell the TXT file does not appear:
Code:
[root@freenas] /mnt/storage/test> ls -la total 57 drwxrwxr-x 3 root media 3 Jan 6 11:08 ./ drwxr-xr-x 9 root wheel 9 Jan 6 10:59 ../ drwxrwxr-x 2 root media 2 Jan 6 11:00 testchild/ [root@freenas] /mnt/storage/test> cd testchild/ [root@freenas] /mnt/storage/test/testchild> ls -la total 38 drwxrwxr-x 2 root media 2 Jan 6 11:00 ./ drwxrwxr-x 3 root media 3 Jan 6 11:08 ../
I also copied a 'large' file into the 'testchild' folder via NFS to see if the volume used GUI updated - it did not.
Now if I delete the 'testchild' data set, and repeat the check from the FreeNAS shell, i get:
Code:
[root@freenas] /mnt/storage/test> ls -la total 57 drwxrwxr-x 3 root media 3 Jan 6 11:08 ./ drwxr-xr-x 9 root wheel 9 Jan 6 10:59 ../ drwxr-xr-x 2 root media 3 Jan 6 11:09 testchild/ [root@freenas] /mnt/storage/test> cd testchild [root@freenas] /mnt/storage/test/testchild> ls -la total 48 drwxr-xr-x 2 root media 3 Jan 6 11:09 ./ drwxrwxr-x 3 root media 3 Jan 6 11:08 ../ -rw-rw-r-- 1 root media 6 Jan 6 11:09 from_ubuntuserver_nfs.txt
So I think that NFS is treating 'testchild' as a folder, rather than a dataset and ZFS via shell/CIFS hides this folder and uses the dataset instead.
Which with my limited knowledge means that snapshots on these child datasets will snap empty folders.
Anybody able to comment/correct my findings? I am running FreeNAS-8.3.0-RELEASE-p1-x64 (r12825) under ESXi VM.
Mark