2

I'm running an NFS server with two exports:

/mnt/sda1 192.168.1.254/255.255.255.0(rw,fsid=1,no_subtree_check,all_squash,anonuid=0,anongid=0,insecure)
/mnt/sdb1 192.168.1.254/255.255.255.0(rw,fsid=1,no_subtree_check,all_squash,anonuid=0,anongid=0,insecure)

On the server if I cd to either directory they are clearly very distinct drives.

/dev/sda1                 1.8T      1.7T      8.6G 100% /mnt/sda1
/dev/sdb1                 2.0T      1.3T    603.9G  68% /mnt/sdb1

However if I mount these nfs shares on a client, it seems that mounting /mnt/sdb1 points to /mnt/sda1 directly.

sudo mount 192.168.1.123:/mnt/sdb1 /media/test

Then on the client with df -h

192.168.1.123:/mnt/sdb1                   1.8T  1.7T  8.6G 100% /media/test

As you can see above based even on storage space alone, this is actually /mnt/sda1.

This server has been running a long time and I faintly recall ~5 years ago I was playing with lvm disk managing stuff (but never got it working) and may have configured something that is resulting in this weird behaviour - but I'm not sure. I'm not even really sure where to begin as this is a hard behaviour to google. Help is appreciated!

1 Answer 1

3

I am making an educated guess here: this behaviour is probably being caused by the fsid=1 option on both exports.

According to the exports manpage, the fsid option is used to identify a filesystem:

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.

The /mnt/sda1 export is likely taking priority because it is earlier in the exports file (i.e. it is mapped to fsid=1 first).

If the above assumptions hold true, the solution to the problem should be straightforward: simply assign a different fsid to the /mnt/sdb1 export.

1
  • Thank you! This worked by changing fsid=2 to the second drive! much appreciated.
    – jparanich
    Dec 20, 2021 at 20:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .