Creating and managing third-mirror break-off snapshots

Break-off snapshots are suitable for write-intensive volumes, such as database redo logs.

To turn one or more existing plexes in a volume into a break-off instant snapshot volume, the volume must be a non-layered volume with a mirror or mirror-stripe layout, or a RAID-5 volume that you have converted to a special layered volume and then mirrored. The plexes in a volume with a stripe-mirror layout are mirrored at the subvolume level, and cannot be broken off.

The attributes for a snapshot are specified as a tuple to the vxsnap make command. This command accepts multiple tuples. One tuple is required for each snapshot that is being created. Each element of a tuple is separated from the next by a slash character (/). Tuples are separated by white space.

To create and manage a third-mirror break-off snapshot

  1. To create the snapshot, you can either take some of the existing ACTIVE plexes in the volume, or you can use the following command to add new snapshot mirrors to the volume:
    # vxsnap [-b] [-g diskgroup] addmir volume [nmirror=N] \
      [alloc=storage_attributes]

    By default, the vxsnap addmir command adds one snapshot mirror to a volume unless you use the nmirror attribute to specify a different number of mirrors. The mirrors remain in the SNAPATT state until they are fully synchronized. The -b option can be used to perform the synchronization in the background. Once synchronized, the mirrors are placed in the SNAPDONE state.

    For example, the following command adds 2 mirrors to the volume, vol1, on disks mydg10 and mydg11:

    # vxsnap -g mydg addmir vol1 nmirror=2 alloc=mydg10,mydg11

    If you specify the -b option to the vxsnap addmir command, you can use the vxsnap snapwait command to wait for synchronization of the snapshot plexes to complete, as shown in this example:

    # vxsnap -g mydg snapwait vol1 nmirror=2
  2. To create a third-mirror break-off snapshot, use the following form of the vxsnap make command.
    # vxsnap [-g diskgroup] make source=volume[/newvol=snapvol]\
    {/plex=plex1[,plex2,...]|/nmirror=number]}

    Either of the following attributes may be specified to create the new snapshot volume, snapvol, by breaking off one or more existing plexes in the original volume:

    plex

    Specifies the plexes in the existing volume that are to be broken off.

    nmirror

    Specifies how many plexes are to be broken off. This attribute can only be used with plexes that are in the SNAPDONE state. (Such plexes could have been added to the volume by using the vxsnap addmir command.)

    Snapshots that are created from one or more ACTIVE or SNAPDONE plexes in the volume are already synchronized by definition.

    For backup purposes, a snapshot volume with one plex should be sufficient.

    For example, to create the instant snapshot volume, snap2myvol, of the volume, myvol, in the disk group, mydg, from a single existing plex in the volume, use the following command:

    # vxsnap -g mydg make source=myvol/newvol=snap2myvol/nmirror=1

    The next example shows how to create a mirrored snapshot from two existing plexes in the volume:

    # vxsnap -g mydg make source=myvol/newvol=snap2myvol/plex=myvol-03,myvol-04
  3. Clean the temporary volume's contents using an appropriate utility such as fsck for non-VxVM file systems and log replay for databases. Because VxVM calls VxFS and places VxFS file systems in a constant state immediately before taking a snapshot, it is not usually necessary to run fsck on a VxFS file system on the temporary volume. If a VxFS file system contains a database, it will still be necessary to perform database log replay.
  4. To backup the data in the snapshot, use an appropriate utility or operating system command to copy the contents of the snapshot to tape, or to some other backup medium.
  5. You now have the following options:

    • Refresh the contents of the snapshot. This creates a new point-in-time image of the original volume ready for another backup. If synchronization was already in progress on the snapshot, this operation may result in large portions of the snapshot having to be resynchronized.

    • Reattach some or all of the plexes of the snapshot volume with the original volume.

    • Restore the contents of the original volume from the snapshot volume. You can choose whether none, a subset, or all of the plexes of the snapshot volume are returned to the original volume as a result of the operation.

    • Dissociate the snapshot volume entirely from the original volume. This may be useful if you want to use the copy for other purposes such as testing or report generation. If desired, you can delete the dissociated volume.

    • If the snapshot is part of a snapshot hierarchy, you can also choose to split this hierarchy from its parent volumes.

More Information

Refreshing an instant space-optimized snapshot

Reattaching an instant full-sized or plex break-off snapshot

Restoring a volume from an instant space-optimized snapshot

Dissociating an instant snapshot

Splitting an instant snapshot hierarchy