Linux – Does an NFS export with sec=krb5 *require* that the parent directory also be exported with sec=krb5

autofskerberoslinuxnfs

I copied somebody's NFS server/client setup verbatim and am having trouble making sense of what's going on with it. This is the /etc/exports:

/export *(rw,fsid=0,crossmnt,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)
/export/home *(rw,insecure,async,no_subtree_check,sec=krb5p:krb5i:krb5)

Client machines use autofs to mount user home directories on demand. Here's auto.home:

*       -fstype=nfs4,rw,soft,sec=krb5   192.168.0.2:/home/&

This works and works well. Still, exporting /export seems unnecessary so I commented that line out of the server config. Now automounting fails on the clients.

Questions

  1. Why does /export/home require /export to also be exported?
  2. Do the security options for /export and /export/home have to be the same?
  3. Why does auto.home read 192.168.0.2:/home/& instead of 192.168.0.2:/export/home/&? It doesn't seem like that should work at all.

Best Answer

You are using NFS version 4 (nfs4) which exports a single pseudo-filesystem rather than lots of separate filesystems.

This is specified on the NFS server in /etc/exports by fsid=0, and in your case is called /export (although it could be called anything). That is why you cannot remove that line or comment it out.

On the NFS client, this parent (in your case, /export) is seen as / (the root of the exported filesystem) which is why the automounter uses /home.

Related Topic