Linux의 Cifs 마운트 하위 디렉터리

Linux의 Cifs 마운트 하위 디렉터리

동일한 공유 이름으로 두 개의 하위 디렉터리를 마운트하려고 하는데 작동하지 않습니다.

# 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
<nothing>

smbclient를 사용하여 다양한 하위 폴더에 대한 액세스를 확인했으며 예상한 결과를 얻었습니다.

하나가 아닌 두 개의 별도 마운트 지점을 갖는 이유는 공유 자체에는 액세스할 수 없고 하위 폴더에만 액세스할 수 있기 때문입니다.

답변1

문제를 깊이 이해하려면 --verbose옵션을 사용하여 마운트해 보십시오.

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

문제의 가능한 원인은 잘못된 inode 번호 또는 캐시일 수 있습니다. inode 번호 지정 문제에 대한 해결 방법으로 다음 옵션 중 하나를 시도해 보십시오.

--serverino
--noserverino

또한 다른 캐싱 방법(다음 중 하나)을 시도해 보세요.

--cache=none
--cache=strict
--cache=loose

읽다mount.cifs(8)또한.

관련 정보