sudo apt-get install netatalk avahi-daemon
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-group>
sudo vi /etc/avahi/services/deviceinfo.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>_device-info._tcp</type> <port>548</port> <txt-record>model=Xserve</txt-record> </service> </service-group>
sudo /etc/init.d/netatalk restart
sudo /etc/init.d/avahi-daemon restart
sudo mkdir -p /data/osx/timemachine sudo useradd -c "Time Machine User" -d /data/osx/timemachine/ -s /bin/false -g 10 timemachine sudo passwd timemachine
Mark volume as a supporting time machine drive
sudo touch /data/osx/timemachine/.com.apple.timemachine.supported
Some permissions stuff I do on most volumes to keep ACLs sane
sudo chown -R timemachine:users /data/osx/timemachine
Configure netatalk for time machine and a couple other volumes
cat >> /etc/netatalk/AppleVolumes.default <<EOF /data/osx/timemachine TimeMachine allow:timemachine options:tm /data/osx/media media forceuid:media /data/osx/software software forceuid:software EOF
# Turn off default home shares sed -i ‘s/^~/#~/’ /etc/netatalk/AppleVolumes.default
sudo vi /etc/avahi/services/adisk.service
<?xml version="1.0" standalone=’no’?> DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h</name> <service> <type>_adisk._tcp</type> <port>9</port> sys=waMA=nnnnnn,adVF=0×100 <txt-record>dk0=adVF=0xa1,adVN=TimeMachine,adVU=xxxxxxxx</txt-record> <txt-record>dk1=adVN=media,adVU=yyyyyyyyyy</txt-record> <txt-record>dk2=adVN=software,adVU=zzzzzzzzz</txt-record> </service> </service-group>
We need to change certain things in the above :-
waMA (nnnnn) – should be the MAC address of your Ubuntu server (ifconfig -a | grep HWaddr)
xxxx,yyyy and zzzz need to be unique UUID’s go to http://www.guidgen.com/ and generate 3 UUID’s
sudo /etc/init.d/netatalk restart sudo /etc/init.d/avahi-daemon restart
Use Finder to connect to the Ubuntu Server and login and save the password
If you get an error saying you cannot connect
Workaround can be found at
https://bugs.launchpad.net/ubuntu/+source/netatalk/+bug/810732.
In short, edit the ‘-uamlist’ in /etc/netatalk/afpd.conf and replace
‘uams_dhx2.so’ with ‘uams_dhx2_passwd.so’ so that it looks like for
instance ‘-uamlist uams_dhx.so,uams_dhx2_passwd.so’ and restart netatalk
(optional) The following is to create a Time Capsule of a pre-determined size instead of the whole Ubuntu volume.
http://www.64bit.co.uk/wp-content/uploads/2012/05/makeImage.sh_.txt
Then from your MAC
$ mv makeImage.sh.txt makeImage.sh
$ chmod 755 makeImage.sh
$ mv makeImage.sh /Volumes/Time Machine/
$ cd /Volumes/Time Machine/
$ ./makeimage.sh 100
Here, 100 is the size of the sparse image in GB.
Once the sparse image is ready, you are basically ready to let Time Machine start backing up to network drive.
Time Machine will see the whole space of your Ubuntu as available but will only use the sparse file that was created (you can test this by using a small sparse file say 5gb , you will get an error saying backup file is not large enough).
Everything should now work properly. All shares except Time Machine should show up in Finder and when you go into Time Machine preferences you should be able to chose your Time Machine volume without any client side tweaks. Just select the disk and give the “timemachine” user and the password you set for the account.
Mountain Lion 10.8 possible issues
If you receive the following

And this error in the console log
com.apple.backupd: Backup failed with error: 19
Then open a terminal window on your mac after the volume is mounted and type the following.
sudo tmutil setdestination /Volumes/YOUR_BACKUP_VOLUME