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.

  1. cd /tmp
  2. tar xvzf db-5.2.36.tar.gz
  3. cd db-5.2.36/build_unix
  4. ../dist/configure
  5. 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.

  1. pfexec pkg unset-publisher opensolaris.org
  2. pfexec pkg install gettext

Next, download build and install the current version of netatalk, using the bdb you installed earlier:

  1. cd /tmp
  2. tar xvf netatalk-2.2.1.tar
  3. cd netatalk-2.2.1
  4. pfexec ./configure --with-bdb=/usr/local/BerkeleyDB.5.2
  5. make && pfexec make install

You are almost done. Create your ZFS filesystem for AFP sharing, setup your config files, and fire up the daemons:

  1. pfexec create -o compress=on tank/timemachine
  2. pfexec chown -R <em>username</em> /tank/timemachine
  3. pfexec chmod -R u+rwx /tank/timemachine
  4. echo "/tank/timemachine \"Time Machine Backups\" allow:<em>username</em> options:tm" >> /usr/local/etc/netatalk/AppleVolumes.default
  5. 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.

OpenSolaris, Lion and netatalk 2.2.1 | Home | One Last Note On netatalk