Time Machine on Lion with DNS-320
The Apple File Protocol (AFP) stopped working the day I upgraded to OS X Lion. Network shares on the NAS (DNS-320, ReadyNAS Duo) can no longer be browsed through AFP because none of them supports AFP 3.X calls and the authentication standards required by Lion.
I need a fix fast! Why? My iMac’s 1TB Seagate HDD got recalled and I needed Time Machine (TM) to work before the tech guy replace it on site.
(Re)setup my compiling environment, this time for the DNS-320. Did some compiling, wrote some shell scripts and Time Machine (on OS X Lion) is working with my D-Link DNS-320 once again. Well, it still throws some CNIB warning messages when accessing the share but at least it works now. The CNIB issue is fixed with help from Ben Archer.
Prerequisites
- funplug-ed D-Link DNS-320
- telnet running on the DNS-320
- Mac running OS X Lion (10.7)
- Intermediate knowledge of Linux commands (ls, dir, cd, vi)
The following packages have been self-compiled or sourced from forums (credits: rr-m, hcdwoo).
- netatalk-2.2.0-1.tgz
- avahi-0.6.30-1.tgz
- db51-5.1.25.tgz
- libdaemon-0.14-1.tgz
- libgcrypt-1.5.0-1.tgz
- libgpg-error-1.10-1.tgz
Disabling the built-in AFP support on the DNS-320
If you have enabled AFP on the DNS-320, disable it through the web administration page on the DNS-320.
- Using a web browser, navigate to your DNS-320 web administration page
- Login to the web administration
- Navigate to Application Management –> AFP Service
- Select the Disable radio button
- Click on the Save Settings button to save
Download the six packages to the NAS’s Volume_1 (/mnt/HD/HD_a2). You can download them using your web browser or using wget.
If you intend to use wget, use the following:
- Telnet to the DNS-320’s IP address
- Navigate to Volume_1 by typing “cd /mnt/HD/HD_a2” without the quotes
- Download the six files by typing:
“wget https://www.shadowandy.net/wp/wp-content/uploads/netatalk-2.2.0-1.tgz”
“wget https://www.shadowandy.net/wp/wp-content/uploads/avahi-0.6.30-1.tgz”
“wget https://www.shadowandy.net/wp/wp-content/uploads/db51-5.1.25-1.tgz”
“wget https://www.shadowandy.net/wp/wp-content/uploads/libdaemon-0.14-1.tgz”
“wget https://www.shadowandy.net/wp/wp-content/uploads/libgcrypt-1.5.0-1.tgz”
“wget https://www.shadowandy.net/wp/wp-content/uploads/libgpg-error-1.10-1.tgz“
Installing the packages
- Telnet to the DNS-320
- Navigate to Volume_1 by typing “cd /mnt/HD/HD_a2“
- Install the six packages by typing “funpkg -i libgpg-error-1.10-1.tgz libgcrypt-1.5.0-1.tgz db51-5.1.25-1.tgz libdaemon-0.14-1.tgz avahi-0.6.30-1.tgz netatalk-2.2.0-1.tgz“
The AppleVolumes.default specifies the volumes to be accessed and by which user though AFP. All these are done automatically when you are using the built-in AFP Service. But now, you are on your own. What we will do here is to use back the last known copy of AppleVolumes.default generated by the built-in AFP service.
- Telnet to the DNS-320
- Backup the current ffp’s AppleVolumes.default by typing “mv /ffp/etc/netatalk/AppleVolumes.default /ffp/etc/netatalk/AppleVolumes.default.orig“
- Set the tm options for Time Machine to work by typing “echo “:DEFAULT: options:usedots,upriv,tm” > /ffp/etc/netatalk/AppleVolumes.default”
Note: There is a space between :DEFAULT: and options: - Copy the last known copy of AppleVolumes.default and replace the cnidscheme to dbd by typing “cat /etc/netatalk/AppleVolumes.default | sed -e ‘s/\”cdb\”/\”dbd\”/’ >> /ffp/etc/netatalk/AppleVolumes.default“
- Update the afpd.conf by typing “echo “- -tcp -noddp -uamlist uams_dhx2.so -nosavepassword” >> /ffp/etc/netatalk/afpd.conf“
Upgrading the afpd.sh shell script
- Telnet to the DNS-320
- Navigate to the shell script directory by typing “cd /ffp/start“
- Backup the current afpd.sh by typing “mv afpd.sh afpd.orig“
- Download the updated copy by typing “wget https://www.shadowandy.net/wp/wp-content/uploads/afpd_netatalk220.sh“
- Rename the updated copy to afpd.sh by typing “mv afpd_netatalk220.sh afpd.sh“
Starting the upgraded AFP service
- Telnet to the DNS-320
- Start the upgraded AFP service by typing “sh /ffp/start/afpd.sh start”
Note: if you want to make it start automatically every time, do a “chmod a+x /ffp/start/afpd.sh”
Try accessing your network shares on the DNS-320 using Finder (afp://<IP Address>/<Share name>). It should be working. If you have previously set up Time Machine backup to DNS-320. Try doing a backup to check if it works.
Notes: You might get an warning on CNIB error. I am still trying to figure out the cause so try to live with it for now. If you know what is causing it and know how to solve it, please share with me. Thanks! Ben Archer to the rescue! I have updated the guide based on his findings. It works fine now. 🙂
If you are using DNS-323, ensure that your AppleVolumes.default is not blank. Populate it with the correct entries, restart the afpd (sh /ffp/start/afpd.sh restart) and it should work. 🙂
Like to buy shadowandy a cup of Starbucks for his work?