Linux – NFS exporting a directory that’s already NFS mounted (on the server)

linuxnfs

I have a NFS server, A, that's sharing out a folder. B is mounting the the folder. B is also sharing that folder out. However C is unable to mounted it. The error on C is:

mount.nfs: 192.168.0.1:/export/myfolder failed, reason given by server: Permission denied

And on B the error in /var/log/messages is

Aug 17 15:21:21 B mountd[26140]: authenticated mount request from 192.168.0.200:1010 for /export/myfolder (/export/myfolder)
Aug 17 15:21:21 B mountd[26140]: Cannot export /export/myfolder, possibly unsupported filesystem or fsid= required

/etc/fstab on C:

192.168.0.1:/export/myfolder /mnt/myfolder   nfs  defaults,nodev,rsize=32768,wsize=32768,nfsvers=3   0       0

/etc/exports on B:

/export/myfolder        192.168.0.0/24(sync,rw,no_root_squash,fsid=200908180957)

I've added the fsid argument to the exports, but still the same problem occures,

Best Answer

I'm curious why you wouldn't just want to share it from A (a network tunnel is much easier to configure) but in general you'll have a problem supporting both an nfs server and an nfs client on the same machine.

To fix your immediate problem, there's probably two things you can do. The first is to make sure that you're specifying an fsid other than 0 or whatever your fsid is set to on A. Second, since it looks like you might be using nfs4, have you mounted via a bind the volume into /exports, or is that a direct nfs mount of A's exported directory?

In my opinion, doing it this way looks like a major recipe for a failure and/or split brain condition when A and B get disconnected. You will probably also have permission and locking issues. It's REALLY not a good idea to do it this way.