Since getting my Raspberry Pi I have installed a few different operating systems and had a good little mess about. One great use I have found for it is plugging in external drives and utilising it as a Time Machine / Time Capsule backup device for my Mac’s. At such a low price point with a 2Tb drive you can have a working time capsule for under £100! Certainly an attractice prospect for backups!
(This little HOWTO assumes you are running Raspbian)
There are a few steps you need to take in order to get this working, as you will need the Raspberry Pi to support HFS+ as well as running AFP to enable Time Machine.
To enable HFS+ you should install the following
sudo apt-get install hfsplus hfsutils hfsprogs
This will install the necessary packages to mount the HFS+ formatted drive.
Getting the drive to mount as read/write can be achieved by the following command
mount -o force /dev/sdx /mnt/blabla
If the drive doesn’t mount try running a fsck
fsck.hfsplus -f /dev/sdaX (change X to your appropriate drive)
Hopefully this should see your HFS+ drive mounted under raspbian. Now all we need to do is share the drive over AFP and enable Time Machine.
AFP + Time Machine
We need to install a few packages before we can move onto installing AFP support, as netatalk requires a DB as well as encryption.
sudo apt-get install avahi-daemon libavahi-client-dev libdb5.3-dev db-util db5.3-util libgcrypt11 libgcrypt11-dev
Once all dependencies are installed download the latest source code of netatalk (At the time of this HOWTO it was Netatalk 3.0). After unzipping build with the following commands
./configure --with-init-style=debian --with-zeroconf
Now we should have a working install of netatalk which gives us AFP support for the drives we mounted using HFS+. All that is left is to configure afp.conf and start netatalk as a service.
afp.conf is located in /user/local/etc/
Open this file and edit as appropriate by following the instructions at netatalk. However for a simple get started setup the following will give you a drive shared to be used as a Time Machine backup.
; Global server settings
uam list = uams_guest.so
[Time Machine Raspberry]
path = /mnt/test
time machine = yes
With everything configured all that is left to do is run netatalk and your Time Machine backup will appear in the finder under OS X.
This is a very rough guide on how to get everything running under raspbian but hopefully it will providers a jumping off point for further research in order to fine tune the setup to exactly how you want it.