Can copy folder with files to network share (samba) but not individual files Mac OS Ventura GL-AXT1800

I have strange behavior with my macbook pro running Ventura and usb storage connected to my GL-AXT1800. I can not copy individual files to the samba share, but oddly, I can copy a folder with the same files contained to the share with no issues. Individual files get this error:

“The operation can’t be completed because an unexpected error occurred (error code -50)”

Things to note:
I tried both Samba and WebDav and neither work for copying individual files. Folders with files are fine
I tried anonymous and user secured share access
I have the latest firmware on my GL-AXT1800
The usb drive connected directly to the macbook copies the individual files just fine
I have checked all permissions and access
I tried to copy an individual file to a folder that was successfully copied and still get the error
This problem doesn’t exist when using windows to connect to the shares
I don’t see any hidden lock files etc on the share or files I am copying
Share is EXFAT

Any ideas why folders copy fine to the share and individual files get error -50 only on mac OS?

Does it work if chmod 777 /the/samba_target_folder?

I tried 777 and no luck. Strangely, I can copy just fine from terminal and applications like muCommander, but not from finder.

I search and find this info:
On macOS, the .DS_Store file is a hidden file by default. This means that it will not be visible in Finder or other file browsers unless you have enabled the option to show hidden files. However, the file is still present on the file system and can cause issues with file transfers over Samba.

I’m having a similar issue with my Mac accessing files via Samba using an A1300. Were you able to fix it?

Nope, I have to put the files into a folder, then I can copy that folder with the files in it. If I want to add a file to the folder, I have to delete the folder and add all the files into it again because it won’t copy a single file even to the new folder. If you find something, to fix it please let me know!

I can’t even do that with my samba issues. As of right now, I can only see avi files. Any other files I add become invisible.

I am experiencing the exact same problem, but unfortunately, I am unable to even copy a folder. This problem has persisted since at least September 2022, and so far no solution has been found. It is disappointing that no support is available and no response has been given. This situation is really pathetic! GL-AXT1800 : Error -50 when copying files to a shared (exfat) disk on Mac OS

Same issue here with my macbook pro. can’t get anything to copy. Should be this hard use this Beryl, and I am returning back to amazon. too bad, I’ve had such a bad experience with this MT3000 in a macos environ, I won’t try their products again.

I have the GL-A1300, the same problems access samba drive from Mac OS 13.4.

  1. Can not copy individual files onto a samba drive
  2. Some files on the SD card are not displayed.

After some digging. The culprit is these Mac dot underscore "._ " files. When you copy a file using Finder, Finder will automatically create a "._ " version of the same file name in the same folder. Current version of Samba can NOT handle these turds.
Same thing happen if a file has a “._” version of itself, Finder can not display the file either.
To make these hidden files show up, run:

find . -type f -name “._*” -exec rm {} ;

on the SD card.

To copy files to a Samba drive, put the files into a folder first. OR just use Terminal. Another solution is to use ext4 file system.

I had this issue some time back.

What fixed it for me was to manage my shares with LUCI. Install the luci-app-samba4 luci plugin/package, then from luci go to services> network shares.

Your current shares should be populated.

Enabled macOS compatible shares via the global tick boxes and in my case on the share I also had to enable force root user.

You can also enable Time Machine support and change the finder sidebar icon with extra server settings too. I can share these if you’re interested

@hansome, it looks like this is a persistent issue. Can someone at GL.iNet please look further into this? It is easy to replicate. Plug a drive into the USB port of the GL-AXT1800 and share it with samba. Take a MacBook and connect to that drive via the Wi-Fi network. Then try to copy a single file to that drive using finder, also try when the file is in a folder, then try with terminal. The single file copy will fail with error code -50 while the other methods will work. Please review the findings with the team at GL.iNet whom I am sure are working in shifts over this issue :slight_smile: Thanks!

Please also creating some dot-underscore turd files on the SD card. You can do that by copying any files, on the Mac (with latest MacOS) to a SD card (by directly inserting the SD card into the Mac), Finder will generate the corresponding dot-underscore files automatically. After this, move the SD Card to the GL-iNet router.
On the Mac, now connect to the Gl-iNet router through a Samba share. Finder wouldn’t be able to display these files with a corresponding dot-underscore filename. Even when hidden files are displayed (by pressing Shift+Cmd+Dot)

I followed dwyeraidan suggestion to enable the macOS compatibility check box. and the I checked the smb.conf file and the following line was added successfully:

fruit:veto_appledouble = no
(Finder needs access to the dot-underscore file if the samba share file system doesn’t have extended attributes)

But copying a single file still failed in samba4. As samba4 still could not handle the dot-underscore files correctly.

(sambe4 version: 4.14.12-2)
(SD Card: exFAT format)

I’ve attached the settings that work very well for me. This was after a lot of forums and reading. Has worked well now for months. My drive is formatted as ext4, maybe that is the difference here. Or that root user is not checked. But alas, I share incase it helps.

vfs objects = catia fruit streams_xattr
fruit:aapl = yes
fruit:nfs_aces = no
fruit:model = TimeCapsule
fruit:wipe_intentionally_left_blank_rfork = yes
fruit:delete_empty_adfiles = yes

Settings per share:

Global settings:

It above does work for you, you can also change the finder sidebar icon to something else, mine presents as a timecapsule. By changing the value of fruit:model = TimeCapsule.

The available finder icon entries can be found at this link: mac - Ubuntu 18.10, Samba 4.8.4 smb.conf - what are the valid values for fruit:model? - Ask Ubuntu

You should reboot your router after change, or at least restart the avahi-daemon service aswell as restart finder, in order for sidebar to reflect change.

Thanks. I think this problem of not able to copy individual files to the samba share is related to only exFAT formatted SD card. I have no problem with ext4 format either. (ext4 supports extended attribute, so Finder doesn’t need to write the turd files)

FYI: If you want to use ext4 on SD card, you can improve throughput by turning off has_journal and set mode=writeback.

Understood.

Okay I did some more testing this time with an exFAT volume, and am successfully writing individual files with the below global settings.

You need to UNCHECK Enable macOS compatible shares from Luci Samba4 General settings page - this checkbox attempts to force fruit:metadata = stream , which according to this post causes issues with exFAT. Then force fruit:resource = file instead of stream.

I also removed streams_xattr from vfs objects so that xattribute support isn’t even loaded globally.

Below is my global template.

    vfs objects = catia fruit
    fruit:resource = file
    fruit:nfs_aces = no
    fruit:model = TimeCapsule
    fruit:wipe_intentionally_left_blank_rfork = yes
    fruit:delete_empty_adfiles = yes

And per share, yellow highlighted is exFAT.
As per aforementioned post link, I changed the mask values, maybe its not necessary.
Create mask: 0744
Directory mask: 0755

Save in Luci, and then in cli
service samba4 restart

or reboot router.

You’ve nailed it. The key is to remove “streams_xattr” from vfs objects.

Reading doc from samba.org, it says:
streams_xattr : Samba stores ADS in the user.DosStream.ADS_name extended attribute of a file or directory. Therefore, the file system of the share must support extended attributes.

However exFAT does not !

Edit: Sorry for my mistake, I forgot you’ve set “fruit:resource = file”, which means samba4 is by passing the vfs module “streams_xattr” and telling MacOS to use a dot-underscore file. By removing the streams_xattr module, MacOS is no longer creating the dot-underscore file, which temporarily making it work. This only means one thing, there is a bug in samba4 in handling the dot-underscore file.

Conclusion, for now, the easiest way, is to remove the streams_xattr vfs module.

1 Like

I’m new to Gl.iNet router. I have a question:

I can edit the smb.conf.template file, save and apply the setting in LuCi, but after reboot, the template file is reverted back to factory settings.

After saving the file, I also used shell to check the /etc/samba/smb.conf.template file, and it had the new settings. But not after a reboot. What went wrong?

GL.iNet GL-A1300
OpenWrt 21.02.2 r16495-bf0c965af0
Kernel 5.4.179
samba4-server 4.14.12-2

Yeh I remember having this issue before.

What seemed to solve it for me was to update smb.conf.template4 (note the 4 !) in /etc/samba as well as using Luci (which updates smb.conf.template)

Don’t know why I needed to do this, but the settings persist reboots anyway.

1 Like