Cheap Time Capsule alternative using Ubuntu 12.10

Why spent $260 for Time Capsule, when You can make Your Ubuntu to act exactly the same? Here is how to do this.

First we’re gonna install couple of things that we need for further setup:

sudo apt-get install avahi-daemon libavahi-client-dev libdb5.3-dev \
db-util db5.3-util libgcrypt11 libgcrypt11-dev

Then download the latest version of Netatalk – Open Source AFP fileserver. We’ll use netatalk 3.* because its much easier to setup as Time Capsule. Because the latest version in repositories is 2.2.* we’ll have to compile it by ourselves.

tar xvjf netatalk-3.*.tar.bz2
cd netatalk-3.*
./configure --with-init-style=debian --with-zeroconf
sudo make install

When everything is installed it’s time to do some configuration. First we’ll create a dir when we we’ll store all time machine backups.

sudo mkdir /media/Time-Machine/

Then we’ll add new user called timemachine, who will own this directory

sudo adduser timemachine
# here comes some data that You'll have to fill up
sudo chown -R timemachine. /media/Time-Machine

Now we’re ready to edit /usr/local/etc/afp.conf

; Netatalk 3.x configuration file

; Global server settings

uam list =,,,

; [Homes]
; basedir regex = /xxxx

; [My AFP Volume]
; path = /path/to/volume

[Time Machine MediaPC]

path = /media/Time-Machine
time machine = yes

Then it’s time to configure avahi-daemon which will propagate our Time Capsule over the local network.
Let’s create /etc/avahi/services/afpd.service

<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
    <name replace-wildcards="yes">TimeCapsule %h</name>

So let’s start everything

sudo service netatalk start
sudo service avahi-daemon start

# to ensure that netatalk will start on boot
sudo update-rc.d netatalk defaults

Now You can enjoy your fresh Time Capsule alternative for the cost of HDD :)

This guide should also work for Raspberry Pi, XBMCbuntu, Debian 6.


exFAT in Ubuntu 11.10

Why exFAT you are probably wondering. I have 5 different OS in my house: MediaPC is on Ubuntu 11.10, I’ve also got OSX Lion and Snow Leopard, Windows 7 and Vista. I was wondering what is the best FileSystem to work with all of them. For full support of NTFS under OSX I’ve only found paid solutions, FAT32 has it’s limitations (4GB max filesize)… after doing some research I’ve found that exFAT should be the one I’m looking for. It is natively supported by OSX and Windows (even XP!) the only thing was to make it work with my Ubuntu :) So here we go:

First we have to install fuse-ext:

sudo su -
add-apt-repository ppa:relan/exfat
apt-get update
apt-get install fuse-exfat

Now we are able to manualy mount exFAT-formatted drives. To make it automatical we’ll need to install couple more things:

apt-get install build-essential
apt-get install ncurses-dev
apt-get install util-linux

Everything should be working nicely now :)

Done on Ubuntu 11.10.32bit.