NOTE: This should only be attempted by those who are comfortable mucking about with their FreeNAS installation. This is at your own risk. There is no warranty or support for the below. I am not part of the FreeNAS team. This is only for FreeNAS 8.0.1 Beta 4. These will not work on FreeNAS 7 and I have no plans to try to compile there. If someone is interested in doing this for FreeNAS 7 they can pull a snapshot of Frank Lahm's master branch from Sourceforge git and try themselves.
UPDATE: Updated tar ball link below with other binaries included, atalkd, cnid_dbd, chid_metad, papd. Late night.
UPDATE 2: Initial release is for x86 systems.
UPDATE 3: Tarball for amd64 now available. Instructions below should be the same. (2011-08-02)
UPDATE 4: How to integrate the contents of the afp_voluuid.conf file with the adisk.service file. At the bottom. (2011-08-04)
---
I have compiled Netatalk 2.2 from Frank Lahm's master tag after he merged knu's fixes for FreeBSD. Those fixes can be summed up here:
https://github.com/franklahm/Netatalk/pull/1/files
Compiled versions can be found here:
x86 - http://dl.dropbox.com/u/32896380/netatalk-2.2.tar.gz
amd64 - http://dl.dropbox.com/u/32896380/netatalk-2.2-amd64.tar.gz
Notes:
I could not get the configure script to recognize Avahi on my FreeBSD 8.2 build box. So this afpd binary will not automatically register with Avahi. There is an additional file you will need to edit for Avahi and copy into place.
Instructions:
ssh into your FreeNAS box
nas# /usr/local/etc/rc.d/netatalk stop
nas# /usr/local/etc/rc.d/avahi-daemon stop
In order to make your changes survive a reboot you must mount the filesystem read/write:
nas# mount -uw /
scp netatalk-2.2.tar.gz to your FreeNAS installation.
untar and you will find the following files:
netatalk-2.2
->afpd binary
->atalkd binary
->cnid_metad binary
->cnid_dbd binary
->papd binary
->uams folder
->avahi-services folder
Make a backup of your existing Netatalk
nas# mv /usr/local/sbin/afpd /usr/local/sbin/afpd-2.1.5
nas# mv /usr/local/sbin/atalkd /usr/local/sbin/atalkd-2.1.5
nas# mv /usr/local/sbin/cnid_metad /usr/local/sbin/cnid_metad-2.1.5
nas# mv /usr/local/sbin/cnid_dbd /usr/local/sbin/cnid_dbd-2.1.5
nas# mv /usr/local/sbin/papd /usr/local/sbin/papd-2.1.5
nas# mv /usr/local/libexec/netatalk-uams /usr/local/libexec/netatalk-uams-2.1.5
cd to the netatalk-2.2 directory that was untarred.
nas# cp ./afpd /usr/local/sbin/
nas# cp ./atalkd /usr/local/sbin/
nas# cp ./cnid_metad /usr/local/sbin/
nas# cp ./cnid_dbd /usr/local/sbin/
nas# cp ./papd /usr/local/sbin/
nas# cp -rp ./uams /usr/local/libexec/netatalk-uams
Create a new directory for the signature file
nas#: mkdir /usr/local/etc/netatalk
Edit the adisk.service file in avahi-services. Replace the bits with curly brackets with your installation information. This is necessary since this afpd binary is not avahi aware. After editing, copy the file into place:
nas# cp ./avahi-services/adisk.service /etc/local/avahi/services
The following will make this change permanent after reboot
nas# cp /etc/local/avahi/services/adisk.service /conf/base/etc/local/avahi/services/
---
That should do it. Start Netatalk and Avahi
nas# /usr/local/etc/rc.d/netatalk start
nas# /usr/local/etc/rc.d/avahi-daemon start
AFP shares should mount as normal. You must still connect to the share you want to use for Time Machine before you can select it in the Time Machine system preferences in Lion.
I have tested this afpd binary with both Snow Leopard 10.6.8 and Lion 10.7. It resumed using existing sparsebundle backups. If this doesn't work for you, it should be straightforward to revert to Netatalk 2.1.5, assuming you followed the backup instructions.
Hopefully by the Fall, Netatalk 2.2 will be in FreeBSD ports and will make its way to FreeNAS 8.x.
---------------
UPDATE 4:
Update for complete Avahi integration:
This would be alot easier with a newer version of Avahi on FreeNAS and also having Netatalk compiled with Avahi support, but for now, for total OS X nirvana, the remaining steps can be followed:
For those that started using the tarballs earlier this week, the creation of /usr/local/etc/netatalk/ is an important step as it lets Netatalk generate and store UUIDs for volumes you have marked for Time Machine in the GUI or command line (indicated by options:tm in AppleVolumes.default).
After starting Netatalk with that directory created, you should connect from your Mac to your Time Machine share(s). You can then disconnect.
If you then look in the /usr/local/etc/netatalk directory you will find two files
nas#: ls -l /usr/local/etc/netatalk
afp_signature.conf
afp_voluuid.conf
The second one is of interest and will help us better define the adisk.service file - which is key to getting these shares visible to Time Machine without first mounting them.
So look inside your afp_voluuid.conf and you will see something like
nas#: cat /usr/local/etc/netatalk/afp_voluuid.conf
"TMShareName1" 185CCAF0-BED9-11E0-962B-0800200C9A66
"TMShareName2" 286A9850-BED9-11E0-962B-0800200C9A66
You may have more lines, you may just have one. Either way both values on each line are important
It is also important now to make sure that this directory survives a reboot.
nas#: cp -rp /usr/local/etc/netatalk /conf/base/etc/local/
Now we can more properly edit the adisk.services file. If Avahi was integrated with Netatalk, this would all happen automagically. When Netatalk 2.2 becomes part of FreeNAS and has the link to Avahi, this entire file will be generated automagically.
So using adisk.service in the tarball, you should concentrate in the first <section> node and the <txt-record> with the uuids as the part to edit.
This should be filled out using the values from afp_voluuid.conf.
Note: You still need to add the MAC Address and server name to the first <txt-record> line.
Note: These lines are different from what you will find in adisk.service in the tarballs.
Now for the explanations:
- dk{n} should be sequential depending on the number of shares you have
- adVF=0xa1 is the magic bit that will make these shares show up in the Time Machine 'Select Disk' window in System Preferences->Time Machine on your Mac. Or when you need to restore.
This should only be on shares that are TimeMachine backups - i.e. have options:tm in AppleVolumes.default
- For non-Time Machine shares, any UUID will do - just make sure it is different. You can generate one here: http://www.famkruithof.net/uuid/uuidgen
- Typos are easy (trust me) - double check your work.
Now save adisk.services and restart Avahi
/usr/local/etc/rc.d/avahi-daemon restart
And then check things out on your Mac.
When you are satisfied, copy the adisk.service file to /base to make sure it survives a reboot:
nas#: cp /etc/local/avahi/services/adisk.service /conf/base/etc/local/avahi/services/
UPDATE: Updated tar ball link below with other binaries included, atalkd, cnid_dbd, chid_metad, papd. Late night.
UPDATE 2: Initial release is for x86 systems.
UPDATE 3: Tarball for amd64 now available. Instructions below should be the same. (2011-08-02)
UPDATE 4: How to integrate the contents of the afp_voluuid.conf file with the adisk.service file. At the bottom. (2011-08-04)
---
I have compiled Netatalk 2.2 from Frank Lahm's master tag after he merged knu's fixes for FreeBSD. Those fixes can be summed up here:
https://github.com/franklahm/Netatalk/pull/1/files
Compiled versions can be found here:
x86 - http://dl.dropbox.com/u/32896380/netatalk-2.2.tar.gz
amd64 - http://dl.dropbox.com/u/32896380/netatalk-2.2-amd64.tar.gz
Notes:
I could not get the configure script to recognize Avahi on my FreeBSD 8.2 build box. So this afpd binary will not automatically register with Avahi. There is an additional file you will need to edit for Avahi and copy into place.
Instructions:
ssh into your FreeNAS box
nas# /usr/local/etc/rc.d/netatalk stop
nas# /usr/local/etc/rc.d/avahi-daemon stop
In order to make your changes survive a reboot you must mount the filesystem read/write:
nas# mount -uw /
scp netatalk-2.2.tar.gz to your FreeNAS installation.
untar and you will find the following files:
netatalk-2.2
->afpd binary
->atalkd binary
->cnid_metad binary
->cnid_dbd binary
->papd binary
->uams folder
->avahi-services folder
Make a backup of your existing Netatalk
nas# mv /usr/local/sbin/afpd /usr/local/sbin/afpd-2.1.5
nas# mv /usr/local/sbin/atalkd /usr/local/sbin/atalkd-2.1.5
nas# mv /usr/local/sbin/cnid_metad /usr/local/sbin/cnid_metad-2.1.5
nas# mv /usr/local/sbin/cnid_dbd /usr/local/sbin/cnid_dbd-2.1.5
nas# mv /usr/local/sbin/papd /usr/local/sbin/papd-2.1.5
nas# mv /usr/local/libexec/netatalk-uams /usr/local/libexec/netatalk-uams-2.1.5
cd to the netatalk-2.2 directory that was untarred.
nas# cp ./afpd /usr/local/sbin/
nas# cp ./atalkd /usr/local/sbin/
nas# cp ./cnid_metad /usr/local/sbin/
nas# cp ./cnid_dbd /usr/local/sbin/
nas# cp ./papd /usr/local/sbin/
nas# cp -rp ./uams /usr/local/libexec/netatalk-uams
Create a new directory for the signature file
nas#: mkdir /usr/local/etc/netatalk
Edit the adisk.service file in avahi-services. Replace the bits with curly brackets with your installation information. This is necessary since this afpd binary is not avahi aware. After editing, copy the file into place:
nas# cp ./avahi-services/adisk.service /etc/local/avahi/services
The following will make this change permanent after reboot
nas# cp /etc/local/avahi/services/adisk.service /conf/base/etc/local/avahi/services/
---
That should do it. Start Netatalk and Avahi
nas# /usr/local/etc/rc.d/netatalk start
nas# /usr/local/etc/rc.d/avahi-daemon start
AFP shares should mount as normal. You must still connect to the share you want to use for Time Machine before you can select it in the Time Machine system preferences in Lion.
I have tested this afpd binary with both Snow Leopard 10.6.8 and Lion 10.7. It resumed using existing sparsebundle backups. If this doesn't work for you, it should be straightforward to revert to Netatalk 2.1.5, assuming you followed the backup instructions.
Hopefully by the Fall, Netatalk 2.2 will be in FreeBSD ports and will make its way to FreeNAS 8.x.
---------------
UPDATE 4:
Update for complete Avahi integration:
This would be alot easier with a newer version of Avahi on FreeNAS and also having Netatalk compiled with Avahi support, but for now, for total OS X nirvana, the remaining steps can be followed:
For those that started using the tarballs earlier this week, the creation of /usr/local/etc/netatalk/ is an important step as it lets Netatalk generate and store UUIDs for volumes you have marked for Time Machine in the GUI or command line (indicated by options:tm in AppleVolumes.default).
After starting Netatalk with that directory created, you should connect from your Mac to your Time Machine share(s). You can then disconnect.
If you then look in the /usr/local/etc/netatalk directory you will find two files
nas#: ls -l /usr/local/etc/netatalk
afp_signature.conf
afp_voluuid.conf
The second one is of interest and will help us better define the adisk.service file - which is key to getting these shares visible to Time Machine without first mounting them.
So look inside your afp_voluuid.conf and you will see something like
nas#: cat /usr/local/etc/netatalk/afp_voluuid.conf
"TMShareName1" 185CCAF0-BED9-11E0-962B-0800200C9A66
"TMShareName2" 286A9850-BED9-11E0-962B-0800200C9A66
You may have more lines, you may just have one. Either way both values on each line are important
It is also important now to make sure that this directory survives a reboot.
nas#: cp -rp /usr/local/etc/netatalk /conf/base/etc/local/
Now we can more properly edit the adisk.services file. If Avahi was integrated with Netatalk, this would all happen automagically. When Netatalk 2.2 becomes part of FreeNAS and has the link to Avahi, this entire file will be generated automagically.
So using adisk.service in the tarball, you should concentrate in the first <section> node and the <txt-record> with the uuids as the part to edit.
This should be filled out using the values from afp_voluuid.conf.
Note: You still need to add the MAC Address and server name to the first <txt-record> line.
Note: These lines are different from what you will find in adisk.service in the tarballs.
Code:
<txt-record>dk0=adVF=0xa1,adVN=TMShareName1,adVU=185CCAF0-BED9-11E0-962B-0800200C9A66</txt-record> <txt-record>dk1=adVF=0xa1,adVN=TMShareName2,adVU=286A9850-BED9-11E0-962B-0800200C9A66</txt-record> <txt-record>dk2=adVN=AnotherNonTimeMachineShare,adVU=47C29F80-BEDA-11E0-962B-0800200C9A66</txt-record>
Now for the explanations:
- dk{n} should be sequential depending on the number of shares you have
- adVF=0xa1 is the magic bit that will make these shares show up in the Time Machine 'Select Disk' window in System Preferences->Time Machine on your Mac. Or when you need to restore.
This should only be on shares that are TimeMachine backups - i.e. have options:tm in AppleVolumes.default
- For non-Time Machine shares, any UUID will do - just make sure it is different. You can generate one here: http://www.famkruithof.net/uuid/uuidgen
- Typos are easy (trust me) - double check your work.
Now save adisk.services and restart Avahi
/usr/local/etc/rc.d/avahi-daemon restart
And then check things out on your Mac.
When you are satisfied, copy the adisk.service file to /base to make sure it survives a reboot:
nas#: cp /etc/local/avahi/services/adisk.service /conf/base/etc/local/avahi/services/