Hacker Emblem

Time Machine for Lion on FreeBSD

BlogNotes to Myself

  • Frontpage
  • Gallery
  • About Me
  • Imprint

Time Machine for Lion on FreeBSD

Posted by Stefan on September 28, 2011

More than a year ago I wrote about Using FreeBSD as Time Machine server. With the release of OS X Lion the configuration of the FreeBSD packages deserves an update.

First of all I recommend to install at least netatalk-2.2.1 which was updated in the ports tree on September 10th. I had a couple of problems with previous versions. The package and port have a dependency on avahi-app which implements Zeroconf and replaces howl. Therefore the description about the howl configuration in my previous article is obsolete now.

Apple Filing Protocol

This is my configuration in /usr/local/etc/AppleVolumes.default:

# The line below sets some DEFAULT, starting with Netatalk 2.1.
:DEFAULT: options:upriv,usedots veto:/lost+found/ dbpath:/var/db/afpd/$v

# The "~" below indicates that Home directories are visible by default.
# If you do not wish to have people accessing their Home directories,
# please put a pound sign in front of the tilde or delete it.
~

This allows sharing all home directories on the FreeBSD file server. It also hides lost+found directories and moves the CNID databases to subdirectories below /var/db/afpd. Make sure you don't run out of space there or the database may become corrupted. You should also create that directory.

Next, the configuration file /usr/local/etc/afpd.conf has the following line:

"Elan" -tcp -noddp -uamlist uams_dhx2.so -ipaddr 192.168.1.2 -mimicmodel Xserve

Elan would be the name showing up in Finder. This version of Netatalk has an easy way to change the icon used in Finder by using the mimicmodel option. I decided to to use the Xserve icon for my FreeBSD server.

Finally the following entries in /etc/rc.conf are necessary to start all relevant services during boot:

dbus_enable="YES"
avahi_daemon_enable="YES"
netatalk_enable="YES"
cnid_metad_enable="YES"
afpd_enable="YES"

This configuration should be sufficient to access your home directory on the FreeBSD server.

Time Machine

Now the Time Machine specific parts. As written in my previous article I wanted to use a dedicated volume for my backups. So I added the volume name to /usr/local/etc/AppleVolumes.default:

/pool/backup/TimeMachine "Time Machine" options:tm volsizelimit:256000 allow:tmbackup

As before tmbackup is the user that will own the backups on the FreeBSD server.

Now create the file /usr/local/etc/avahi/services/afpd.service and put the following XML code into it:

<?xml version="1.0" standalone="no"?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">Time Capsule</name>
  <service>
   <type>_afpovertcp._tcp</type>
   <port>548</port>
  </service>
  <service>
   <type>_device-info._tcp</type>
   <port>0</port>
   <txt-record>model=TimeCapsule</txt-record>
  </service>
  <service>
   <type>_adisk._tcp</type>
   <port>9</port>
   <txt-record>sys=waMA=00:15:f2:xx:xx:xx,adVF=0x100</txt-record>
   <txt-record>dk0=adVF=0x83,adVN=Time Machine</txt-record>
  </service>
</service-group>

Make sure to replace 00:15:f2:xx:xx:xx with the MAC address of your network controller. With this file Avahi announces a file server named Time Capsule and a volume Time Machine with the necessary capabilities in your network. The volume name must match the entry used in AppleVolumes.default as shown above.

Finder will even use the Time Capsule icon for it. The code for the icon is derived from the article Specify the Finder icon with Avahi.

Now the setup of your Mac to use the volume offered by the FreeBSD based Time Capsule should work as described in the section Configuration of Time Machine of my previous article Using FreeBSD as Time Machine server.

Posted by Stefan in Unix Comment: (1) Trackback: (1)
Defined tags for this entry: FreeBSD, Mac
Possibly related articles
GNU Emacs and GPGTool on Mac
Faster RAM failing in Mac mini
Using FreeBSD as Time Machine server

Trackbacks
Trackback specific URI for this entry
PingBack
Weblog: kai.rogal.eu
Tracked: Feb 29, 23:22

Comments
Comment #1 by Katsuya : 2012-01-08 18:06

Your article helped me a lot. I was troubled with backing up on FreeBSD when I updated to Lion. I came up to your article and the problem has solved. Fielen Danke!


Add Comment






Standard emoticons like :-) and ;-) are converted to images.
Textile-formatting allowed
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
Submitted comments will be subject to moderation before being displayed.

Syndication
  • XML RSS 1.0 feed
  • XML RSS 2.0 feed
  • ATOM/XML ATOM 1.0 feed
Tags
Apache Concepts Database Mac OpenVZ Oracle PostgreSQL R SQL Tools Tuning Unix Virtualization
Recent Posts
R package for the Universal Scalability Law
Feb 13. 2013
No MERGE with ROWNUM
Jan 27. 2013
Sendmail plugin for collectd
Dec 28. 2012
LNNVL() and Time Oriented Data
Oct 13. 2012
Losing NOT NULL on disabled PK constraint
Sep 20. 2012
License
Creative Commons License
BlogNotes to Myself by Stefan Möding is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
 
Imprint - Privacy Policy