Using Ubuntu for Time Machine in Snow Leopard

Over a year ago Matthias Kretschmann posted an excellent guide on how to use Ubuntu as a Time Machine backup server. The guide is quite well written all the configuration steps worked, but I received Error 45 creating backup disk image when Time Machine ran. Some more research revealed that this is because of changes to the sparse bundle image in Snow Leopard.

To make it work I had to create my own sparse bundle with a plist file in it to associate my MacBook’s unique id with the time machine image. Leopard and earlier releases of OS X would create a sparse disk image with the name from the network cards mac address, but in Snow Leopard it uses the computer Hardware UUID. I imagine this is because notebooks can have more than one mac address, one for wired and one for wireless.

How to create a sparse bundle in Snow Leopard

Step 1: Create the disk image with your computer’s name:

hdiutil create -size 500G -fs HFS+J -volname 'Time Machine Backup' -type SPARSEBUNDLE computer_name.sparsebundle

Step 2: Create a file called com.apple.TimeMachine.MachineID.plist inside the sparsebundle folder and fill it with the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>com.apple.backupd.HostUUID</key>
    <string>UUID_STRING</string>
</dict>
</plist>

Make sure you replace UUID_STRING with your unique machine identifier. This can be found by loading System Profiler (Hardware UUID).

Step 3: Transfer the sparse bundle disk image to your Ubuntu computer:

rsync -avP computer_name.sparsebundle username@ubuntumachine:~/

Linux Distributions are a Closed Software Environment

Closed? How can that be? The whole premise of most Linux Distributions is to be a free and open environment for users and developers.

What I mean is that software packages available on the web or on distributable media often don’t work on Linux. Valid examples are software from game publishers and bleeding edge software.

For example, people who use the Fedora distribution (could be SUSE, Ubuntu…) install new software packages via its package manager called yum. All packages in the repository (there are thousands) have been compiled specifically for each version of Fedora Core.

How is this a problem? It seems like an ideal universe; software is packaged and ready to go for the user, they just have to click install and BAM, it’s done.

It is beautiful and is wonderful for keeping software up to date, to stay on top of security patches, and for general system health. The problem starts when a user wants to try some bleeding edge software that’s not yet in the repository, or other software that’s just not well known enough to be in the public software repository. Yes you can add private ones, but that doesn’t solve the problem.

Users should be in full control to go to any website, download an application binary, and have it working on their system in a matter of minutes.

  • You can do this on Windows, though it gets unwieldy.
  • Mac OS X works wonderfuly because you can just drag new software into the Applications directory. It doesn’t matter if I already have Firefox 3.0 installed and I’m trying out a release candidate of Firefox 3.5. I can install it with a drag and drop, test it, and delete it with a drag and drop while leaving my system in a 100% safe state.

This should be possible on Linux.

But you might say that is the case, users can download software for Linux and run it. True nothing is stopping them, but it’s discouraged and can create problems for the system package manager. Even if packages are available for Linux, the experience can be bad.

A few days ago I tried the developers preview of Google Chrome on Linux and OS X. On Linux I spend 20 minutes trying to link up the libraries until I realized my AMD64 machine didn’t have the necessary 32bit libraries it required. So I tried it on Mac and had it working instantly.

Lets make this experience on Linux to be as simple as it is on a Mac.