Search

Recent

Tags

Make Ubuntu a Mac file server and Time Machine volume

Filed under tips & tricks, network on feb 08, 2010

Mac Ubuntu file sync

The folks at Kremalicious have written an excellent article about how to setup an AFP-fileserver on your Ubuntu server. If you have your storage attached to an Ubuntu server like me, this is an excellent solution for hassle-free Time Machine backups in OSX.

To summarize, building netatalk with SSL support to allow for encryption required by your Mac:

user@pc ~$ mkdir ~/src/netatalk
user@pc ~$ cd ~/src/netatalk
user@pc netatalk$ sudo apt-get  build-dep netatalk
...
user@pc netatalk$ sudo apt-get install cracklib2-dev fakeroot libssl-dev
...
user@pc netatalk$ apt-get source netatalk
user@pc netatalk$ cd netatalk-2*
user@pc netatalk-2.0.x$ DEB_BUILD_OPTIONS=ssl dpkg-buildpackage -rfakeroot
...
user@pc netatalk$ cd .. ; dpkg -i netatalk_2*.deb
...
user@pc netatalk$ echo "netatalk hold" | sudo dpkg --set-selections

Configure AFP:

user@pc ~$ sudo vi /etc/default/netatalk
...
ATALKD_RUN=no
PAPD_RUN=no
CNID_METAD_RUN=yes
AFPD_RUN=yes
TIMELORD_RUN=no
A2BOOT_RUN=no
user@pc ~$ sudo vi /etc/netatalk/afpd.conf
...
- -transall -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh
user@pc ~$ sudo vi /etc/netatalk/AppleVolumes.default
...
~/ "$u" allow:username1,username2 cnidscheme:cdb
/home/username/TimeMachine     TimeMachine allow:username1,username2 cnidscheme:cdb options:usedots,upriv
user@pc ~$ sudo /etc/init.d/netatalk restart

Install and configure Avahi (Multicase DNS):

user@pc ~$ sudo apt-get install avahi-daemon
...
user@pc ~$ sudo apt-get install libnss-mdns
...
user@pc ~$ sudo vi /etc/nsswitch.conf
...
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 mdns
...
user@pc ~$ sudo vi /etc/avahi/services/afpd.service
<?xml version="1.0" standalone='no'?><!--*-nxml-*-->
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_afpovertcp._tcp</type>
<port>548</port>
</service>
<service>
<type>_device-info._tcp</type>
<port>0</port>
<txt-record>model=Xserve</txt-record>
</service>
</service-group>
$ sudo /etc/init.d/avahi-daemon restart
...

Enable networked Time Machine volumes on your Mac:

user@mac ~$ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
user@mac ~$
Time Machine

Enjoy your Time Machine Volume! Your server should pop up in Finder as an Apple X-Server and your should be able to access the volumes after successful authentication.

If you have any issues, head over the the Kremalicious article for tips and tricks. Most of the issues you may come across are explained elaborately. I had to use the Sparse Bundle Hack myself, after creating an empty sparse volume in Disk Utility, Time Machine started synchronising like a charm!

Add to

Post your feedback

You can use this form to leave your feedback. Your insights are always appreciated.

Tools

View document source in text/plain