Using Hazel with Linux Samba (SMB) shares
While creating Hazel rules to organize files locally then move them to a Linux server, I kept getting a file permission error from Hazel. I spent a bunch of time looking at Linux file permissions, owners, etc but that wasn't the issue because the error persisted.
Performing the file copy in Terminal provided a clue to fix it when it gave the error "unable to copy extended attributes."
I needed to update my server Samba configuration to support extended attributes. This is something I had done for my Unraid servers, however this server was stock Debian and I hadn't remembered to configure it similarly. I followed the latest Gemini results and got it working.
Edit /etc/samba/smb.conf
In the [global] section, add the following:
Wherever your share definitions are located, add the following:
My share configuration also includes:
Restart Samba:
The next time I ran the Hazel rules, the file copy performed without error.
For system context:
Performing the file copy in Terminal provided a clue to fix it when it gave the error "unable to copy extended attributes."
I needed to update my server Samba configuration to support extended attributes. This is something I had done for my Unraid servers, however this server was stock Debian and I hadn't remembered to configure it similarly. I followed the latest Gemini results and got it working.
Edit /etc/samba/smb.conf
In the [global] section, add the following:
- Code: Select all
[global]
ea support = yes
min protocol = SMB2
Wherever your share definitions are located, add the following:
- Code: Select all
[your_share_name]
vfs objects = fruit streams_xattr
fruit:metadata = stream
fruit:resource = file
fruit:posix_rename = yes
fruit:zero_file_id = yes
fruit:copyfile = yes
My share configuration also includes:
- Code: Select all
veto files = /._*/.DS_Store/
delete veto files = yes
Restart Samba:
- Code: Select all
sudo systemctl restart smbd nmbd
The next time I ran the Hazel rules, the file copy performed without error.
For system context:
- macOS 15.6.1
Hazel 6.0.4
Debian 12.11