An image of a tape drive in an Ultra 80

With a slight hint of cruelty (I believe) another of the things the guys wanted me to look at when joining the ZFS testing team, was to see whether existing backup programs can correctly back up the contents of ZFS file systems.

I say cruelty, because having never messed about with these sorts of enterprise backup programs before, I just happily agreed to take on the task and got on with it, without knowing what a pain in the neck these things were to get running. Apart from just the traditional tools like tar and cpio, we were interested in seeing whether Veritas NetBackup would be able to backup files on ZFS. I should point out, that this was in no way detailed, in-depth testing of Veritas NetBackup with ZFS – more that it was sanity testing on our behalf to see that nothing untoward was happening. ISVs tend to do their own rounds of qualification to ensure their software runs on Solaris (though Sun will do all we can to help those guys out: there was an article on BigAdmin about this a while back)

Anyway, after a certain amount of whinging (and a little bad language – sorry Mum!) I finally got NetBackup working and backing up files (though to this day, I can’t seem to persuade it not to eject tapes after completing a backup job). I was happy to see that, yes – it works! Now, I should qualify that statement a little more : it backs up and restores both simple files and files with extended file attributes with no trouble.

Things got a bit more complex when I looked at files with ACLs (access control lists). ZFS has a new implementation of ACLs, modelled on NFSv4 ACLs that Mark,
Sam and Lisa have talked about in the past. These have more features than the older POSIX-draft ACLs (but there’s a tin opener on my desk here, and I’m absolutely determined not to use it on that container of annelids). To cut a long story short, I found that NetBackup wasn’t able to backup/restore files with these more complex ACLs – the files are backed up and restored, but the ACLs get silently dropped, so there’s a bug logged against Veritas to get them to fix this. If ACLs aren’t important to you though, then you probably don’t need to worry.

Of course, thankfully there’s a really simple workaround for this problem – and indeed it works for any other backup mechanism that’s finding ZFS a bit hard to cope with. One of the features of the zfs(1M) command is the ability to do backup/restore. ZFS writes it’s own archive format, which can then be backed up normally by any backup program you like, and then restored again. There’s a good example of this in the man page, which I’ll quote here :

Example 10. Using backups

The following commands sends a full backup and then an incremental to a remote machine, restoring them into poolB/restored/fs@a and poolB/restored/fs@b, respectively. poolB must contain the file system poolB/restored, and must not initially contain poolB/restored/fs.

# zfs backup pool/fs@a | \
ssh host zfs restore poolB/restored/fs@a
# zfs backup -i pool/fs@a pool/fs@b | ssh host \
zfs restore -d poolB/restored/fs

So there you go: ZFS backup – just like the rest of ZFS, it’s really simple to use. Now all you have to remember, is to actually do your backups! (as one of my college lecturers, Joe Carthy mentioned in quintuplicate several years ago during one of our first lectures with him : “Always make a backup!” – and indeed, he advised that whenever you start using a new computer network, you should find out who’s responsible for doing the backups, get to know them well and always try to be in their good books, just in case! ;-)