This is an old revision of the document!
Mac OSX
This page is intended to offer some guidance to Mac users. The DNS-323 natively supports SAMBA (Windows) shares and so technically this means it supports Mac users, but there are a few things that you can do to make your lives a little easier!
SAMBA vs. AFP
Although SAMBA typically takes a lot of flack from Mac users, if correctly configured, the DNS-323 will play nicely. The biggest problem seems to be the lack of native mDNS support. Initially, I found the DNS-323 SAMBA mount points to be extremely slow and cumbersome in OSX compared to Windows XP. Connecting to a share (either manually in Finder via the “Go” menu, or by clicking on it under “Shared”) was painstakingly slow.
I configured AFP using Fonz' Fun-plug 0.5, and found it really snappy, but the problem remained that there was no easy way to simply select the NAS under the “Shared” section in Finder, and establish a connection via AFP. Connecting via “Go” → “Connect to server” was quick, but if I tried to browse under the “Shared” section, Finder would hang, then connect via SAMBA. I discovered that the trick was to correctly configure AVAHI/mDNS/zeroconf/Bonjour on the NAS. As soon as I did so, the differences between SAMBA and AFP were unnoticeable (at least to me).
Adding Bonjour support to the DNS-323
The easiest way to proceed is to install optware, then download and configure the avahi package. Although the process really isn't that complicated, there are a few gotchas which I will attempt to explain. Here are the steps to configure Avahi (the Linux Zeroconf implementation of Apple's Bonjour).
- Install FFP 0.5. Basically, download fun_plug and fun_plug.tgz from the following site and copy them to “Volume_1” of the DNS-323, then reboot. FFP 0.5 installs itself and you can telnet in.
- Here are the instructions for installing FFP and configuring SSH (http://wiki.dns323.info/howto:ffp)
- Install optware, following these instructions: (http://wiki.dns323.info/howto:optware)
- The optware startup script specified on the optware how-to page works, you just need to comment out the lines that echo details to the log. They really serve no purpose. If you want them, just specify the LOGFILE variable at the top of the script. You can't skip this step… it ties /opt to your ipkg opt directory.
- Be sure to add the path directive from the script to the /ffp/etc/profile file, since we installed FFP 0.5. If you don't, you'll have to manually locate “ipkg” as well as all of the other binaries that you install under /mnt/HD_a2/opt/.
- Install the avahi package (ipkg install avahi).
- Next you need to create a few groups/users for dbus and avahi to correctly function. Create the following groups, using the “addgroup” command:
addgroup avahi addgroup messagebus addgroup netdev
- Now create the following users:
adduser -S -G avahi -D -H avahi adduser -S -G messagebus -D -H messagebus
- Next, edit the /etc/group file to add the 'messagebus' and 'avahi' users to the 'netdev' group that you created above. The line should look like this after your change:
netdev:x:3:messagebus,avahi
- Save the modifications to /etc/passwd and /etc/group to flash, so that they are persistent, after you reboot:
store-password.sh
- Now you need to add one or more Avahi services.
- Change into the /opt/etc/avahi/services directory. You will see two existing files; one for ssh and one for sftp. You'll want to create one for your SAMBA shares, and possibly one for AFP (if you've installed the AFP module for FFP 0.5 or via optware.)
- The SAMBA file that you create (call it smb.service) looks like this:
<?xml version="1.0" standalone='no'?><!--*-nxml-*--> <service-group> <name replace-wildcards="yes">%h (Windows)</name> <service> <type>_smb._tcp</type> <port>139</port> </service> </service-group>
- If you create an AFP service, call it afp.service and it should contain the following:
<?xml version="1.0" standalone='no'?><!--*-nxml-*--> <!DOCTYPE service-group SYSTEM "avahi-service.dtd"> <service-group> <name replace-wildcards="yes">%h (Mac)</name> <service> <type>_afpovertcp._tcp</type> <port>548</port> </service> </service-group>
- Note that you can rename the service as you see fit, by changing the <name …> tag from ”%h (Mac)” or what have you, to whatever you like.
- Next you need to create a script to start dbus and avahi. I actually just added a couple of lines to the optware script that I put in /ffp/start (the one the ties /mnt/HD_a2/ipkg/opt to my /opt folder), back when I installed optware. Here is what I added:
# Start-up DBUS rm -rf /opt/var/run/dbus/* /opt/etc/init.d/S20dbus start # Start avahi-daemon /opt/sbin/avahi-daemon -D
- Note that the rm command deletes the PID for the previously running instance of dbus (in the event that you shutdown or reboot) since the shutdown routine does not correctly remove the PID and socket files itself. If you omit this command, the first time you reboot, or try to restart dbus, it will fail because there is an existing PID, making it think it is already running.
- Afer the script starts dbus, it starts avahi and loads your service files.
- This SHOULD be all that you need to do. At this point if you run a “ps” from the console, you should see both dbus and avahi running (it will specify the avahi hostname in brackets).
- If you can't see the processes, try executing ”/opt/etc/init,d.S20dbus start”, and “avahi-daemon” manually to see if there are some errors.
- So, if everything worked, now when you open Finder in OSX, you should see a line under “Shared” for each service that you created. If you click on the AFP service, it will try to connect via AFP and you can choose “connect as” to specify a user/pass combo. If you click on the SAMBA service, it should immediately connect via SAMBA and/or let you click “connect as” to specify your Network Access credentials. The key here is that the delay is gone, because the SMB and AFP services are explicitly defined :)
- Email me know if you have any problems! (trepex at gmail dot com)
Time Machine backups to SMB shares (no hacks required!)
Although Time Machine doesn't have any interest in using one of your AFP shares for a backup drive, it will automatically let you choose to use one of your SAMBA mounts, once you've installed and configured Avahi/Bonjour.
Basically, if your Avahi-advertise SAMBA mount is now appearing in Finder, under “Shared”, you'll also be able to just pop open Time Machine and choose that share for the backups (no hacks, no tricking it into thinking it's supported when it's not, or any of the other issues you run into for the netatalk AFP shares.