Recent Posts


How to get Mac High Sierra Time Machine backups working on an Ubuntu 18.04 server

There are lot's of howtos out there how to get Linux servers to support TimeMachine networked backups for Mac clients. But lately they all stopped working due to latest Mac High Sierra updates. Apple moves away from Netatalk protocol and recommends using SMB. Unfortunately the latest Samba you will get on Ubuntu 18.04 is 4.7, and this does not support so called fruit extensions needed by Mac to have Time Machine writing it's data to the destinations. We need to get Samba 4.8 that was released not so long ago.

So let's start. I'm assuming you do not have any other samba installed. The backup folder will pop up as "backup on <your linux server name>" and you will be using user name backups with the password you'll set on the way. I strongly recommend to read the howto I've posted at the end. It allows for a multi user setup.

Install samba:
sudo apt-get-repository ppa:linux-schools/samba-latest
sudo apt update
sudo apt install samba
This installs samba 4.8 that is a hard requirement to get SMB based TimeMachine backups working.

Let's get the old samba config out of the way
mv /etc/samba/smb.conf /etc/samba/smb.confORG
Now create and edit /etc/samba/smb.conf

server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
security = user
printcap name = /dev/null
load printers = no
server string = Samba Server %v
dns proxy = no
wide links = yes
follow symlinks = yes
unix extensions = no
acl allow execute always = yes
# Special configuration for Apple's Time Machine
fruit:model = MacPro
fruit:advertise_fullsync = true
fruit:aapl = yes
fruit:time machine = yes
## Definde your shares here
path = /space/backups
valid users = backups
writable = yes
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
vfs objects = catia fruit streams_xattr
ea support = yes
browseable = yes
read only = No
inherit acls = yes

Create and edit /etc/avahi/services/timemachine.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
 <name replace-wildcards="yes">%h</name>
Create and edit /etc/rc.local as it looks like that samba 4.8 does not come with startup scripts.
echo " # starting samba from rc.local"
exit 0
Add the backup directory, backup user and set permissions on the directory. This also sets the password for SMB/CIFS access:
useradd -m backups
smbpasswd -a backups
mkdir -p /space/backups
chown backups /space/backups
chmod 700 /space/backups
And let's start this (no reboot required):
/etc/init.d/avahi-daemon restart
And there, the new backup destination should show up in all macs connected to this network. REMEMBER KIDS, DO ENCRYPTED BACKUPS!

ps. how to view you mac backups progress:
log stream --style syslog --predicate 'senderImagePath contains[cd] "TimeMachine"' --info


2 komentarze:

Javi Hache pisze...

Hey! I followed your tutorial, but I cannot get Samba Service to start with the server automatically. You have any idea what could be the problem?

jakkul pisze...

I know that it does not launch at boot, but didn't investigate, hence recommendation to create /etc/rc.local. Make it executable and try again - this is something that I might have forgotten in the description.
And now it won't work anyway. Samba 4.8.5 in the repo is compiled with improper options. Need to wait for Samba 4.9.0 to be compiled for Ubuntu in some ppa.

Prześlij komentarz