#StackBounty: #cifs #smb linux – smb/cifs Stale cp: cannot open 'file.JPG' for reading: Stale file handle

Bounty: 100

I’ve got the following entry in my /etc/fstab:

//fritz.box/fritz.nas /mnt/smb/fritz.nas cifs   user,cache=loose,nohandlecache,username=name,workgroup=WORKGROUP,password=pwd,vers=3.0         0      0

mounting works perfectly fine, but when I want to copy a file from the server to my local machine, I get the following error:

cp: cannot open 'file.JPG' for reading: Stale file handle

or if I use rsync:

rsync: [sender] send_files failed to open "path/to/file.JPG": Stale file handle (116)
        937.29K 100%  915.32MB/s    0:00:00 (xfr#1, to-chk=0/1)

sent 88 bytes  received 35 bytes  246.00 bytes/sec
total size is 937.29K  speedup is 7,803.09
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=v3.2.3]

If I set the smb version to 1 the error is gone (which I’d like to avoid due to known security issues).

I already tried changing some things with the caching (since https://forums.unraid.net/topic/86707-cifs-smb-stale-file-handle/ indicates that this is causing the issue), but is isn’t working. (already tried cache=none in the fstab)

Any ideas what might be causing this (maybe it isn’t the caching) or what I’m doing wrong when trying to turn off the caching?

Edit: Tested downloading a file with smbclient (disabled SMBv1 in advance)

SMBv1 capability removed

smbclient works


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.