NFS mounting incorrect NFS export

Author: Stephan  |  Category: Linux, Netzwerk

Symptom

There are two NFS exports in the /etc/exports file on the NFS server. Regardless of which export is mounted, only the first export actually gets mounted.

The /etc/exports looks like this

#cat /etc/exports
/exports/export1 *(rw,sync,insecure,root_squash,no_subtree_check,fsid=0)
/exports/export2 *rw,sync,insecure,root_squash,no_subtree_check,fsid=0)

Solution

Reason for this stange behaviour is the Duplicate fsid setting. You can only have one fsid=0 per NFS Server. Change the second fsid to a small integer and everything is working as designed

# cat /etc/exports
/exports/export1 *(rw,sync,insecure,root_squash,no_subtree_check,fsid=0)
/exports/export2 *rw,sync,insecure,root_squash,no_subtree_check,fsid=1)