Backup ZFS snapshots to tape (both full and diff)

What would be the best way to implement an LTO tape-based backup system on a ZFS fileserver? I've got about 6TB that need to be backed up on a daily basis, along with an existing HP 1840 LTO4 tape drive and a bunch of tapes.

I've already got the ZFS doing automatic snapshots every day, but now want to add a layer of offline storage to this. Ideally, the resulting system would implement some sort of father/son rotation system, so I have daily diff tapes for the last two weeks along with a full backup every week.

Reading around, I've seen that some people have used a combination of zfs send / dd / tar to achieve this, but it's not clear to me exactly how this should be implemented.

Update

I've just read about zfs send -i which supposedly sends the increment between two different snapshots. While I feared this whole exercise might make me write some scripts, that should make the diff backup task a little easier. Still no idea how to handle tape changes via a script though.


Solution 1:

Take a look at the ZFS Best Practices Guide, especially the section Saving ZFS Data*. I don't think tape backups are ideal for backing up snapshots. You'd be better off telling your tape backup system to backup the ZFS filesystem itself & ignore the .zfs snapshot directory. Main thing is you just want software that understands all attributes of a ZFS filesystem. I'd suggest Bacula for that.

zfs send is for cloning data from one ZFS system to another, not for sending data to tape.

NOTE: Link used to go to:

http://www. solarisinternals .com/wiki/index.php/ ZFS_Best_Practices_Guide#Recommendations_for_Saving_ZFS_Data

But that site is now dead and the may be malicious. Name of the linked page included in case it helps anyone search.

Solution 2:

Your best bet may be to send the contents of a ZFS snapshot to tape (e.g. via tar), rather than the snapshot itself. It seems fairly common to take advantage of LVM snapshots to facilitate writing live file systems to tape, and I see no reason why you should not take advantage of ZFS snapshots instead, in much the same way. As you note, using a snapshot essentially eliminates the risk of the files changing during the backup process.

One advantage of ZFS snapshots over LVM snapshots is that you can keep ZFS snapshots afterwards without likely suffering much of a performance penalty. (By contrast, it is popular to delete LVM snapshots after backing up their contents to tape.)