Time Machine (OS X)

EON 0.60 and Time Machine with Mac OS X (Leopard & Snow Leopard)
Written/Contributed by Shahbaz Javeed Oct 25, 2011

I was able to get Time Machine to treat my EON 0.60 NAS as a Time Capsule by following these steps.  The name of the zpool I’ve used to demonstrate these steps is called mypool.  Please replace this with the name of the pool you use in your installation of EON. Any commands shown in these steps should be run as the root user.

1. Ensure the latest binary kit is installed.  This will get you some convenience utilities not available in the EON distribution out of the box.  The rest of these steps assume the binary kit is installed.

2. Download afpd-2.0.5 from http://sites.google.com/site/eonstorage/downloads.  This will get you the actual Apple Filing Protocol server that will listen for Time Machine requests.

3. Install afpd-2.0.5 into the afp directory inside your zpool:

cd /zpool
wget -O afpd-2.0.5.tar.gz “http://sites.google.com/site/eonstorage/downloads/afpd-2.0.5.tar.bz2?attredirects=0&d=1”

mkdir afp && cd afp

gzip -dc ../afpd-2.0.5.tar.gz | tar xf -

4. Create a UNIX group for all your time machine backups:

groupadd machines

5. Create a directory which will contain the time machine backups as well as other user home directories.  I’ve called that directory /mypool/backups.  If you change that name please make sure you adjust the remaining steps accordingly.
mkdir -p /mypool/backups/time-capsule

6. Create a user account for each machine that will be using the NAS as a Time Capsule.  Ensure each such machine user is in the “machines” group and is a valid UNIX username.  The example below uses “huey” as the name of one of the Macs in my home.  When asked, enter a password for the user as well and remember it well.
useradd -g machines -d /mypool/backups/huey -m huey

7. Configure afpd as follows:
    Edit /mypool/afp/etc/netatalk/AppleVolumes.default so the only two lines that are uncommented are the following.  Please note huey, dewey and louie are the accounts which are allowed to access the AFP volumes declared here.  Replace those names with the accounts you created in step 6 above

~ options:usedots,upriv allow:huey,dewey,loiue cnidscheme:cdb
/mypool/backups/time-capsule "Remote Time Capsule" options:tm,usedots,upriv allow:huey,dewey,louie cnidscheme:cdb

    Edit /mypool/afp/etc/netatalk/afpd.conf so the only line that is uncommented at the bottom is:
- -tcp -noddp -ipaddr <EON_NAS_IP> -fqdn <EON_NAS_FQDN> -uamlist uams_randnum.so,uams_dhx.so -nosavepassword -advertise_ssh

Configure atalkd.conf with the interface that the default route is running on:

        route get default | grep interface | awk '{ print $2 }' >> /mypool/afp/etc/netatalk/atalkd.conf

        Edit /mypool/afp/etc/netatalk/atalkd.conf and ensure everything but the last line is commented out.

    Edit the following lines in /mnt/eon0/.exec so afpd and mdnsd properly start when the NAS restarts.

# afp section
(cd /usr ; ln -s ../${POOL}/afp .)

/usr/afp/sbin/afpd -F /usr/afp/etc/netatalk/afpd.conf

# OS X section


export HOSTNAME=`/usr/bin/hostname`

/usr/bin/dns-sd -R `echo $HOSTNAME` _smb._tcp . 445 &

/usr/bin/dns-sd -R `echo $HOSTNAME` _ssh._tcp . 22 &

/usr/bin/dns-sd -R `echo $HOSTNAME` _sftp-ssh._tcp . 22 &

/usr/bin/dns-sd -R `echo $HOSTNAME` _http._tcp . 80 &

/usr/bin/dns-sd -R `echo $HOSTNAME` _afpovertcp._tcp . 548 &

/usr/bin/dns-sd -R `echo $HOSTNAME` _device-info._tcp . 548 model=Xserve &

Run the following command to update the USB stick or other startup medium you’re running EON from.  This way the changes are permanent and afpd will always restart when the NAS is rebooted:
/usr/bin/updimg.sh /mnt/eon0/boot/x86.eon

8. Reboot the NAS using the following command and ensure everything comes back up: