This guide is based on this blog post: http://blog.smartcore.net.au/blazingly-fast-afp-on-a-smartos-zone/.
Find the latest image, in this case 4166f6d6-ea5f-11e4-addd-8351b159d9b6 (15.1.0), or 24648664-e50c-11e4-be23-0349d0a5f3cf (14.4.1) if you need Long Term Support (LTS).
# imgadm avail | grep base-64
c02a2044-c1bd-11e4-bd8c-dfc1db8b0182 base-64-lts 14.4.0 smartos 2015-03-03T15:55:44Z
24648664-e50c-11e4-be23-0349d0a5f3cf base-64-lts 14.4.1 smartos 2015-04-17T14:15:04Z
4166f6d6-ea5f-11e4-addd-8351b159d9b6 base-64 15.1.0 smartos 2015-04-24T08:52:36Z
Import image.
# imgadm import 4166f6d6-ea5f-11e4-addd-8351b159d9b6
Importing 4166f6d6-ea5f-11e4-addd-8351b159d9b6 ([email protected]) from "https://images.joyent.com"
Gather image 4166f6d6-ea5f-11e4-addd-8351b159d9b6 ancestry
Must download and install 1 image (124.3 MiB)
[...]
Downloaded image 4166f6d6-ea5f-11e4-addd-8351b159d9b6 (124.3 MiB)
[...]
Imported image 4166f6d6-ea5f-11e4-addd-8351b159d9b6 ([email protected])
Create virtual machine from the imported image.
# vmadm create << EOL
{
"alias": "netatalk",
"hostname": "netatalk",
"brand": "joyent",
"image_uuid": "4166f6d6-ea5f-11e4-addd-8351b159d9b6",
"max_physical_memory": 512,
"max_locked_memory": 512,
"max_swap": 1024,
"quota": 4,
"filesystems": [
{ "type": "lofs", "source": "/tank/data", "target": "/tank/data" },
{ "type": "lofs", "source": "/tank/archive", "target": "/tank/archive" }
],
"nics": [
{ "nic_tag": "admin", "ip": "10.0.2.1", "netmask": "255.255.0.0", "gateway": "10.0.0.1" }
],
"resolvers": ["8.8.8.8", "8.8.4.4"]
}
EOL
Successfully created VM <uuid>
Login to the newly created virtual machine.
# zlogin <uuid>
[Connected to zone '<uuid>' pts/2]
__ . .
_| |_ | .-. . . .-. :--. |-
|_ _| ;| || |(.-' | | |
|__| `--' `-' `;-| `-' ' ' `-'
/ ; Instance (base-64 15.1.0)
`-' https://docs.joyent.com/images/smartos/base
Set the timezone.
# vim /etc/default/init
TZ=Europe/Stockholm
Update the pkgin package manager.
# pkgin up
reading local summary...
processing local summary...
updating database: 100%
pkg_summary.bz2 100% 1981KB 990.5KB/s 1.5MB/s 00:02
processing remote summary (http://pkgsrc.joyent.com/packages/SmartOS/2015Q1/x86_64/All)...
updating database: 100%
Install compiler, build tools and cryptographic dependencies.
# pkgin in gcc47 gmake libevent libgcrypt openssl
Download and extract the latest version of Netatalk. This guide uses version 3.1.7. You can find the latest version on this page: http://sourceforge.net/projects/netatalk/files/netatalk/.
# cd ~
# wget http://sourceforge.net/projects/netatalk/files/netatalk/3.1.7/netatalk-3.1.7.tar.gz
# tar xfvz netatalk-3.1.7.tar.gz
# cd netatalk-3.1.7
Configure Netatalk before building.
# ./configure --with-ssl-dir=/opt/local --with-libevent-header=/opt/local --with-libevent-lib=/opt/local --with-libgcrypt --with-bdb=/opt/local --with-init-style=solaris --with-init-dir=/var/svc/manifest/network/ --without-pam --prefix=/opt/local
Create a symbolic link, else compilation will fail.
# ln -s /opt/local/lib /opt/local/lib/64
Build Netatalk.
# make && make install
Configure Netatalk. mimic model
sets the icon displayed in Finder. For available options see file: /System/Library/CoreServices/CoreTypes.bundle/Contents/Info.plist.
# vim /opt/local/etc/afp.conf
[Global]
server name = NAS
log file = /var/log/netatalk.log
uam list = uams_dhx.so,uams_dhx2.so
mimic model = RackMac
[Tank]
path = /tank/data
valid users = user
rwlist = user
[Archive]
path = /tank/archive
valid users = user
rwlist = user
Add group.
# groupadd nas
Add user and set password.
# useradd -g nas user
# passwd user
Change ownership of datasets.
# chown -R user:nas /tank/data
# chown -R user:nas /tank/archive
# svcadm enable svc:/network/dns/multicast:default
# svcadm enable svc:/network/netatalk:default
Add Time Machine support.
I found I needed to add “time machine = yes� to the share section of the netatalk config file to get Time Machine to recognise the share as a valid backup Destination.
Works great with that tweak!
R.
This process can now be skipped entirely. In a minimal-64 15.2.0 zone you can:
Using the following
/opt/local/etc/netatalk/afp.conf
:And the following smf manifest: