openzfsonosx / zfs

OpenZFS on OS X

Home Page:https://openzfsonosx.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Datasets appear as empty when shared through NFS

monroo opened this issue · comments

Hi all,

I was trying to create a couple of NFS shares on my file server and failing miserably. After hours of trial and error I noticed that if I share a dataset directly it appears as an empty folder on client but if I share a subdirectory of the same dataset all works as expected.

I will try and elaborate a little:

My test setup is macOS v10.15.5, OoX 1.9.4 on the server and Ubuntu Mate 20.04 on the client. Zpool has “com.apple.ignoreowner=on” all datasets and all datasets and all their subdirectories have "drwxr-xr-x" for file permissons. Also here are the zpools/zfs' flags:

NAME RECSIZE CHECKSUM COMPRESS COM.APPLE.IGNOREOWNER COM.APPLE.MIMIC_HFS
tank 128K on lz4 on off
tank/Music 128K on lz4 on off

  1. If a dataset is shared through NFS as
    #/etc/exports
    /Volumes/tank/Music -mapall=-2:-2 -ro

it can be mounted by the client but when opened, the mount point appears as an empty directory. Caja reports “Empty Space” correctly but it shows “0 Items”. More interestingly “ls” command returns an “Input/output error.” but “cd Concerts” works as expected. And when in Concerts directory "ls" command also works as expected. Please note that “tank” is the zpool, “Music” is a dataset and “Concerts” is a regular directory.

  1. If a subfolder of a dataset is shared through NFS, it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/tank/Music/Concerts -mapall=-2:-2 -ro

  2. If a regular non-zfs drive is shared through NFS, like an APFS drive, it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/VMs -mapall=-2:-2 -ro

Please note that “VMs” is a APFS formatted drive.

  1. If a regular a subdirectory on a non-zfs drive is shared through NFS. it works as expected. Gets mounted normally and mount point is browsable with both Caja and cd/ls.
    E.g.:
    #/etc/exports
    /Volumes/VMs/Linux -mapall=-2:-2 -ro

Please note that “VMs” is a APFS formatted drive and“Linux” is a regular directory.

I wrote about this in the forums and lundman advised me to open a ticket here.

I am not sure on the source of the problem and if it is related to my setup or OoX or Catalina. But I think to reproduce the problem you can create a simple Zpool and a dataset then append '/Volumes/tank/Music -mapall=-2:-2 -ro' to the /etc/exports file.

Could you update this?

If the missing files in an nfs mounted zfs datasst is still troubling you, can you please try supplying the nordirplus option to mount_nfs or mount -t nfs, or by adding nfs.client.mount.options = nordirplus to your /etc/nfs.conf ?

nordirplus

i had an issue with a large amount of zfs (on linux) datasets shared over nfs4 to another linux.
A small dir was empty, but only from a single host.

This fixed it, although the manual says its for nfs3.