Re: autofs + default /net map + NFS4 — how to?

Lev Serebryakov lev at
Thu May 13 21:44:26 UTC 2021

On 13.05.2021 23:59, Rick Macklem wrote:

> You can do the exports lines without "-network..." and then they apply to all subnets.
> Not recommended unless you have an external firewall/nat gateway that is blocking
> incoming traffic to port#2049.

  I have different settings (-maproot) for different subnets (both IPv4 and IPv6), not shown (snipped) here for brevity.

  There is ZFS inheritable property which could be set to the root of FS hierarchy ("/usr/home" and "/usr/ports" in my case), which saves a lot of repetition, but it could be only single-line, so it is not applicable for multiple networks :-( There were patches, but all of them were declined as "incompatible with other systems".

> I know nothing about autofs and never use it. (/etc/fstab is your friend;-)

  Not on Laptop which could see server 50% of the time. It could be "noauto" mounts, but then you need root to mount them and you need to unmount them before leaving home with laptop, or you could have bad and long timeouts later.

> I suspect changing your V4: lines to specify "/" may work around this, since the
> mount paths then look the same as for NFSv3.

  And exporting "/" via NFSv3 lines too, as "V4" is only addition to "classic" export lines, and will not work if it will point to non-exported FS.

  To be honest, I don't understand why NFS export is done on local file system basis, not arbitrary local subtree, on one or several FSes, in 2021.
  Maybe, it was useful in 1984, but now samba could export any subtree, crossing local FS boundaries or not, from root or from any point in tree.
  Why NFSv4 server could not do the sameand need to explicitly export each FS in hierarchy?! With ZFS we could have very deep hierarchies.
  To be honest, I've wanted to add "${HOME}/archive" (for different snapshot retention policy) to each user homedir at one moment in time, but then decided that it is too much, to add twice more lines to /etc/exports.

// Lev Serebryakov

More information about the freebsd-fs mailing list