Integrating Symantec Veritas NetBackup With ZFS Snapshots in the Solaris 10 OSMatthew Hoskins, August 2008 File system snapshots are the bomb. Snapshots are one of those things that you can't see how you lived without, once you start using them. The ZFS file system has a particularly good implementation of snapshots. But how do we use them for backups? If you are using Symantec Veritas NetBackup, the answer might not be so obvious. At this time, there isn't really very much in the way of out-of-the-box integration with ZFS. So we have to fill in with a little scripting. Luckily, it's pretty easy. We will use a specific example of a system serving up home directories on ZFS. We want Symantec Veritas NetBackup to initiate a snapshot before it begins backing up data. This snapshot will be mounted in a standardized location. We want to make restores easy, so certain information about the ZFS file system will also be embedded. Note: This solution was tested with Symantec Veritas NetBackup 6.0 MP5 and the Solaris 10 11/06 Operating System. However, any Symantec Veritas NetBackup 4.5+ version and any Solaris version with ZFS snapshots and cloning should work. Snapshot ScriptFirst of all, we need a mechanism to create snapshots in an automated fashion. I wrote a small script called By default the script will mount the clone under Here's the source code for the script file: Install the script wherever you maintain scripts of this type. The For demonstration, we will run the commands manually to show the script's operation: # zfs.roll.snapshot /export/home daily.netbackup zfs.roll.snapshot: No clone for mypool/home zfs.roll.snapshot: Creating snapshot mypool/home@daily.netbackup zfs.roll.snapshot: Creating clone mypool/autosnapclone_home_daily.netbackup zfs.roll.snapshot: Clone mounted as /zbackup/daily.netbackup/mypool/home/export/home zfs.roll.snapshot: Done. # ls -l /export/home total 87 drwxr-xr-x 82 matt matt 142 Jul 11 19:57 frankie drwxr-xr-x 95 mark mark 162 Jul 12 18:35 mark drwxr-xr-x 82 matt matt 142 Jul 11 19:57 matt # ls -l /zbackup/daily.netbackup/mypool/home/export/home/ total 87 drwxr-xr-x 82 matt matt 142 Jul 11 19:57 frankie drwxr-xr-x 95 mark mark 162 Jul 12 18:35 mark drwxr-xr-x 82 matt matt 142 Jul 11 19:57 matt Default operation requires two positional parameters:
The snapshot name, ZFS pool name, ZFS volume name, and original mountpoint are used to compose the mountpoint for the snapshot clone. This embeds valuable information about where the data came from, which you can use in the event that you need to do a restore. Symantec Veritas NetBackup ConfigurationNext, we need to hook the The pre-backup scripts are very simple scripts, and they are well documented in the Symantec Veritas NetBackup documentation. (Use and customization of the template script is covered in the NetBackup 6.0 System Administrator's Guide for UNIX and Linux, Volume II, Chapter 5, page 260. This is available on product CDs and as a PDF.) Create a script named #!/bin/sh ############################################################### # Per-POLICY/Client NB Backup start script ############################################################### umask 022 # Parameters passed are: CLIENTNAME="$1" POLICYNAME="$2" SCHEDNAME="$3" SCHEDTYPE="$4" # ENV Vars # BACKUPID # RESTARTED (0=First run, Not Restarted, 1=Restarted job) CMAILER=/usr/local/sbin/cmailer ZFSROLLSNAPSHOT=/usr/local/sbin/zfs.roll.snapshot $ZFSROLLSNAPSHOT /export/home daily.netbackup \ > /var/log/home.zfs.reclone.log 2>&1 exit 0 You might have to modify the paths in the Obviously, if you are backing up your data from If you have multiple backup policies backing up data, you might need to carefully construct exclude lists and the paths specified under the Symantec Veritas NetBackup policy.
Comments (latest comments first)Discuss and comment on this resource in the BigAdmin Wiki
Unless otherwise licensed, code in all technical manuals herein (including articles, FAQs, samples) is provided under this License. |
BigAdmin SubscriptionsBigAdmin Areas
BigAdmin Sun Center
BigAdmin Topics | ||||||||||