Stale file handler when mounting CIFS SMB network drive from Fritz router

Using latest Ubuntu Server: Ubuntu 20.04.1 LTS I am able to successfully mount a SMB share volume from local Fritz Box router using this command:

mount -t cifs //fritz.box/fritz.nas/wd -o rw,vers=3,username=user,password=password,workgroup=WORKGROUP

The permissions of the mount point:

drwxr-xr-x 2 root    root   

Permissions of a test file copied into the drive after mounting:

-rwxr-xr-x 1 root    root       4 Aug  7 13:05  test.txt

However when I try and view the contents of the file:

test.txt: Stale file handle

Editing also says [Permission Denied]

DMESG output after trying to read the file:

[14540.364844] CIFS VFS: bogus file nlink value 0

I've tried various permissions, users, mount options, and differnent CIFS versions, but all with the same result.

I can't revert back to SMBv1 as the Share does not support it.

The share mounts on other systems (Eg. MacOSX) without issue, and I can read/write.

1
задан 7 August 2020 в 06:23

1 ответ

В конце концов я нашел эту страницу на немецком языке:

https://debianforum.de/forum/viewtopic.php?t=176154

Решение состоит в том, чтобы добавить параметр noserverino:

mount -t cifs //fritz.box/fritz.nas/wd -o rw,noserverino,username=user,password=password,workgroup=WORKGROUP

Из man mount.cifs:

Клиент сам генерирует номера inode вместо того, чтобы использовать фактические с сервера.

Команда полного монтирования в / etc / fstab с указанным пользователем:

//fritz.box/fritz.nas/wd   /home/user/wd    cifs  rw,noserverino,username=user,password=password,uid=user,gid=user,workgroup=WORKGROUP 0 0

Убедитесь, что установлен владелец точки монтирования:

chown user:user /home/user/wd/
1
ответ дан 11 August 2020 в 20:09

Другие вопросы по тегам:

Похожие вопросы: