Ubuntu – ZFS on Linux denied access when accessing child dataset on NFS

nfsUbuntuubuntu-12.04zfszfsonlinux

This is on 12.04 LTS with the latest ZFS on Linux from the ppa.

I have two a storage pool named data, and a dataset data/Other with different settings (e.g. compression).

I set data to sharenfs and data/Other to inherit sharenfs from data.

From machines, I'd like to be able to mount data and see into data/Other, but I don't have permission to. How can I set it to inherit nfs permissions?

Steps:

  • created zpool data
  • created dataset data/Other
  • installed nfs server
  • set sharenfs
  • set sharesmb on.
  • mounted nfs on other computers with my uid/gid

To clarify, I can mount data and see r/w everything in data fine. I cannot read data/Other. I can mount data/Other directly and r/w everything in there fine. What I'd like is to be able to r/w data/Other from just mounting just data.

If I force nfs version 4 on the linux client side, I do get access, but from windows I can only use version 3.

Best Answer

access denied on the child from the parent mount

sounds very much like what is explained in https://blog.programster.org/sharing-zfs-datasets-via-nfs (emphasis from original):

it is very easy to split your "pool" into as many datasets as you like. Each dataset is treated like its own filesystem, with its own rules and settings, which means with regards to sharing over NFS, that you can share more securely as client's will not be able to reach out of the bounds of that dataset/filesystem that you decided to share.

An important thing to bear in mind is that you will need to run the steps below for sharing on every pool/dataset that you wish to share, no matter the hierarchy. For example, if you have a dataset that is the parent of another, you would still have to set up sharing on that child if you wanted it to be shared, even if you have already set up sharing on the parent.

This might also be interesting for other people, who come here from a search engine.