The Guru College
OpenSolaris, Lion and netatalk 2.2.1, Round 2
I now have OpenSolaris (b151a), Mac OS X Lion (10.7.2) and netatalk v2.2.1 working together in harmony. What follows is a brief setup guide:
Download, build and install a current version of BerkleyDB. I used 5.2.36, the current version on Oracle’s website.
cd /tmp
tar xvzf db-5.2.36.tar.gz
cd db-5.2.36/build_unix
../dist/configure
make && pfexec make install
Next, install gettext
, from the IPS repo. If you are still using OpenSolaris like I am, you will need to unset the opensolaris.org repo, as it no longer responds.
pfexec pkg unset-publisher opensolaris.org
pfexec pkg install gettext
Next, download build and install the current version of netatalk, using the bdb you installed earlier:
cd /tmp
tar xvf netatalk-2.2.1.tar
cd netatalk-2.2.1
pfexec ./configure --with-bdb=/usr/local/BerkeleyDB.5.2
make && pfexec make install
You are almost done. Create your ZFS filesystem for AFP sharing, setup your config files, and fire up the daemons:
pfexec create -o compress=on tank/timemachine
pfexec chown -R <em>username</em> /tank/timemachine
pfexec chmod -R u+rwx /tank/timemachine
echo "/tank/timemachine \"Time Machine Backups\" allow:<em>username</em> options:tm" >> /usr/local/etc/netatalk/AppleVolumes.default
pfexec /etc/init.d/netatalk start
Netatalk should fire up a cnid_metad
process as well as an afpd
process, and you can now connect to the OpenSolaris server with afp://hostname
. Once it’s mounted, Lion can use the volume “Time Machine Backups” as a TimeMachine disk, as it runs the full suite of AFP3.3 commands, including the fast/force sync stuff to make sure the writes happen even if the network connection is severed, which allows TimeMachine to resume backups.
As a word of warning: DO NOT kill -9
THE afpd
OR cnid_metad
PROCESSES. Use SIGTERM or SIGHUP, or just use the init script. If you kill -9, you run the very real risk of killing the CNID DB backend, which keeps track of all the Apple specific file relations, which make things like aliases work. Also, try very hard not to use hard links in AFP volumes – it’s a world of pain waiting for you.