Writable Samba Share Ends up Read Only

Writable Samba Share Ends up Read Only

I have problems setting up a docker samba server (dperspon/samba) on my server (Pi4). The writable samba share appears to be read only. However the behavior is weird. When I put a file into the share using MacOS Finder a file is created, but it stays empty. The operation fails with the following note The operation could not be completed because an unknown error occurred (error -50). Using CLI everything is fine. The storage (/media/data) is ExFat formated. What is wrong with the following compose file?

  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

This is the resulting conf in the container.


   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/ Trash Fold
   delete veto files = yes
   valid users = root
4

2 Answers

The problem is the config line:

vfs objects = catia fruit recycle streams_xattr

Note the requirements of the VFS module streams_xattr:

The file system that is shared with this module enabled must support xattrs.

After removing streams_xattr at least writing once worked. However deleting and writing again made problems. Removing fruit alltogether, although using samba only from a mac client, made file operations work as expected.

I am also using dperson/samba with a exFAT mount, and was having similar issues with a Windows 10 client giving this error whenever I tried to rename/move/delete (but creating files worked)

Error 0x80070032: The request is not supported.

as you said, the fix was to remove fruit and streams_xattr from vfs objects line in /etc/samba/smb.conf

vfs objects = catia recycle
$ docker exec -it samba bash
$ vi /etc/samba/smb.conf
# in vi, delete fruit and streams_xattr from vfs objects = 
$ exit
$ docker restart samba

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Robert Thorne
Author

Robert Thorne

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.