I have a server based backup solution, that run quite well. Because I was curious to see the apple desktop solution, I looked around and saw many people talking about deficiencies especially in network functionality. That's why I wanted to draw my own conclusions about the situation with OSX 10.7.2 Lion. Result: It works like a charm in combination with opensource AFP-server "netatalk". But beforehand I made the attempt to get it done with NFS.
In the first place I've choosen NFS because of its well known transfer rate. Although "Time Machine" recognizes the NFS volume in the first place it quits the backup process afterwards due to incompatibilities:
"afpfs fsctl failed to read settings: 25 Inappropriate ioctl for device"
And yes, I did the sparse bundle trick mentioned later in this text, but "Time Machine" didn't recognize it due to filesystem restrictions I think.
AFP
Linux Configuration
On my linux box I've installed netatalk 2.2 and looked through the manuals and configuration files available:
Edit /etc/netatalk/afpd.conf and add or replace the last line in file:
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
At the end of /etc/netatalk/AppleVolumes.default you have to fill out the path to your backup space and adjust some options:
/path/to/your/backupspace name allow:username cnidscheme:dbd options:tm
"name" is the name of the backup volume how you see it on your mac.
"username" means the user with which the mac will identify on the server. Therefor the user also have to exist on the server with the same password.
The AFP server needs "avahi" for the zeroconf protocol. For zeroconf to work properly we need to change:
/etc/sysctl.conf
# Turn off source route verification
net.ipv4.conf.default.rp_filter = 0
# Disable source validation by reversed path (RFC1812)
net.ipv4.conf.all.rp_filter = 0
Both variables turn off source IP address verification. That's not nice because these settings are recommended for a security hardened system. My reaction was: Oh Apple, what have you done. You are drilling a hole in my system? Disabling source route verification is not state of the art but supposed to be necessary for zeroconf.
The server's network adapter has to be in promiscuous mode.
>> ifconfig eth0 promisc
Mac configuration
The good news first: You do not need to hack your system anymore when you are connecting to netatalk-2.2.
Just in case you need to undo the DHCAST128-hack you have to add "DHCAST128" to the list of disabled authentication methods again. You have the choice to delete the file "/Library/Preferences/com.apple.AppleShareClient" or to launch the following command:
sudo defaults write /Library/Preferences/com.apple.AppleShareClient afp_disabled_uams -array-add “DHCAST128″
Time Machine needs some tweaking:
On the terminal just type
$ defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
After done so you have to login again or reboot your machine.
Limit the size of backup
In my scenario I want to use an external harddrive connected to my linux server. Because the disk shall be used for other data too it is a good idea to limit the size of Time Machine's backup. This is done by creating a sparse bundle image with OSX's disk utility and copy it over to the external harddrive. Sparse bundle is an image which expands as it is filled with data. For that we need to know the name of the client and the MAC address:
Open a terminal and type
>> hostname -s
to get the short hostname and even if your client is connected via Wifi, like mine, you need the MAC address from the ethernet interface:
>> ifconfig en0 | grep ether
Concatenate these two informations with an underscore, such as "name_XXXXXXXXXXXX" and you'll get the sparse bundle's filename.
Now we have all informations to create the sparse bundle which will keep the backup later on:
>> hdiutil create -size 250g -fs HFS+J -type SPARSEBUNDLE -volname "Backup of foo" fooname_XXXXXXXXXXXX.sparsebundle
where "size" means maximal size of image (mine is 250 gigabyte),
"fs" stands for filesystem,
"volname" is just a name.
For more informations read the manual:
>>man hdiutil
Next task is to copy the newly created sparse bundle to your backup disk.
Start system settings of Time Machine, point it to your afp share on the server
and your initial backup should be on the way.
The existing sparse bundle with its long name is going to be renamed to "hostname.sparsebundle".
----
References:
Gentoo Wiki
Working with ReadyNAS
Time Machine Backups unter Ubuntu
Limit Time Machine's Backup Size
"Time Machine" icon from Author: joshladella005, HomePage: http://joshladella005.deviantart.com