I've got quite delicate problem with macOS backups over SMB. I did set-up Time Machine server on Ubuntu Server 20.04 with SMB. When the server start/restart, everything works fine, I can see Time Machine server on all my Macs and I can access it's previous backups and even making backup works perfect. However after some time (I can't figure out what is the trigger) all files from Time Machine disk disappear (when I am trying to access them from macOS) and every backup fails with error:
Time Machine couldn’t complete the backup to “data-server.local” The network backup disk does not support the required capabilities.
When I log into the server (over SSH to the Ubuntu Server) and ls
the Time Machine folder, it's completely empty. Restarting SMB and Avahi services doesn't help. When I reboot the whole OS however, everything is back (and new backup made before failure is there) and all Macs can perform the backup without any issues again.
As I said, I cannot find the trigger. Sometimes it does happen after two hours, sometimes after a day, but never after longer period of time. It almost looks like it does happen after a single backup, but I have three Macs on the network and all of them manage to make a full backup without a disruption, every single one in different time (all of them has the same user account and logging to server with same credentials).
I am completely lost here as I cannot logically explain this behaviour.
I am providing SMB config if it does help:
[global]
workgroup = WORKGROUP
server string = %h
server role = standalone server
map to guest = bad user
usershare allow guests = no
[TimeMachine]
comment = Time Machine
path = /media/TimeMachine
browseable = yes
writeable = yes
read only = no
force create mode = 0600
force directory mode = 2770
spotlight = yes
vfs objects = catia fruit streams_xattr
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
ea support = yes
inherit acls = yes
fruit:aapl = yes
fruit:time machine = yes
fruit:model = MacPro
fruit:advertise_fullsync = true
valid users = davedavee @sadmin
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=524288 SO_SNDBUF=524288
edit
Just came on my mind: One possibility could be disk sleep function. Since the OS is server edition, it shouldn't be the case, but sounds pretty reasonable. The disk is connected over USB driver by the way (if it does matter). If it is the "drive sleep mode" option, how can I check its settings and what is correct setup? I know I can Google it or read some man page, but like I said, it just came on my mind and the question is already asked...