$ sudo apt-get -y install libssl-dev libgcrypt11-dev libpam0g-dev libwrap0-dev libdb-dev libavahi-client-dev libacl1-dev libldap2-dev

$ wget http://prdownloads.sourceforge.net/netatalk/netatalk-3.0.5.tar.gz

$ cd netatalk-3.0.5/

$ ./configure –with-init-style=debian

$ make

$ sudo make install

$ sudo mkdir -p /mnt/timemachine

$ sudo chown pi /mnt/timemachine

$ sudo nano /etc/fstab

デバイスは/dev/sda21でext3でフォーマット済み

$ sudo cat /etc/fstab

proc /proc proc defaults 0 0

/dev/mmcblk0p1 /boot vfat defaults 0 2

/dev/mmcblk0p2 / ext4 defaults,noatime 0 1

# a swapfile is not a swap partition, so no using swapon|off from here on, use dphys-swapfile swap[on|off] for that

/dev/sda2 /mnt/timemachine ext3 relatime 0 2

$ sudo nano /usr/local/etc/afp.conf

$ sudo cat /usr/local/etc/afp.conf

;

; Netatalk 3.x configuration file

;

[Global]

; Global server settings

mac charset = MAC_JAPANESE

uam list = uams_clrtxt.so uams_dhx.so uams_dhx2.so uams_guest.so

log file = /var/log/netatalk.log

vol preset = my default values

; [Homes]

; basedir regex = /xxxx

; [My AFP Volume]

; path = /path/to/volume

[my default values]

valid users = @pi

file perm = 0660

directory perm = 0770

[TimeMachine]

path = /mnt/timemachine

time machine = yes

vol size limit = 1000000

$ sudo chkconfig netatalk on