我在我的服务器 (Pi4) 上设置 docker samba 服务器 (dperspon/samba) 时遇到问题。可写的 samba 共享似乎是只读的。但是行为很奇怪。当我使用 MacOS Finder 将文件放入共享时,会创建一个文件,但它保持为空。操作失败,并显示以下注释The operation could not be completed because an unknown error occurred (error -50)。使用 CLI 一切都很好。存储(/媒体/数据)是 ExFat 格式的。以下撰写文件有什么问题?
samba:
image: dperson/samba
container_name: samba
command: -g "log level = 2" -u "root;PASSWORD" -s "all;/smb/all;yes;no;no;root"
volumes:
- /media/data:/smb/all
environment:
- TZ=Europe/Berlin
- WORKGROUP=media
#- USERID=0
#- GROUPID=0
ports:
- 139:139
- 445:445
restart: unless-stopped
这是容器中生成的 conf。
pam password change = yes
map to guest = bad user
usershare allow guests = yes
create mask = 0664
force create mode = 0664
directory mask = 0775
force directory mode = 0775
force user = smbuser
force group = smb
follow symlinks = yes
load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes
strict locking = no
aio read size = 0
aio write size = 0
vfs objects = catia fruit recycle streams_xattr
recycle:keeptree = yes
recycle:maxsize = 0
recycle:repository = .deleted
recycle:versions = yes
# Security
client ipc max protocol = SMB3
client ipc min protocol = SMB2_10
client max protocol = SMB3
client min protocol = SMB2_10
server max protocol = SMB3
server min protocol = SMB2_10
# Time Machine
fruit:delete_empty_adfiles = yes
fruit:time machine = yes
fruit:veto_appledouble = no
fruit:wipe_intentionally_left_blank_rfork = yes
[all]
path = /smb/all
browsable = yes
read only = no
guest ok = no
veto files = /.apdisk/.DS_Store/.TemporaryItems/.Trashes/desktop.ini/ehthumbs.db/Network Trash Fold
delete veto files = yes
valid users = root
问题是配置行:
注意VFS 模块 stream_xattr的要求:
在删除
streams_xattr
至少一次工作后。然而,删除和再次写入产生了问题。fruit
尽管仅从 mac 客户端使用 samba,但一起删除,使文件操作按预期工作。我还在使用带有 exFAT 挂载的 dperson/samba,并且每当我尝试重命名/移动/删除时,Windows 10 客户端都会出现类似的问题(但创建文件有效)
正如您所说,解决方法是从 /etc/samba/smb.conf 中的 vfs 对象行中删除fruit和streams_xattr