Rui Paulo’s blog

YAFB! Yet Another FreeBSD Blog

Apple Time Machine + FreeBSD in 14 steps.

with 11 comments

So, here’s a quick howto on how to setup Time Machine on Mac OS X so that it backups to a networked machine running FreeBSD. 

On the FreeBSD machine:

  1. Build & Install net/netatalk from ports.
  2. Edit /usr/local/etc/AppleVolumes.default
  3. Append: “/your_time_machine_path TimeMachine allow:your_user_name cnidscheme:cdb options:usedots” and replace your path and your username in the proper places.
  4. Optionally, remove the “~” already present in that file if you don’t want to share users home directories.
  5. Add “netatalk_enable=”YES”" and “afpd_enable=”YES”" to /etc/rc.conf.
  6. /usr/local/etc/rc.d/netatalk start (nothing will be printed).

On the Mac OS X machine (running Leopard, of course):

  1. Mount your remote volume. Command+K on the Finder and then type: “afp://<machine IP address or local hostname if you have a local DNS server>”. You can’t type the machine name because we’re not using multicast DNS.
  2. Build a sparse bundle image using “Disk utility” (HFS+ case-sensitive formatted). Usually, the size should be something that gives you enough room for expansion. If you want to backup your whole MacBook/iMac/etc. disk, you can set the sparse bundle image size the same as the disk your are backing up.
  3. The name of this image is important. It should be “Your_Computer_Name_MACAddress.sparsebundle”. Check your computer name from the “Sharing” section of “System Preferences” and the MAC address comes from the interface you’ll be using to do the backup. I really recommend using your Wired interface. Check the MAC address via ifconfig(1) or via the “Network”  section of “System Preferences”. E.g., if you’re John Doe, have a MacBook and your MAC address is 00:01:02:03:04:05, your file should be named “John Doe’s MacBook_000102030405.sparsebundle”.
  4. On the Terminal, type “defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1″. This is the crucial thing.
  5. Go to “System Preferences”, “Time Machine” and enable it. The networked volume will now show up on the list.
  6. Before selecting the volume on which you’ll dump the backup, copy the sparse bundle file you’ve created to your networked volume called “TimeMachine”.
  7. Select the networked Volume from the Time Machine volumes list.
  8. Initiate the backup!

Enjoy!

EDIT: As Remko points out in the comments, the MAC address is not restrictive. So, if you want to backup via wired interface and after that via wireless, Time Machine will work using both interfaces. I suppose that Time Machine inspects all MAC addresses in your machine and then searches a sparse bundle in the networked volume that matches.

Written by Rui Paulo

October 4th, 2008 at 3:47 pm

Posted in FreeBSD

11 Responses to 'Apple Time Machine + FreeBSD in 14 steps.'

Subscribe to comments with RSS or TrackBack to 'Apple Time Machine + FreeBSD in 14 steps.'.

  1. Great work Rui! This should and would really help people to get this straight!

    Note that I did the same setup a month or two ago and that I initiated it via the wired setup and now do periodic backup via wifi, i didn’t need to alter the mac address name or anything.

    Cheers
    remko

    Remko Lodder

    4 Oct 08 at 4:00 pm

  2. Apple Time Machine + FreeBSD in 14 steps….

    …”set up your Time Machine to work with FreeBSD, follow the instructions in Rui’s post, translated (Simplified Chinese)”…

  3. [...] via USB oder Firewire), für die Speicherung der Daten mit TimeMachine nutzen kann. Riu Paulo beschreibt in seinem Blog wie man Daten von seinem Mac via TimeMachine auf FreeBSD sichern kann. In gerade mal 14 Schritten [...]

    grUNIX

    4 Oct 08 at 7:10 pm

  4. [...] Machine est un utilitaire de sauvegarde avancé développé par Apple. Rui Paulo nous propose un tutoriel permettant de mettre en place Time Machine sur un Mac OS X pour sauvegarder une le contenu [...]

  5. Good job!

    Just curious: why use netatalk instead of samba?

    Next up: try using an encrypted disk image for backup security. I think I saw a how-to on macosxhints.com.

    Matt Reimer

    6 Oct 08 at 3:24 pm

  6. [...] Apple Time Machine + FreeBSD in 14 steps. at Rui Paulo’s blog (tags: storage osx howto freebsd hack leopard) [...]

  7. Matt, first of all, thanks.
    Now, to reply to your questions. Samba is slow for me. I can’t get it to cross 10MB/s on my gigabit network. afpd was quick to reach the disks’s peak speed (40MB/s), so I gave up on Samba.
    I agree that backing up to encrypted storage would be nice, but FreeBSD already comes with a nice man page describing the process (geom_eli(4)).

    Regards,
    Rui Paulo

    Rui Paulo

    7 Oct 08 at 11:15 pm

  8. [...] FreeBSD in 14 steps Published by Gerard on October 8, 2008 in FreeBSD. Tags: how. Here’s a quick howto on how to setup Time Machine on Mac OS X so that it backups to a networked machine running FreeBSD. [...]

  9. Just wanted to add a couple things.

    1) DO NOT TRY TO CREATE THE DISKIMAGE OVER THE NETWORK. I spent a lot of time trying to figure out why I was getting errors and it turns out to be a known bug.

    2) When you select a format for your diskimage, leave it on APM. Timemachine would not write to a GUID diskimage.

    Thanks so much Rui, I now have time machine making backups to a zfs pool!

    Chris Ruiz

    9 Oct 08 at 7:13 pm

  10. Chris, thanks. Yes, I forgot to mention that creating the disk image via network doesn’t work.

    Rui Paulo

    9 Oct 08 at 8:51 pm

  11. [...] - Apple Time Machine + FreeBSD in 14 steps. at Rui Paulo’s blog saved by mloclam2008-10-25 - Shelter Pets: Pet Adoption Myths saved by nosugarsweets2008-10-23 - [...]

Leave a Reply