[Samba] vfs fruit disk_free fails on tmsize overflow with macOS Time Machine

Art MG smblock at artmg.org
Tue Feb 18 14:54:24 UTC 2020


I apt installed Samba Version 4.9.5-Debian (latest in their repos) on a fresh-built Raspbian Buster Lite release 2020-02-05. I put together the configuration outlined below by using the docs at https://wiki.samba.org/index.php/Configure_Samba_to_Work_Better_with_Mac_OS_X and https://www.samba.org/samba/docs/current/man-html/vfs_fruit.8.html. The underlying usb hard drive is an ext4 partition mounted in fstab, on a new, clean drive with no issues reporting.

 # /etc/samba/smb.conf
 server string = My Server
 map to guest = bad user
 logging = syslog at 4
 vfs objects = catia fruit streams_xattr
 fruit:metadata = stream
 fruit:model = MacPro
 comment = Back up Mac with Time Machine
 path = /mnt/USB1HDD/TimeMachine
 guest ok = Yes
 read only = No
 fruit:time machine = yes
 fruit:time machine max size = 900G

First time around I successfully connect to the share, and ran the Time Machine backup from MacOS Mojave version 10.14.6 (18G2022). At the beginning the Time Machine client correctly reports the space available, according to the max size in the config. The first backup completes successfully, creating its Client Name.sparsebundle folder and contents. However on subsequent occasions the client fails to connect to the share. On the client the Finder returns the error `The operation can’t be completed because the original item for “TimeMachineBackup” can’t be found` and using the command line gives `mount_smbfs: mount error: /backup: Permission denied`. smbd logs the following errors:

 fruit_tmsize_do_dirent: tmsize overflow: bandsize [8388608] nbands [32547]
 sys_disk_free: VFS disk_free failed. Error was : Invalid or incomplete multibyte or wide character

FYI: That second line refers to the myriad files that the Time Machine backup creates inside the '.sparsebundle' subfolder 'bands'. NB: in my case the folder path includes a 'space' character as my client renamed itself to ClientName (53169). In my case there are 32,547 of these files in the folder - each 8,388,608 bytes in size with a hex serial name (from 0 to 808f - skipping a few on the way) totalling 264,730,800 bytes.

So I have tried adding:

 fruit:posix_rename = yes
 fruit:veto_appledouble = no
 fruit:wipe_intentionally_left_blank_rfork = yes
 fruit:delete_empty_adfiles = yes
 min protocol = SMB2

and wiping the previous backup. The first backup works fine, again, and the same issue occurs afterwards. I realise that the latest version my distro offers is 11 months old, but I have checked the 4.10.0, 4.11.0 and 4.11.x-.6 release notes but can find no issues that appear to relate within these components, nor in 4.12.0rc2

The only thing I can do to workaround is to remove the limit - deleting the following line from the config DOES allow me to back up a second time. 

 fruit:time machine max size = 900G

However this is not functionally adequate for my scenario, I need to keep half the disk available for other data
Please advise what I should try next.
Thanks. Art

More information about the samba mailing list