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
With Debian 12 Bookworm, I used this command to install dependencies:
To configure:
(Note:
-enable-zeroconf and --with-init-style
parameters)I was able to make and make install successfully with no errors.
I'll also note that with systemd, enabling the service is:
and to restart:
systemctl restart netatalk
once config file has been edited (same place)