Backing Up Solaris (TM) ZFS File Systems
Backing Up Solaris (TM) ZFS File Systems
Applies to:
Solaris SPARC Operating System - Version: 8.0 and later [Release: 8.0 and later ] Solaris SPARC Operating System - Version: 8.0 and later [Release: 8.0 and later] All Platforms
Goal
What is the best practice for backing up Solaris ZFS file systems?
Solution
Steps to Follow Solaris ZFS changes the way that file systems can be managed. For many situations the ideal solution for back up is to use regular snapshots and to then keep these snapshots so that users have online access to any files that are accidentally deleted or damaged. This then removes the need to recover individual files from backup as they are now stored online. Combined with using RAID in the form of RAIDZ, RAID2Z or mirrors to protect from hardware failure reduces the need for backup even further. However even with all this protection you still want to have a backup in case of a disaster.
Similar scripts can be written for using tar(1) or pax(1) depending on the functionality you require. cpio(1) has the advantage that is can support multiple tapes however if you need multiple tape support you should look to use an Enterprise back up solution. Then you can restore the files using pax(1) which can strip out the extra path components that get added due to being part of a snapshot. EG:
pax -r -s '/.zfs\/snapshot\/backup_2007051010180900023201//' \ -b $((1024 *128)) -v -x ustar < $TAPE