NFS mounting incorrect NFS export

  • 7010672
  • 23-Aug-2012
  • 10-May-2013

Environment

SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10

Situation

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. Sometimes only one NFS export will mount, even when others are defined. The /etc/exports follows.

# /etc/exports
/exports/test1  *(rw,sync,insecure,root_squash,no_subtree_check,fsid=25)
/exports/test2  *(fsid=25,wdelay,rw,sync,insecure,root_squash,no_subtree_check)

Resolution

Edit the /etc/exports file and change the fsid=25 on one of the entries to a unique value, like fsid=26. The corrected /etc/exports file may look like:

# /etc/exports
/exports/test1  *(rw,sync,insecure,root_squash,no_subtree_check,fsid=25)
/exports/test2  *(fsid=26,wdelay,rw,sync,insecure,root_squash,no_subtree_check)

Note that different paths should have different fsids.  If it is the same path specified separately for 2 different clients, those fsids can (and should) be the same.  An fsid can be set anywhere from 0 - 255.  However, 0 has special meaning for NFS v4, so if you are using NFS v4, only use fsid=0 on the top (fake root) of the export hierarchy.

Cause

There are duplicate fsid= values in the NFS exports. The fsid= values must be unique. From exports(5):

fsid=num|root|uuid
NFS needs to be able to identify each filesystem that it exports.  Normally it will use a UUID for the filesystem (if the filesystem has such a thing) or  the device number of the device holding the filesystem (if the filesystem is stored on the device).

As  not all filesystems are stored on devices, and not all filesystems have UUIDs, it is sometimes necessary to explicitly tell NFS how to identify a filesystem.  This is done with the fsid= option.

For NFSv4, there is a distinguished filesystem which is the root of all exported filesystem.  This is specified with fsid=root or fsid=0 both  of  which  mean exactly the same thing.

Other filesystems can be identified with a small integer, or a UUID which should contain 32 hex digits and arbitrary punctuation.

Linux  kernels  version  2.6.20 and earlier do not understand the UUID setting so a small integer must be used if an fsid option needs to be set for such kernels.  Setting both a small number and a UUID is supported so the same configuration can be made to work on old and new kernels alike.

Feedback service temporarily unavailable. For content questions or problems, please contact Support.