SOLVED Strange copy failure over SMB, folder name mangled, files missing

seanm

Guru
Joined
Jun 11, 2018
Messages
570
Hi all,

Yesterday I mounted my FreeNAS 11.2-U7 Samba share from a Mac, and on the Mac used sudo cp -a to copy 1.8 TB of stuff over. I got an error I've never seen before:

cp: /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09/File1: No such file or directory ... ... one for each file in that folder ... cp: utimes: /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09: No such file or directory cp: chown: /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09: No such file or directory cp: chmod: /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09: No such file or directory cp: chflags: /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09: No such file or directory cp: /Volumes/LocalMacDisk/./some/folder/AUX.2016.03.09: unable to copy ACL to /Volumes/MyMountedShare/./some/folder/AUX.2016.03.09: No such file or directory

If I ssh to the FreeNAS, I actually see that folder, though it's only got 1 file in it instead of 61.

drwxrwx---+ 2 sean MyGroup uarch 3 Nov 23 03:27 AUX.2016.03.09/

But disturbingly, if I mount the share I see the folder name mangled as "AG7JL4~7.09", and if I try to navigate into it, it just vanishes!

What the heck has happened here?

@anodos if you read this, and want logs, I can send them privately.

Thanks.
 

Attachments

  • MangledFolderName.png
    MangledFolderName.png
    27.7 KB · Views: 223

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
search the forum for "mac filenames" and have a read.
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
The colon ":" at the end of the file name is an illegal character. Samba should be converting it to an 8x3 name. If you can reliably reproduce the issue, file a bug ticket with the repro case and a debug.
 

seanm

Guru
Joined
Jun 11, 2018
Messages
570
There's no colon in the name. I think the error message just adds that colon to show there's a message next. Also "AUX.2016.03.09" is folder which is why ls is adding a /.

I've unmounted the share and remounted it, and the vanishing upon opening the folder didn't reoccur. But the name is still being mangled whereas ls shows it correctly.

I'll file a ticket so you can look at logs...
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,554
Upload a debug.... and you have a directory with a space at the end of its name. That is invalid and triggering name mangling.
 
Last edited:

seanm

Guru
Joined
Jun 11, 2018
Messages
570
So for anyone interested, we found the root issue here, and it's described by this sentence in the samba docs about name mangling:

"This algorithm can cause name collisions only if files in a directory share the same first five alphanumeric characters. The probability of such a clash is 1/1300."

Well, my source folder had two files named "136563" and "136565", and that caused a collision. The solution is to set the samba option "mangled names = no".
 
Top