I have been using a 4T Western Digital hard drive in the hard drive cage for a long time to do Time Machine backups, I use a USB to connect my laptop to the hard drive cage when I need to back up, and then put the hard drive cage away when I’m done.
Sometimes you will forget to back up, and sometimes it is very troublesome.
The most important thing is that it is not elegant enough.
So I thought of using a network drive as a Time Machine backup disk for my laptop.
Apple used to have an off-the-shelf commercial solution, AirPort Time Capsule, but it’s no longer available and the price was not pretty.
The first time to think of the existing home installed Armbian Rock64 development board, through the search to learn about the implementation of the AFP protocol dedicated to the open-source project Netatalk see the project is hosted in the sourceforge makes me feel unknown … good to just download the source code to compile locally .
First install the dependencies on Rock64:
libevent-dev\. libssl-dev \
The DMCA The DMCA libwrap0-dev \
libdbus-1-dev\. libdbus-glib-1-dev\. libglib2.0-dev\. pkg-config
Download source code, current version 3.1.12
wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.1.12.tar.gz tar zxf netatalk-3.1.12.tar.gz cd netatalk-3.1.12
Compile and install
--enable-krbV-uam. –with-pam-confdir=/etc/pam.d \
–with-dbus-daemon=/usr/bin/dbus-daemon \-whatever –with-dbus-sysconf-dir=/etc/dbus-1/system.d\. –with-tracker-pkgconfig-version=1.0 make -j make install
After installation, do some configuration, first create the directory where the network drive is located: ``bash. mkdir -p /tm/data/
Create the corresponding Linux user, and set the previous directory owner to that user. ``bash’’ useradd -c “Time machine” -m -s /bin/bash tm passwd tm chown -R tm /time\ machine/data
To configure Netatalk, add the following to `/usr/local/etc/afp.conf` where the configuration file is located. ``config. [Time Machine] path = /tm/data time machine = yes valid users = tm spotlight = no
path is the network hard disk storage directory and
valid users is the Linux user name created in the previous step.
Restart the corresponding service after the configuration is complete.
systemctl restart netatalk.service
systemctl restart avahi-daemon.service
At this point you have completed the configuration of the network drive.
Then you can mount the network drive to your system by connecting to the server on your Mac.
The mounted network drive can be used as a Time Machine backup drive as well as a regular hard drive, and can reach speeds of up to 1Gbps in both directions when connected via Ethernet.