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)



Symptom

Es sind zwei NFS exports in der /etc/exports auf dem NFS server konfiguriert. Egal, welchen Mountpoint man mounted, es wird immer der Inhalt des ersten angezeigt.

Die /etc/exports sieht folgendermassen aus

#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)

Lösung

Grund für dieses selstame Verhalten ist die identische Konfiguration für die fsid. Die fsid muss einzigartig sein.
Wenn man nun die zweite fsid in eine kleine Zahl ungleich 0 ändert dritt dieses Problem nicht mehr auf
# 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)