NFS directs to the wrong shared folder

Hi,
I have setup an NFS server to share two media folders on my OpenSuse 12.2 system for playing media files on my raspberry Pi (client). I used the Yast module. One folder is on a hard disk mounted at /Data-1 and the second folder is in my home directory. The output of cat /etc/exports:

/Data-1/Films2  192.168.0.100(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.101(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.102(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.103(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.1/24(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.105(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
/home/stephan/Films     192.168.0.100(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.101(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.102(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.103(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.1/24(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 192.168.0.105(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure) 

When I mount the first folder (/Data-1/Fims2) from the client (using qputty) all is well. When I try to mount the second folder from the client, the contents displayed in the folder is that of the first folder. . . .
The commands used to mount the different folders:

sudo mount -v 192.168.0.102:/Data-1/Films2 /FimsPi2
sudo mount -v 192.168.0.102:/home/stephan/Films /FilmsPi

It makes no difference which folder I mount first, the only folder that is ever displayed is the folder /Data-1/Films2.
my etc/fstab has the following contents:

/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part2 swap                 swap       defaults              0 0
/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part5 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part6 /home                ext4       defaults              1 2
/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KPB21283-part1 /windows/C           ntfs-3g    users,gid=users,fmask=133,dmask=022,locale=en_US.UTF-8 0 0
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
/dev/disk/by-id/ata-SAMSUNG_HD204UI_S2H7JD2Z904488-part1 /Data-1              ext4       defaults              1 2

some more output from the server side that might help:

rpcinfo -p localhost
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp  49077  mountd
    100005    1   tcp  42682  mountd
    100005    2   udp  59352  mountd
    100005    2   tcp  49038  mountd
    100005    3   udp  49557  mountd
    100005    3   tcp  60968  mountd
    100024    1   udp  34660  status
    100024    1   tcp  58939  status
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl
    100021    1   udp  60047  nlockmgr
    100021    3   udp  60047  nlockmgr
    100021    4   udp  60047  nlockmgr
    100021    1   tcp  38896  nlockmgr
    100021    3   tcp  38896  nlockmgr
    100021    4   tcp  38896  nlockmgr

and from the client side:

sudo rpcinfo -p localhost
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100024    1   udp  53070  status
    100024    1   tcp  35720  status
    100021    1   udp  58577  nlockmgr
    100021    3   udp  58577  nlockmgr
    100021    4   udp  58577  nlockmgr
    100021    1   tcp  41332  nlockmgr
    100021    3   tcp  41332  nlockmgr
    100021    4   tcp  41332  nlockmgr


Does anyone have any idea how tho solve this so I can watch all my movies -:slight_smile:

Thanks for the help,
Regards,
Stephan

My server system:
Linux 3.4.11-2.16-desktop x86_64
openSUSE 12.2 (x86_64)
KDE: 4.8.5 (4.8.5) “release 2”

My client system:
raspberry Pi running openelec, raspbian Wheezy and Xbian

Sounds like a permissions problem of trying to share /home. I have heard that the UID and GID values must match. So, identical user setups on each system. I suggest and always share folders outside of the /home area as you do with /Data-1/Films2. Put all of your videos there and you should be fine. I would suggest using this for your fstab file, but the reason is not related to your NFS problem.

/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part2 swap                 swap       defaults,noatime              0 0
/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part5 /                    ext4       acl,user_xattr,noatime        1 1
/dev/disk/by-id/ata-WDC_WD20EARX-00PASB0_WD-WCAZA8905424-part6 /home                ext4       defaults,noatime              1 2
/dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1KPB21283-part1       /windows/C           ntfs-3g    defaults,noatime              0 0
/dev/disk/by-id/ata-SAMSUNG_HD204UI_S2H7JD2Z904488-part1       /Data-1              ext4       defaults,noatime              1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

For easy edits of the fstab file, have a look here: https://forums.opensuse.org/blogs/jdmcdaniel3/sysedit-system-file-editor-version-1-00-60/

Thank You,

Hi jdmcdaniel3,

Thanks for the reply. Can it be something else than a permission problem?

Sounds like a permissions problem of trying to share /home. I have heard that the UID and GID values must match. So, identical user setups on each system.

That seems odd. When there would be a permission problem, it should give an error. I would not expect it to take initiative to just share another folder than requested.

I suggest and always share folders outside of the /home area as you do with /Data-1/Films2. Put all of your videos there and you should be fine.

Too bad, that disk is full :slight_smile:

I would suggest using this for your fstab file, but the reason is not related to your NFS problem.

Well, it is the default OpenSuse setup. . . . apart from automounting an extra hdd at /Data-1. Since I really know nothing about this fstab stuff and it does not appear to be related to my NFS problem I will stay away from it for now.

Regards,
Stephan

On 2012-12-08 21:16, Stephan1001 wrote:
> My client system:
> raspberry Pi running openelec, raspbian Wheezy and Xbian

I would try to import those shares inside the server machine, to test it.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Hi Carlos,
Following your suggestion, I made directory ~/test and mounted the directory ~/Films like this:

sudo mount -v 192.168.0.102:/home/stephan/Films /home/stephan/test

It showed the following output in the terminal:

mount.nfs: timeout set for Sun Dec  9 23:27:01 2012
mount.nfs: trying text-based options 'vers=4,addr=192.168.0.102,clientaddr=192.168.0.102'
mount.nfs: mount(2): Protocol not supported
mount.nfs: trying text-based options 'addr=192.168.0.102'
mount.nfs: prog 100003, trying vers=3, prot=6
mount.nfs: trying 192.168.0.102 prog 100003 vers 3 prot TCP port 2049
mount.nfs: prog 100005, trying vers=3, prot=17
mount.nfs: trying 192.168.0.102 prog 100005 vers 3 prot UDP port 58257

After entering the directory ~/test it shows the content of /Data-1/Films2 instead of the content from /home/stephan/Films. I’m afraid I’m stuck :frowning: .

regards,
Stephan

When I export some folder on a separate partition, like your Data-1, I get the same host options, but when I share a folder in my home I don’t see the fsid and crossmnt options. Could they be hurting something?

Hi Knurpht,

I just deleted the /Data-1/Films2 folder from my NFS server. When I now use the same command ( sudo mount -v -t nfs 192.168.0.102:/home/stephan/Films /home/stephan/test) it actually shows the content of /home/stephan/Films !!!
This leads me to believe that there is no permission problem and the folder is shared OK. However, the server must be messing up the path when a share is requested. Or there is something strange going on when sharing two folders from different partitions?

Still clueless,
Regards,
Stephan

I export 8 partitions from 5 disks, NFS doesn’t care about that¸ it exports a path on the server it’s running on. As long as it’s mounted you can even export folders on a USB device, no problem.

On 2012-12-09 22:36, Stephan1001 wrote:
> After entering the directory ~/test it shows the content of
> /Data-1/Films2 instead of the content from /home/stephan/Films. I’m
> afraid I’m stuck :frowning: .

Please, continue tests on the server only, it takes other unknowns out
of the problem.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

On 2012-12-09 23:16, Knurpht wrote:
> I export 8 partitions from 5 disks, NFS doesn’t care about that¸ it
> exports a path on the server it’s running on. As long as it’s mounted
> you can even export folders on a USB device, no problem.

I don’t understand the options used.

 >   /Data-1/Films2
192.168.0.100(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
192.168.0.101(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
192.168.0.102(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
192.168.0.103(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
192.168.0.1/24(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)
192.168.0.105(fsid=0,crossmnt,ro,all_squash,sync,no_subtree_check,insecure)

crossmnt?


>       crossmnt
>               This  option is similar to nohide but it makes it possible for clients to move from the filesystem marked with crossmnt to exported filesystems
>               mounted on it.  Thus when a child filesystem "B" is mounted on a parent "A", setting crossmnt on "A" has the same effect as setting "nohide" on

>        nohide This option is based on the option of the same name provided in IRIX NFS.  Normally, if a server  exports  two  filesystems  one  of  which  is
>               mounted  on  the other, then the client will have to mount both filesystems explicitly to get access to them.  If it just mounts the parent, it
>               will see an empty directory at the place where the other filesystem is mounted.  That filesystem is "hidden".

I’m not in mint condition tonight, but can this be related?


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Stephan1001 wrote:
> Knurpht;2509786 Wrote:
>> When I export some folder on a separate partition, like your Data-1, I
>> get the same host options, but when I share a folder in my home I don’t
>> see the fsid and crossmnt options. Could they be hurting something?
>
> Hi Knurpht,
>
> I just deleted the /Data-1/Films2 folder from my NFS server. When I now
> use the same command ( sudo mount -v -t nfs
> 192.168.0.102:/home/stephan/Films /home/stephan/test) it actually shows
> the content of /home/stephan/Films !!!
> This leads me to believe that there is no permission problem

No, I don’t believe this has anything to do with permissions.

> folder is shared OK. However, the server must be messing up the path
> when a share is requested. Or there is something strange going on when
> sharing two folders from different partitions?

Exporting multiple folders from multiple partitions is just fine. I do
it all the time. But I have never used nohide and I’ve never even heard
of crossmnt. If the mounts are nested, I always do separate explicit
mounts on the clients. So I think there are various things worth trying:

(1) Remove the crossmnt options

(2) remove the fsid=0 optins. I have never had to use it, so I suspect
it is not necessary. It looks like having two identical is wrong, they
must all be different. I expect that is why you see the same filesystem.

(3) Your server doesn’t use NFS 4, I think. Your client may be trying to
use it. Explicitly specific NFS 3 in your mount.

On 2012-12-09 23:06, Stephan1001 wrote:
> I just deleted the /Data-1/Films2 folder from my NFS server. When I now
> use the same command ( sudo mount -v -t nfs
> 192.168.0.102:/home/stephan/Films /home/stephan/test) it actually shows
> the content of /home/stephan/Films !!!

Weird.

Show the output of “mount” on the server.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Hi djh-novel,

The options fsid=0 and crossmnt are default when creating a v4 server with the wizard. I deleted the NFS server and re-created it without the NFS-v4 box ticked. The options are now gone and guess what: on the server I can import the folders without a problem! It works!
My conclusions:

  1. The crossmnt or fsid=0 are probably guilty
  2. don’t use NFS-v4 with the default options. . . . .(wizard is broken?)
    I also wonder what the default token
    [li] of the wizard means. Does that mean you are sharing the folder with the entire web? That would be a strange default, especially without any warning. [/li]
    Haven’t tested the solution on other clients yet, but the folder mismatch appears to be gone. The exports file now looks like this:
/Data-1/Films2  192.168.0.102(ro,root_squash,sync,no_subtree_check)
/home/stephan/Films     192.168.0.102(ro,root_squash,sync,no_subtree_check)

Thanks for helping me out guys!

Cheers,
Stephan

  • indeed means “the whole world”, but in most cases this means local network, assuming that a network includes a firewalled gateway to the internet.

On 2012-12-10 22:46, Stephan1001 wrote:

> The options fsid=0 and crossmnt are default when creating a v4 server
> with the wizard. I deleted the NFS server and re-created it without the

It would have been interesting to simply delete those two options. Or
better, change the number on each fsid.


Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)

Hi,I just want to share my situation with you, as this thread helped me in feeling that I am not alone with this problem.
I have no real solution or answer unfortunately.That was the situation before the problem occured:one central QNAP server with nfs shares exported (/Multimedia, /office)two PC ubuntu 12.04 nfs clients that each mount from those exports several folders (/Multimedia/Pictures to /home/userX/Pictures, /Multimedia/Music to /home/userX/Music, /Multimedia/Videos to /home/userX/Videos, /office/usera to /home/usera/Documents, /office/userb to /home/userb/Documents)Everything worked very fine.Now I changed the situation by installing a vu+duo2 nfs client into this network mounting the folder /Multimedia/vuduo2.From now on, I had the issue that on my both ubuntu PCs ALL the different mount points did show only the content from /Multimedia. On the PCs mtab looked as normal as before, /proc/mounts/ looked as normal as before. On the qnap /etc/exports looked normal like before. But I could not even unmount the folders as the error “not found in /proc/mounts” occured when I tried to.I systematically found out, that whenever the vu+duo2 had mounted the nfs export afterwards the PCs got pointed to the wrong share. Restarting the nfs service on the QNAP or deleting the content from the rmtab file on the QNAP made it possible to mount correctly again.I configured the QNAP to not provide nfsv4 but nothing changed.I checked all export and mount parameters (like hide, crossmount, fsid) to be ok. So I still have no clue what the problem was.My solution now is a workaround: the vu+duo2 mounts the share by cifs and not by nfs. Now everything is fine again.If anybody has any idea on what does cause that one nfs client can confuse the nfs server so that other nfs clients cannot mount the share corectly I am glad to here them :slight_smile:

sorry the formatting is …

Hi,
I just want to share my situation with you, as this thread helped me in feeling that I am not alone with this problem.

I have no real solution or answer unfortunately.

That was the situation before the problem occured:

one central QNAP server with nfs shares exported (/Multimedia, /office)
two PC ubuntu 12.04 nfs clients that each mount from those exports several folders (/Multimedia/Pictures to /home/userX/Pictures, /Multimedia/Music to /home/userX/Music, /Multimedia/Videos to /home/userX/Videos, /office/usera to /home/usera/Documents, /office/userb to /home/userb/Documents)

Everything worked very fine.

Now I changed the situation by installing a vu+duo2 nfs client into this network mounting the folder /Multimedia/vuduo2.

From now on, I had the issue that on my both ubuntu PCs ALL the different mount points did show only the content from /Multimedia.
On the PCs mtab looked as normal as before, /proc/mounts/ looked as normal as before. On the qnap /etc/exports looked normal like before. But I could not even unmount the folders as the error “not found in /proc/mounts” occured when I tried to.

I systematically found out, that whenever the vu+duo2 had mounted the nfs export afterwards the PCs got pointed to the wrong share.
Restarting the nfs service on the QNAP or deleting the content from the rmtab file on the QNAP made it possible to mount correctly again (reboot PC).

I configured the QNAP to not provide nfsv4 but nothing changed.
I checked all export and mount parameters (like hide, crossmount, fsid) to be ok.

So I still have no clue what the problem was.

My solution now is a workaround:
the vu+duo2 mounts the share by cifs and not by nfs. Now everything is fine again.

If anybody has any idea on what does cause that one nfs client can confuse the nfs server so that other nfs clients cannot mount the share corectly I am glad to here them :slight_smile:

laberkopp wrote:
> sorry the formatting is …
>
> Hi,
> I just want to share my situation with you, as this thread helped me in
> feeling that I am not alone with this problem.

That may be but your is still a different problem. Technical issues not
personal feelings are what matters here. Please start a new thread.

Dave Howorth wrote:
> laberkopp wrote:
>> sorry the formatting is …
>>
>> Hi,
>> I just want to share my situation with you, as this thread helped me in
>> feeling that I am not alone with this problem.
>
> That may be but your is still a different problem. Technical issues not
> personal feelings are what matters here. Please start a new thread.

Actually, belay that.

You have a QNAP server, 2 PCs running Ubuntu, and a VU+ set-top box.
Where is the openSUSE? I don’t see any. I suggest posting in a support
forum for QNAP or VU+. Possibly in an Ubuntu forum but I doubt they can
help either.