Using a ZFS filesystem with Time Machine

This simple how-to explains how to get your Time Machine backups working with a ZFS filesystem. This allows you to use the features of ZFS filesystems for your Time Machine backups.

Please note this is for Mac OS X - Snow Leopard.

1) Enable unsupported network volumes on your Mac by opening a Terminal and pasting this:

[email protected]k:~ %> defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

2) Create a new ZFS filesystem and enable CIFS access to it:

[email protected]:~ %> zfs create tank/userbackups
[email protected]:~ %> zfs set sharesmb=on tank/userbackups
[email protected]:~ %> zfs set sharesmb=name=userbackups tank/userbackups
[email protected]:~ %> zfs set aclmode=passthrough tank/userbackups
[email protected]:~ %> zfs set aclinherit=passthrough tank/userbackups

You will probably want to setup the correct permissions on your new share, more details in [this post].

3) Make sure you can mount this share and write to it from your Mac.

4) Create the correct disk image:

[email protected]:~ %> /bin/bash
[email protected]:~ %> cd /Volumes/userbackups
[email protected]:~ %> SYSNAME=`scutil --get ComputerName`
[email protected]:~ %> hdiutil create -size 600G -fs HFS+J \
> -volname 'Time Machine Backups' -type SPARSEBUNDLE "${SYSNAME}.sparsebundle"
[email protected]:~ %> UUID=`system_profiler | grep 'Hardware UUID' | awk '{print $3}'`
[email protected]:~ %> cat << EOF > "${SYSNAME}.sparsebundle"/com.apple.TimeMachine.MachineID.plist
> <?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>
> </dict>
> </plist>
> EOF
[email protected]:~ %>

5) and finally, open up Time Machine. You should now see your network share as an option. Choose it, configure any excludes you want and kick off your first backup!

I’ll post a little later on restoring these backups using one of these methods:

  • Restore from Time Machine by using the boot disk
  • or by doing a standard install then using the Migration Assistant.

Good luck!

Gregory Armer avatar
About Gregory Armer
Sometimes I just want to give it all up and become a handsome billionaire.
comments powered by Disqus