Apple now use SMB for time machine backup, but it require F_FULLFSYNC which is not supported by most SMB servers* like Windows server or current stable version of samba.
Thanks to latest version of samba, now time machine can work with linux / unix server. But it seems there isn't so much step by step guidance for it so it caused me lots of time to build a linux server for samba.
Environment: Ubuntu Server (arm64) 18.04 LTS
sudo apt update
sudo apt upgrade -y
sudo apt install -y acl attr autoconf bind9utils bison build-essential debhelper dnsutils \
flex gdb libjansson-dev libacl1-dev libaio-dev libarchive-dev libattr1-dev \
libblkid-dev libbsd-dev libcap-dev libcups2-dev libgpgme-dev libldap2-dev \
libncurses5-dev libpam0g-dev libparse-yapp-perl libpopt-dev libreadline-dev \
nettle-dev perl perl-modules pkg-config python-all-dev python-crypto python-dbg \
python-dev python-dnspython python3-dnspython python3-dev xsltproc zlib1g-dev \
libicu-dev libntirpc-dev asn1Parser
wget https://download.samba.org/pub/samba/stable/samba-4.12.0.tar.gz
tar -zxf samba-4.12.0.tar.gz
cd samba-4.12.0/
echo "^samba4.rpc.echo.*on.*ncacn_np.*with.*object.*nt4_dc" >> selftest/knownfail
CFLAGS="-I/usr/include/tirpc" \
./configure \
--prefix=/usr \
--sysconfdir=/etc \
--localstatedir=/var \
--systemd-install-services \
--enable-fhs \
--without-ad-dc \
--without-ads \
--without-ldap &&
make && make install
sudo nano /etc/samba/smb.conf
[global]
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
security = user
durable handles = yes
fruit:aapl = yes
fruit:time machine = yes
fruit:advertise_fullsync = true
[TimeMachine]
path = /Volumes/TimeCapsule
comment = Time Machine Backup Disk
browsable = yes
writable = yes
create mode = 0600
directory mode = 0700
kernel oplocks = no
kernel share modes = no
posix locking = no
vfs objects = catia fruit streams_xattr
Copy the attached files (nmbd, smbd, samba) to /etc/init.d/ (or just type :) ), and register service.
cd /etc/init.d/
chmod +x nmbd smbd
sudo update-rc.d nmbd defaults
sudo update-rc.d smbd defaults
sudo update-rc.d samba defaults
ulimit -n 32768
sudo nano /etc/security/limits.conf
Add line below:
* soft nofile 32768
I've increased the band size to 256MB. Not sure if the open file limit 32768 is enough or not
Good luck!