[Solved] Only one NFS share works?


I am on v22.03.3, has NFS share enabled. Everything is working untill I add 2nd share in /etc/exports.


/mnt/sda1/ *(rw,all_squash,insecure,no_subtree_check,fsid=0)

in client pc(ubuntu 22.10), I can use the following command to mount the NFS share successfully:

sudo mount -t nfs -o vers=4 /nfs-share

Now I add another share, so the new /etc/exports:

/mnt/sda1/ *(rw,all_squash,insecure,no_subtree_check,fsid=0)
/opt/ *(rw,all_squash,insecure,no_subtree_check,fsid=0)

restart the openwrt,

root@pi4:/# showmount --exports
Export list for pi4:
/opt      *
/mnt/sda1 *

if I use the same command on client pc, NFS share mounts ok but it does not show contents from /opt/.

If I use sudo mount -t nfs -o vers=4 /nfs-opt, it fails to mount.

Any solution to get both shares working? Thanks

You should use non-duplicate fsid options.

This link describes how the fsid option relates to NFS4 and how it differs to NFS3.

Opps. I have tried to use different fsid for each share, but I used 0 and 1 instead of 1 and 2. I did not pay attention that the fsid should be 1-255.

Now I changed them to:

/mnt/sda1/ *(rw,all_squash,insecure,no_subtree_check,fsid=1)
/opt/ *(rw,all_squash,insecure,no_subtree_check,fsid=2)

It works as expected.

Thanks for your help.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.