Alternate Data Streams and Robocopy Error 87

rob19

Cadet
Joined
Feb 12, 2023
Messages
6
Hi all,

My first TrueNAS project got underway today, however I ran into a weird issue when trying to copy data over from an NTFS share. My robocopy command was failing with a generic error "error 87 the parameter is incorrect". I'm a user of both OSX, Windows and Linux, all of which have used the drive in question of the years. Hours of searching later and I now understand all about alternate data streams...

The problem turns out to be potential stream corruption or similar? I'm seeing a lot of folders (only folders), with an empty "com.apple.FinderInfo". This shows up in the finder by using ls -l@ as "com.apple.FinderInfo -1". The -1 means no data, and can be confirmed with xattr. Any directory that has data here copies correctly.

TrueNAS reports the error as:
open_directory: unable to create xxxx. Error was NT_STATUS_OBJECT_NAME_COLLISION smbd_smb2_request_error_ex: smbd_smb2_request_error_ex: idx[1] status[NT_STATUS_OBJECT_NAME_COLLISION] || at ../../source3/smbd/smb2_create.c:337

Some further searching tells me that there probably isn't anything important stored here, at least that I'm using. So I removed it recursively with the command:
xattr -r -d com.apple.FinderInfo *

Is this a bug in TrueNAS? Or something else? It would be nice if it handled it transparently instead of spitting the dummy.


Thanks
Rob
 

rob19

Cadet
Joined
Feb 12, 2023
Messages
6
Well the recursive command xattr failed. So I'm still unable to move my data over. Any ideas? Thanks
 
Joined
Oct 22, 2019
Messages
3,641
Were these ADS'es created under Windows initially? (Do you even need to retain the ADS, or rather you don't care if you lose them?)
 

rob19

Cadet
Joined
Feb 12, 2023
Messages
6
No, they would have been created by osx initially. I don't think there is anything there that needs retaining but I am not 100% sure. It would be nice to retain them but not critical.
 
Joined
Oct 22, 2019
Messages
3,641
I don't think there is anything there that needs retaining but I am not 100% sure. It would be nice to retain them but not critical.
If you don't mind losing them, then you can disable Alternate Data Streams in your SMB Share's configuration.

(It's a one-way operation. Once gone, they're gone for good. Even if copied back to an NTFS filesystem.)

Disabling ADS should let you use Robocopy without issue now.
 

rob19

Cadet
Joined
Feb 12, 2023
Messages
6
I have disabled alternate data streams and restarted the SMB service... however robocopy still isn't working. Same error 87. Still appears to only be folders that have an empty com.apple.FinderInfo stream.
 
Joined
Oct 22, 2019
Messages
3,641
I thought you removed the com.apple.FinderInfo xattr in your first post?

EDIT: Nevermind.

the recursive command xattr failed.


Did the xattr command itself fail? Or was it a "failure" because after removing the xattr, the Robocopy operation still fails?
 
Last edited:

rob19

Cadet
Joined
Feb 12, 2023
Messages
6
The xattr command failed to remove the ADS. I removed support for ADS from the share as suggested (and restarted SMB), however the robocopy operation still fails with the same error when trying to copy directories or files that have an empty/blank ADS. It seems that there were some left over aux parameters from the profile... after removing all aux parameters I can now use robocopy without ADS support.

As a Mac user I would like to have ADS support as osx uses them quite extensively it seems. Is there a better way to understand what is failing with the empty ADS and fix it?
 
Top