System Administration Guide: Oracle Solaris Containers-Resource Management and Oracle Solaris Zones

ProcedureHow to Create a UFS Snapshot Using fssnap

This approach uses the fssnap command, which creates a temporary image of a file system intended for backup operations.

This method can be used to provide a clean, consistent backup of the zone files only, and it can be executed while zones are running. However, it is a good idea to suspend or checkpoint active applications that are updating files when the snapshot is created. An application updating files when the snapshot is created might leave these files in an internally inconsistent, truncated, or otherwise unusable state.

In the example procedure below, note the following:

Before You Begin

The destination backup is /backup/my-zone.ufsdump. You must create the directory backup under /.

  1. Become superuser, or assume the Primary Administrator role.

    To create the role and assign the role to a user, see Using the Solaris Management Tools With RBAC (Task Map) in System Administration Guide: Basic Administration.

  2. Create the snapshot.

    global# fssnap -o bs=/export /export/home

    You will see a display similar to the following:

  3. Mount the snapshot.

    global# mount -o ro /dev/fssnap/0 /mnt
  4. Back up my-zone from the snapshot.

    global# ufsdump 0f /backup/my-zone.ufsdump /mnt/my-zone

    You will see a display similar to the following:

    DUMP: Date of this level 0 dump: Thu Oct 06 15:13:07 2005
       DUMP: Date of last level 0 dump: the epoch
       DUMP: Dumping /dev/rfssnap/0 (pc2:/mnt) to /backup/my-zone.ufsdump.
       DUMP: Mapping (Pass I) [regular files]
       DUMP: Mapping (Pass II) [directories]
       DUMP: Writing 32 Kilobyte records
       DUMP: Estimated 176028 blocks (85.95MB).
       DUMP: Dumping (Pass III) [directories]
       DUMP: Dumping (Pass IV) [regular files]
       DUMP: 175614 blocks (85.75MB) on 1 volume at 2731 KB/sec
  5. Unmount the snapshot.

    global# umount /mnt
  6. Delete the snapshot.

    global# fssnap -d /dev/fssnap/0

    Note that the snapshot is also removed from the system when the system is rebooted.