sudo apt-get install automake libtool build-essential pkg-config checkinstall git-core avahi-daemon libavahi-client-dev libssl-dev libdb5.1-dev db-util db5.1-util libgcrypt11 libgcrypt11-dev libcrack2-dev libpam0g-dev libdbus-1-dev libdbus-glib-1-dev libglib2.0-dev libwrap0-dev systemtap-sdt-dev libacl1-dev libldap2-dev
wget http://downloads.sourceforge.net/project/netatalk/netatalk/3.1.2/netatalk-3.1.2.tar.bz2
tar xvf netatalk-3.1.2.tar.bz2
cd netatalk-3.1.2
./configure --with-init-style=debian --with-zeroconf --with-cracklib --with-pam-confdir=/etc/pam.d --with-dbus-sysconf-dir=/etc/dbus-1/system.d
After successfull configuration the configure summary should look like this
Configure summary:
INIT STYLE:
debian
AFP:
Extended Attributes: ad | sys
ACL support: yes
Spotlight: no
CNID:
backends: dbd last tdb
UAMS:
DHX (PAM SHADOW)
DHX2 (PAM SHADOW)
RANDNUM (afppasswd)
clrtxt (PAM SHADOW)
guest
Options:
Zeroconf support: yes
tcp wrapper support: yes
quota support: yes
admin group support: yes
valid shell check: yes
cracklib support: yes
ACL support: auto
Kerberos support: auto
LDAP support: yes
AFP stats via dbus: yes
dtrace probes: yes
Paths:
Netatalk lockfile: /var/lock/netatalk
init directory: /etc/init.d
dbus system directory: /etc/dbus-1/system.d
pam config directory: /etc/pam.d
Documentation:
Docbook: no
make
Use the option --fstrans=no
to prevent failing of mkdir -p
commands during the install.
sudo checkinstall --fstrans=no
I am using a USB HDD, which was formatted on my Mac as a HFS+ (journaled) volume. In order to mount and use this drive we have to install the necessary HFS packages:
sudo apt-get install hfsplus hfsutils hfsprogs
Create the mount destination folder
sudo mkdir /mnt/Backup
Get the drive's UUID
sudo blkid
Add the drive to /etc/fstab
UUID=<UUID from blkid> /mnt/Backup hfsplus force,defaults 0 0
Mount it
sudo mount /mnt/Backup
Set appropriate permissions
sudo chown backup:backup /mnt/Backup
sudo chmod 2775 /mnt/Backup
The configuration file is found under /usr/local/etc/afp.conf
. Make sure to create the folders specified in the path of each volume.
;
; Netatalk 3.x configuration file
;
[Global]
; Global configuration
hostname = Backup
log file = /var/log/netatalk.log
log level = default:info
zeroconf = yes
valid users = @backup
save password = yes
mimic model = TimeCapsule
hosts allow = 192.168.178.0/24
[Backup]
; Backup folder for every user in group 'backup'
path = /mnt/Backup/Backup
valid users = @backup
[TimeMachine A]
; Time Machine folder for user A - limited to 400GB
path = /mnt/Backup/TM-userA
valid users = userA
vol size limit = 381470
time machine = yes
[TimeMachine B]
; Time Machine folder for user B - limited to 200GB
path = /mnt/Backup/TM-userB
valid users = userB
vol size limit = 190735
time machine = yes
Restart netatalk
sudo service netatalk restart
#!/bin/bash
### BEGIN INIT INFO
# Provides: TimeMachine
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start TimeMachine.
# Description: Enable TimeMachine service and mount the drive.
### END INIT INFO
DUUID="<UUID from blkid>"
MNTP="/mnt/Backup"
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
case "$1" in
start)
service netatalk stop
service avahi-daemon stop
umount -l $MNTP
sudo fsck.hfsplus -f `blkid -U $DUUID`
mount -t hfsplus -o force `blkid -U $DUUID` $MNTP
service avahi-daemon start
service netatalk start
;;
stop)
service netatalk stop
service avahi-daemon stop
umount -l $MNTP
;;
*)
echo "Usage: /etc/init.d/TimeMachine {start|stop}"
exit 1
;;
esac
exit 0
Worked fine for me. Not from the first try, but anyway. Finally MacBook with Sonoma 14.4.1 is having its wireless Time Machine. It's Raspberry Pi 4 Bookworm with latest updates as of December 2024.
What I made different is I downloaded this package instead of 3.1.2:
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.1.14.tar.gz
Everything else is as NucleaPeon noted.
There were some warnings, so if it stops working at some point, it's worth trying later versions, obviously
By the way, 3.1.13 compiled without errors also, but failed on the MacBook login stage.
My config just in case
Filesystem of /mnt/usb1/ is Ext4, so no HFS packages in my case.
Thanks a lot!