I have an older computer running Ubuntu OS sitting under my desk. I keep it around to run stray things like an IRC proxy and experimental dev & systems tools. It’s not a particularly powerful machine but it does have a 250 gigabyte hard drive in it that goes mostly unused. After upgrading my primary laptop to Apple’s new Lion OS last week, I decided to try and put that extra disk space to use storing Time Machine backups. It turned out to be pretty easy to setup.
Connecting Time Machine to a mounted drive
Time Machine automatically handles backing-up your computer’s state to an external drive. Typically the external drive is connected with a USB cable but Time Machine also supports connecting wirelessly to a drive connected to an Airport router. With a minor configuration change you can connect to other non-Airport connected network drives.
The first step was getting my Ubuntu server to make a disk share visible to my Apple laptop. Netatalk is an open source AppleTalk protocol fileserver. Avahi broadcasts resources using the sample protocol as Bonjour to make your new drive show up other machines.
Lion & Netatalk compatability
One pitfall here is that Netatalk versions < 2.2.0 do not work with Lion. Lion will connect to the drive but Time Machine reports that it is not compatible. There is no 2.2.0 package yet for Ubuntu. So you’ll want to install the Netatalk package to get all the dependencies and then manually compile the 2.2.0 release to get it up to date.
## Install Netatalk sudo apt-get install netatalk ## Compile latest Netatalk sudo apt-get install libdb4.8-dev libcrack2-dev libssl-dev wget http://sourceforge.net/projects/netatalk/files/netatalk/2.2/netatalk-2.2.0.tar.gz tar xvf netatalk-2.2.0.tar.gz cd netatalk-2.2.0 ./configure -enable-debian -enable-zerconf make sudo make install ## Update Netatalk configs sudo vim /etc/netatalk/AppleVolumes.default ## Comment out ~/ home directory entry in the file ## Add just below it: ## /backup/TimeMachine "TimeMachine" options:tm ## Install avahi sudo apt-get install avahi-daemon ## Create new config file: sudo vim /etc/avahi/services/afpd.service ## Add this to new file: <service-group> <name replace-wildcards=”yes”>%h</name> <service> <type>_afpovertcp._tcp</type> <port>548</port> </service> <service> <type>_device-info._tcp</type> <port>0</port> <txt-record>model=Xserve</txt-record> </service> </service-group> ## Restart netatalk and avahi sudo service netatalk restart sudo service avahi-daemon restart ## Create user ## (Take note of the password you enter here.) sudo adduser timemachine ## Create folder sudo mkdir /backup sudo mkdir /backup/TimeMachine sudo chown timemachine /backup/TimeMachine
Now you need to connect to the new drive share and setup Time Machine on your Apple computer to use it.
First, enable Time Machine to use unsupported drives. Open terminal and run this:
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
Open Finder. From the menu bar, select “Go” then “Connect to Server”
In the server address, enter:
afp://timemachine@(**your ubuntu machine's domain name or ipaddress**)/
Click connect. Enter username timemachine and the password you entered earlier. The drive should then mount and open.
Open Time Machine, and click “Select Disk…” Choose the mounted drive that you just opened. If prompted for credentials, reenter them. Enable Time Machine and the first backup should fire up.
These posts were helpful in getting this setup: