Sample Header Ad - 728x90

Cifs mounting subdirectories from linux

1 vote
1 answer
4845 views
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.
Asked by S.Olesen (11 rep)
Aug 15, 2018, 06:06 AM
Last activity: Apr 13, 2025, 03:06 PM