Time Machine, ZFS and iSCSI
Friday, December 05, 2008 • posted by Michael Rothwell @ 7:04 AM
I have an OpenSolaris file server at home. I also have several Macs, which include Time Machine for backup services. I would like to have my household Macs back themselves up to the network server, but it's not easy to accomplish. Time Machine uses a goofy hard-link-farm method for making backups, and requires an HFS filesystem. It doesn't support network backup -- reliably. The SparseBundle format, which is used to create an HFS disk image on a remote file server, is prone to failure when the network disconnects, making future backups and restores fail until the sparsebundle is repaired (manually).
Apple is incorporating ZFS in to Snow Leopard, its next version of MacOSX. This would allow a tremendous improvement in backup service in OSX, because ZFS can make snapshots of filesystems and ship them over the network reliably. Simply having the mac make a snapshotof its local filesystem and send it to a zfs fileserver (running OpenSolaris, FreeBSD, OSX Server, Linux with fuse) would result in a reliable point-in-time backup.
Until we're all in ZFS nerdvana, I came up with another way to do backups to a network file server using Time Machine. Using Time Machine is convenient for users (my family in this case) because it has a nice, easy-to-use UI. One of ZFS' features on OpenSolaris is that it will export iSCSI targets. Using the free globalSAN iSCSI initiator for OSX, I mount an iSCSI volume from the fileserver and format it with HFS. Time Machine sees it as a regular local disk and makes backups to it as per normal. Time Machine works as expected. To prevent users (my family) from using the network backup volume as a regular disk, I hide it using SetFile:
$ SetFile -a V /Volumes/network-backup
Time Machine can still see it, but it's invisible in the Finder.
I wouldn't recommend this for computers connected via wifi, but it works very well for the iMac connected over ethernet.