GuidesLifeTech

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

  1. funplug-ed D-Link DNS-320
  2. telnet running on the DNS-320
  3. Mac running OS X Lion (10.7)
  4. Intermediate knowledge of Linux commands (ls, dir, cd, vi)

 

Packages to be downloaded

The following packages have been self-compiled or sourced from forums (credits: rr-m, hcdwoo).

  1. netatalk-2.2.0-1.tgz
  2. avahi-0.6.30-1.tgz
  3. db51-5.1.25.tgz
  4. libdaemon-0.14-1.tgz
  5. libgcrypt-1.5.0-1.tgz
  6. 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.

  1. Using a web browser, navigate to your DNS-320 web administration page
  2. Login to the web administration
  3. Navigate to Application Management –> AFP Service
  4. Select the Disable radio button
  5. Click on the Save Settings button to save

 

Downloading the packages to your NAS

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:

  1. Telnet to the DNS-320’s IP address
  2. Navigate to Volume_1 by typing “cd /mnt/HD/HD_a2” without the quotes
  3. 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

  1. Telnet to the DNS-320
  2. Navigate to Volume_1 by typing “cd /mnt/HD/HD_a2
  3. 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

 

Setting up the AppleVolumes.default and afpd.conf

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.

  1. Telnet to the DNS-320
  2. Backup the current ffp’s AppleVolumes.default by typing “mv /ffp/etc/netatalk/AppleVolumes.default /ffp/etc/netatalk/AppleVolumes.default.orig
  3. 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:
  4. 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
  5. 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

 

  1. Telnet to the DNS-320
  2. Navigate to the shell script directory by typing “cd /ffp/start
  3. Backup the current afpd.sh by typing “mv afpd.sh afpd.orig
  4. Download the updated copy by typing “wget https://www.shadowandy.net/wp/wp-content/uploads/afpd_netatalk220.sh
  5. Rename the updated copy to afpd.sh by typing “mv afpd_netatalk220.sh afpd.sh

Starting the upgraded AFP service

  1. Telnet to the DNS-320
  2. 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”

 

Accessing network shares using the upgraded AFP service

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?

 

 

Treat shadowandy!

If these step-by-step guides have been very helpful to you and saved you a lot of time, please consider treating shadowandy to a cup of Starbucks.  

This site contains links to Amazon. These links will take you to some of the products mentioned in today’s article. As an Amazon Associate, I earn from qualifying purchases.
84 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments