Unidentifiable file

Stromkompressor

Dabbler
Joined
Mar 13, 2023
Messages
18
Hi!

After copying some file from my PC to my TrueNAS instance via an SMB share, I now have a weird file which can't be deleted:

Code:
sven@sven-MSI:/run/user/1000/gvfs/smb-share:server=truenas.local,share=svens-dateien/svens-fotos/Takeout/Google Fotos2$ LANG=C ls -l
ls: cannot access 'ZA4S9B~Q': No such file or directory
total 0
?????????? ? ? ? ?            ? ZA4S9B~Q


Trying to remove it:
Code:
sven@sven-MSI:/run/user/1000/gvfs/smb-share:server=truenas.local,share=svens-dateien/svens-fotos/Takeout/Google Fotos2$ LANG=C rm ZA4S9B~Q
rm: cannot remove 'ZA4S9B~Q': No such file or directory


Or with quotes:
Code:
sven@sven-MSI:/run/user/1000/gvfs/smb-share:server=truenas.local,share=svens-dateien/svens-fotos/Takeout/Google Fotos2$ LANG=C rm "ZA4S9B~Q"
rm: cannot remove 'ZA4S9B~Q': No such file or directory


When opening the parent folder with my file explorer, it only briefly shows the file as a folder and then hides it.

I have run a scrub task but it is still there. I just want to delete it. In my original files there is no such file.

Also:
Code:
sven@sven-MSI:/run/user/1000/gvfs/smb-share:server=truenas.local,share=svens-dateien/svens-fotos/Takeout/Google Fotos2$ LANG=C file ZA4S9B~Q
ZA4S9B~Q: cannot open `ZA4S9B~Q' (No such file or directory)


Do I have to nuke the dataset?
 
Joined
Oct 22, 2019
Messages
3,641
sven@sven-MSI:/run/user/1000/gvfs/smb-share
Don't use GVFS or KIO to access your SMB shares. (These are usually, unfortunately, the built-in methods of most popular Linux desktops file-managers.)

You should instead use a method that uses the cifs kernel module.
  • mount
  • fstab / automount
  • systemd-mount / -automount
  • Smb4K

This will resolve many issues with performance, filenames, and other unintended quirks.


On another note, you will also find this option very pragmatic for your SMB shares:
apple-style-characters.png
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
This is most likely caused by filenames created with invalid characters (what you see is a mangle hash), and yes the userspace client can be quite buggy and less performant than the linux kernel client.
 

Stromkompressor

Dabbler
Joined
Mar 13, 2023
Messages
18
Thanks for your replies. Mounting with CIFS didn't fix the issue but I will use it from now on. I already used CIFS for some other automation that mounts the SMB share of TrueNAS.

What fixed it for me was to SSH into my NAS and rm -r the folder directly on the machine. The folder contained a german ö and had a space as the last character.
 

Stromkompressor

Dabbler
Joined
Mar 13, 2023
Messages
18
After I enable "Use Apple-style Character Encoding" I can't mount the share anymore. dmesg says
Code:
[ 5358.508569] CIFS: Attempting to mount \\192.168.2.12\svens-dateien
[ 5358.553355] CIFS: VFS: parse_server_interfaces: malformed interface info


Disabling it doesn't make it work again. I have to recreate the share (which takes 10 seconds). Do I have to delete all files, then enable the option, and then copy all the data into the dataset again?
 
Top