# NFS mounts the wrong directory-only duplicates of one appear

## micko

Hi

I've had a Qnap NAS for couple of years now, but only recently has this problem appeared. I'm mounting 5 different directories from NAS to Gentoo. Here's what the NAS shares:

```
/etc/exports

"/share/HDA_DATA/Backup1" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/Kuunappi1" *(rw,async,no_root_squash,insecure) 

"/share/HDB_DATA/Kuunappi2" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/Public" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/Qdownload" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/Qweb" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/Tiin" *(rw,async,no_root_squash,insecure) 

"/share/HDA_DATA/svn" *(rw,async,no_root_squash,insecure)
```

HDA_DATA and HDB_DATA are different discs. On Gentoo I have this:

```
/etc/fstab

...

kuunappi:/share/HDA_DATA/Kuunappi1               /media/kuunappi1        nfs     defaults,user    0 0

kuunappi:/share/HDB_DATA/Kuunappi2               /media/kuunappi2        nfs     defaults,user    0 0

kuunappi:/share/HDA_DATA/Qweb                    /media/Qweb             nfs     defaults,user    0 0

kuunappi:/share/HDA_DATA/Qdownload               /media/Qdownload        nfs     defaults,user    0 0

kuunappi:/share/HDA_DATA/Backup1                 /media/Backup1          nfs     defaults,user    0 0

...

```

Everything seems to be alright but no. What I get is duplicates of Backup1 to every mountpoint.

```
/proc/mounts

...

kuunappi:/share/Backup1 /media/kuunappi1 nfs

rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=39159,mountproto=udp,local_lock=none,addr=10.0.0.3 0 0

kuunappi:/share/Backup1 /media/kuunappi2 nfs

rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=39159,mountproto=udp,local_lock=none,addr=10.0.0.3 0 0

kuunappi:/share/Backup1 /media/Qdownload nfs

rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=39159,mountproto=udp,local_lock=none,addr=10.0.0.3 0 0

kuunappi:/share/Backup1 /media/Qweb nfs

rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=39159,mountproto=udp,local_lock=none,addr=10.0.0.3 0 0

kuunappi:/share/Backup1 /media/Backup1 nfs

rw,relatime,vers=3,rsize=32768,wsize=32768,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,mountaddr=10.0.0.3,mountvers=3,mountport=39159,mountproto=udp,local_lock=none,addr=10.0.0.3 0 0
```

It looks like it mounts the last one on fstab to every mountpoint. I've tried adding noauto-option on fstab and making the mounts on a script run on startup but no help. If I manually type the mount commands, everything works.

I'm inclined to believe that the problem is with Gentoo since everything works on Ubuntu and Debian which are on the same computer. The lines on fstab are identical.

Any ideas?

----------

## laberkopp

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  :Smile: 

----------

## laberkopp

Here I found the solution:

http://forum.qnapclub.de/viewtopic.php?f=35&t=22107

you have to mount the share exactly as the qnap share names.

You can get the right share names with

showmount -e <qnap>

----------

