Skip to content

Instantly share code, notes, and snippets.

@cole
Created May 21, 2010 03:45
Show Gist options
  • Select an option

  • Save cole/408431 to your computer and use it in GitHub Desktop.

Select an option

Save cole/408431 to your computer and use it in GitHub Desktop.

Setting up Netatalk 2.1 on Nexenta Core 3

Why?

Netatalk file servers work great with macs. ZFS is a great filesystem for storing large amount of data. If you have a home fileserver with multiple redundant drives, this is a great setup.

How?

This setup assumes you have successfully installed Nexenta core 3, and setup your storage pool using ZFS.

sudo apt-get install libdb4.6-dev db4.6-util libssl0.9.8k-dev
wget http://prdownloads.sourceforge.net/netatalk/netatalk-2.1.tar.bz2?download
tar xvjf netatalk-2.1.tar.bz2
cd netatalk-2.1
./configure --with-pam=/usr/lib/security
make
sudo make install

Remove the legacy startup script, we'll add a better one shortly.

sudo rm /etc/rc2.d/S90netatalk
sudo cp distrib/initscripts/rc.atalk.sysv /lib/svc/method/netatalk
sudo chown root:bin /lib/svc/method/netatalk
sudo chmod 755 /lib/svc/method/netatalk
cd /usr/local/etc/netatalk
vim afpd.conf

Change the last line as follows:
-uamlist uams_dhx_passwd.so -icon -nosetpassword -noddp -tcp

vim AppleVolumes.default

Change the :DEFAULTS: line to read:

:DEFAULT: cnidscheme:dbd options:usedots,invisibledots

If you want home directories accessible, uncomment the tilde. Add other folders as follows: /tank/folder "Sharename" rwlist:user1,user2 rolist:user3 deny:user5,nobody

For time machine backup volumes, add options:tm (note: this is probably unsupported, and may fail - however, it has always worked for me):

/tank/backup "Time Machine Backup"	options:tm

Setup an SVC manifest to automatically start netatalk:

wget http://gist.github.com/raw/408425/c752bd0803de072a0aac81385ae65052e2e8cafd/svc-netatalk.xml
sudo svccfg import svc-netatalk.xml
sudo svcadm enable netatalk

Avahi setup

Avahi is an open source implementation of Bonjour. It will allow Macs on your network to autodiscover your file server.

sudo apt-get install avahi-daemon
sudo wget -O /etc/avahi/services/multi.service http://gist.github.com/raw/408422/2ae2b4196f84dececb89f3e4a8a151bc8fc205af/avahi-services.xml

Unfortunately Avahi puts a ton of startup/shutdown crap in /etc/rc0 through /etc/rc6. Delete these files, then install the SVC manifest:

wget http://gist.github.com/raw/408429/7cfd409af781e6e33c90bad46c832dba86644438/svc-avahi.xml
sudo svccfg import avahi-services.xml
sudo svcadm enable avahi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment