How to Create a ZFS File System Snapshot
A good practice is to create a snapshot of important data on a regular basis. Then, back up the snapshot to a disk or tape.
Starting in the OpenSolaris 2008.11 release, an automatic snapshot service is available to manage automatic snapshots. For more information, see http://wikis.sun.com/display/OpenSolarisInfo/How+to+Manage+Automatic+ZFS+Snapshots.
Steps
Start a privileged shell.
user@opensolaris:-$ pfexec bash #
In this example, the bash shell is selected. You can choose to use any shell with the pfexec command. If you support multiple versions of the SolarisTM OS, use the standard su – root command. The su command works on all Solaris versions.
- Create a file system for storing data.
For example:# /usr/sbin/zfs create rpool/export/home/data
- Create a snapshot of a ZFS file system.
For example, a snapshot called data@0805 is created. It contains all of the file system data at the time that the snapshot was taken.$ /usr/sbin/zfs snapshot rpool/export/home/data@0805
- Verify the file system snapshot.
$ /usr/sbin/zfs list -t snapshot NAME USED AVAIL REFER MOUNTPOINT rpool/export/home/data@0805 0 - 77.8M -
- (Optional) If you accidentally delete a file, you can restore it from the file system snapshot.
For example, file.3 is restored from the .zfs/snapshot/0805 directory.$ pwd /export/home/data # cp .zfs/snapshot/0805/file.3 file.3 # ls /export/home/data file.1 file.2 file.3
Tip - Review the automatic snapshot script that is included in this blog: http://blogs.sun.com/timf/entry/zfs_automatic_for_the_people.
For more information:

