Tag Archives: maczfs

Using a Power Mac G5 as a ZFS Time Machine Backup Server

If you are considering setting up a home network file server using Zettabyte File Server (ZFS) technology the Power Mac G5 should be given strong consideration. For one, these machines are inexpensive, they have room for lots of disks (see G5 Jive), they are beautiful, and the network natively with your other Mac hardware using AFP.

Documentation on using OS X as a ZFS file server and Time Machine backup location is scarce. After reading about using OpenSolaris for this purpose Time Machine Volumes with ZFS and AFP and some serious trial and error I have a working implementation. To help others from struggling through it, here are my notes and I hope you find them useful.

To get started make sure you have installed MacZFS and followed the MacZFS Getting Started instructions to create a pool. How one creates a ZFS pool is highly variable, situation dependent, and very well documented, I can’t do a better job so I won’t repeat it.

Here are the baseline ZFS pools for reference, before creating a new example pool:

zpool status

pool: mercury
state: ONLINE
scrub: none requested

mercury ONLINE 0 0 0
disk0s2 ONLINE 0 0 0

errors: No known data errors

zfs list

mercury 338G 2.36T 172G /Volumes/mercury
mercury/Music 27.6G 2.36T 27.6G /Users/torsten/Music
mercury/tm-quercus 136G 364G 136G /Volumes/tm-quercus
mercury/tm-smorin 2.86G 247G 2.86G /Volumes/tm-smorin

Okay now let’s make a new pool and ready it for sharing:

-- Create that pool!
zfs create mercury/backups

-- Lets limit the backup pool to 500 GB.
zfs set quota=500G mercury/backups

chmod -R 770 /Volumes/mercury/backups/

-- Change the owner to the backup user.
chown -R torsten /Volumes/mercury/backups/

-- Tell Time Machine to recognize this as a supported device.
touch /Volumes/mercury/backups/.com.apple.timemachine.supported

So far things are pretty similar to how you’d do this on OpenSolaris, let’s take a look:

zfs list

mercury 338G 2.36T 172G /Volumes/mercury
mercury/Music 27.6G 2.36T 27.6G /Users/torsten/Music
mercury/backups 23.5K 500G 23.5K /Volumes/mercury/backups -- Our new pool!
mercury/tm-quercus 136G 364G 136G /Volumes/tm-quercus
mercury/tm-smorin 2.86G 247G 2.86G /Volumes/tm-smorin

Now we need to trick OS X into sharing our ZFS pool. Here we create a new directory in the pool. This needs to be done because, oddly, Finder will see the new pool as the parent pool.

mkdir /Volumes/mercury/backups/time-back

Since we are running OS X Panther (version 10.5), System Preferences won’t display many of the directories in the root of the OS. So, to make this new filesystem accessible to GUI we need to make a symlink in the user’s home directory.

ln -s /Volumes/mercury/backups/time-back ~/time-back

Now we are ready to share! Go to System Preferences > Sharing and add the newly created directory as a share.
Sharing pane in System Preferences

Let’s see what Time Machine thinks. First let’s mount the drive onto the Mac laptop (mine runs Lion 10.7). Open Finder and press Apple-K to connect to a server. Then type afp://[Server Name or IP]/[Share Name] like so:

Finally, open Time Machine Preferences and select the backup disk

View of Time Machine with the ZFS share visible.

** If the drive does not appear in Time Machine Preferences do this on the client (in this case the laptop):

defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1

If all went well you’re now storing your backups on ZFS to a remote server!