I am trying to mount two subdirectories from the same share name but cannot get it to work.

# Mount the two different subfolders:
# $server and $share are the same - the subfolder differs:
$ subfolderA=a/b/c
$ subfolderB=x/y/z
$ mount -t cifs //$server/$share/$subfolderA /mnt/dirA
$ mount -t cifs //$server/$share/$subfolderB /mnt/dirB

# Traverse the directories - I see the same file in both directories (should only be be in dirA)
$ find /mnt/dir[AB] -name fda.txt -ls
707409139 1024 -rwxr-xr-x   1 root     root           15 May 28 08:50 /mnt/dirA/fda.txt
707409139 1024 -rwxr-xr-x   1 root     root           15 May 28 08:50 /mnt/dirB/fda.txt

# Mount in opposite order:
$ umount /mnt/dirA
$ umount /mnt/dirB
$ mount -t cifs //$server/$share/$subfolderB /mnt/dirB
$ mount -t cifs //$server/$share/$subfolderA /mnt/dirA

# Traverse the directories - I do not see the file fda.txt at all
$ find /mnt/dir[AB] -name fda.txt -ls

I have verified my access to the different subfolders using smbclient and it gives me the expected results.

The reason for having two separate mounts instead of just one, is because I do not have access to the share itself, but only to the subfolders.

  • To understand the problem try to mount with --verbose option, i.e.: mount -t cifs //$server/$share/$subfolderB /mnt/dirB --verbose – Bob Aug 15 '18 at 7:41

To understand the problem deeply, try to mount with --verbose option, i.e.

mount -t cifs //$server/$share/$subfolderB /mnt/dirB --verbose

The possible reasons of the problem can be wrong inode numbers or caching. As workaround for the inode numbers problem try this options (one of them):


Also try different caching methods (one of them):


Read mount.cifs(8) additionally.

| improve this answer | |
  • Well, the --verbose and the suggested options does reveal anything nor does it help. The first mount group with --verbose: ip=,unc=\\\share,user=username,prefixpath=a/b/c,pass=******** ip=,unc=\\\share,user=username,prefixpath=x/y/z,pass=******** The second mount group with --verbose: ip=,unc=\\\share,user=username,prefixpath=x/y/z,pass=** ip=,unc=\\\share,user=username,prefixpath=a/b/c,pass=** – S.Olesen Aug 15 '18 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.