Fixing encodings for SMB mounts using rclone on macOS

What is the problem you are having with rclone?

Mounting an SMB share via rclone nfsmount on macOS results in characters translated by the Samba stack on the remote NAS to not be translated back to their "correct" characters but instead to be passed through the local NFS share unchanged. So, for instance trailing spaces in folder names are shown as  instead of as a space, even though a trailing space in a folder name is legal on macOS. This reflects how such characters are encoded on the remote NAS, not how such characters are "reported" by the macOS SMB client natively. This is causing issues with other applications expecting files and folders to have the same name between mounting methods.

Run the command 'rclone version' and share the full output of the command.

rclone v1.69.1
- os/version: darwin 15.3.2 (64 bit)
- os/kernel: 24.3.0 (arm64)
- os/type: darwin
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.24.0
- go/linking: dynamic
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

SMB share from Synology NAS

The command you were trying to run (eg rclone copy /tmp remote:tmp)

I have tried modifying the encoding setting for the remote to leave out, say, RightSpace and RightPeriod, as well as trying to use --local-encoding Raw when running the mount:

rclone nfsmount cliprushnas:/Melt ~/Melt -o nfc -o noatime

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[cliprushnas]
type = smb
host = XXX
user = XXX
pass = XXX
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

This would probably be much too long, and the command is not failing, it's just exhibiting behavior I would not prefer and want to know if it's possible to adjust properly. I can provide some logging if required.

welcome to the forum,

fwiw, i do not use rclone smb remotes, instead using os mount commands.
might test that and see what happens.

i have a how-to guide comparing rclone smb versus os mount and simple command examples.
https://forum.rclone.org/t/how-to-access-smb-samba-with-rclone/42754

else maybe @kapitainsky knows better...

Yeah, the issue here is that I'm running into problems with OS-native SMB mounts on macOS, and am trying to use rclone mounts instead to see if these problems are unique to the macOS SMB stack (which is written by Apple now instead of being an implementation of the open source Samba software) or are resident elsewhere. I'm just trying to get file and folder name behavior akin to the OS-native mounts while using rclone mounts instead.

hmm, sounds like a nightmare, can see why you want to use rclone.

in the mean time, might test other protocols used by synbox and rclone, such as sftp or webdav.

also, on the synbox, can test rclone serve commands, something like, rclone serve webdav /Melt
and on the macos, mount that webdav server

Does rclone mount (with fuse-t) work when you try to mount the same smb remote?

What is your SMB server?

Ok you are using Synology.

By any chance is your /etc/samba/smb.conf using defaults? If by any chance you have any of:

dos charset
display charset
unix charset

parameters in global section comment them out and restart SMB service.

Have not yet tried FUSE or FUSE-T; the former because I don’t have local access to the Mac and would need to restart it in recovery mode to allow kernel extensions. Can FUSE-T be installed and used without need of a kernel extension? It has been a while since I tried it.

Yeah I would not suggest to use macFUSE - it requires kernel extension with all security and stability implications.

FUSE-T is kext less so no need to change any security settings to allow extensions.

The easiest way to install is simple:

$ brew install fuse-t

Or you can even use it without root access:

Download the latest version and:

$ installer -pkg fuse-t-macos-installer-1.0.47.pkg -target CurrentUserHomeDirectory

$ ln -s $HOME/Library/Application\ Support/fuse-t/lib/libfuse-t-1.0.47.dylib /usr/local/lib/libfuse-t.dylib

I assume you mean on the Synology side here. Unfortunately I do not yet have administrative access to the Synology itself, though I'm working on it.

Installed FUSE-T on the system to do rclone mount instead of nfsmount and no matter which rclone encoding settings I use, I'm still getting the Unicode character replacement at the end of the folder name coming through. Unless there's some rlcone setting I can't find, it seems that its SMB implementation just passes through what it gets sent by the remote system without modification.