Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
VERITAS Volume Manager 3.2 Administrator's Guide: for HP-UX 11i and HP-UX 11i Version 1.5 > Chapter 8 Administering Volumes

Backing up Volumes Online

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

It is important to make backup copies of your volumes. These provide replicas of the data as it existed at the time of the backup. Backup copies are used to restore volumes lost due to disk failure, or data destroyed due to human error. VxVM allows you to back up volumes online with minimal interruption to users.

Two methods of backing up volumes online are described in the following sections: “Backing Up Volumes Online Using Mirrors”. For information on implementing off-host online backup, see Chapter 11 “Configuring Off-Host Processing”.

Backing Up Volumes Online Using Mirrors

If a volume is mirrored, it can be backed up by taking one of the data plexes offline for a period of time. This removes the need for extra disk space for the purpose of backup only. However, if the volume only has two data plexes, it also removes redundancy of the volume for the duration of the time needed for the backup to take place.

You can perform backup of a mirrored volume on an active system with these steps:

  1. Dissociate one of the volume's data plexes (vol01-01, for example) using the following command:

    # vxplex [-g diskgroup] dis plex 

    Optionally, stop user activity during this time to improve the consistency of the backup.

  2. Create a temporary volume, tempvol, that uses the dissociated plex, using the following command:

    # vxmake -g diskgroup -U gen vol tempvol plex=plex 
  3. Start the temporary volume, using the following command:

    # vxvol [-g diskgroup] start tempvol
  4. Use fsck (or some utility appropriate for the application running on the volume) to clean the temporary volume's contents. For example, you can use this command:

    # fsck -y /dev/vx/rdsk/tempvol
    NOTE: The specified device must have a valid entry in the /etc/filesystems file.
  5. Perform appropriate backup procedures, using the temporary volume.

  6. Stop the temporary volume, using the following command:

    # vxvol [-g diskgroup] stop tempvol
  7. Dissociate the backup plex from its temporary volume, using the following command:

    # vxplex [-g diskgroup] dis plex 
  8. Reassociate the backup plex with its original volume to regain redundancy of the volume, using the following command:

    # vxplex [-g diskgroup] att original_volume plex
  9. Remove the temporary volume, using the following command:

    # vxedit [-g diskgroup] rm tempvol
NOTE: If the file system is active during the period that the temporary volume is created, its contents may be inconsistent. For information on an alternative online backup method using the VxVM snapshot facility, see the next section “Backing Up Volumes Online Using Snapshots”.

Backing Up Volumes Online Using Snapshots

NOTE: You can use the procedure described in this section to create a snapshot of a RAID-5 volume and to back it up.You may need an additional license to use this feature.

VxVM provides snapshot images of volume devices using vxassist and other commands. If the fsgen volume usage type is set on a volume that contains a VERITAS File System (VxFS), the snapshot mechanism ensures the internal consistency of the file system that is backed up. For hfs and other file system types, there may be inconsistencies between in-memory data and the data in the snapshot image.

There are various procedures for doing backups, depending upon the requirements for integrity of the volume contents. The procedures require a plex that is large enough to store the complete contents of the volume. The plex can be larger than necessary, but if a plex that is too small is used, an incomplete copy results.

The recommended approach to performing volume backup from the command line, or from a script, is to use the vxassist command. The vxassist snapstart, snapwait, and snapshot tasks allow you to back up volumes online with minimal disruption to users.

The vxassist snapshot procedure consists of two steps:

  1. Running vxassist snapstart to create a snapshot mirror

  2. Running vxassist snapshot to create a snapshot volume

The vxassist snapstart step creates a write-only backup plex which gets attached to and synchronized with the volume. When synchronized with the volume, the backup plex is ready to be used as a snapshot mirror. The end of the update procedure is indicated by the new snapshot mirror changing its state to SNAPDONE. This change can be tracked by the vxassist snapwait task, which waits until at least one of the mirrors changes its state to SNAPDONE. If the attach process fails, the snapshot mirror is removed and its space is released.

Once the snapshot mirror is synchronized, it continues being updated until it is detached. You can then select a convenient time at which to create a snapshot volume as an image of the existing volume. You can also ask users to refrain from using the system during the brief time required to perform the snapshot (typically less than a minute). The amount of time involved in creating the snapshot mirror is long in contrast to the brief amount of time that it takes to create the snapshot volume.

The online backup procedure is completed by running the vxassist snapshot command on a volume with a SNAPDONE mirror. This task detaches the finished snapshot (which becomes a normal mirror), creates a new normal volume and attaches the snapshot mirror to the snapshot volume. The snapshot then becomes a normal, functioning mirror and the state of the snapshot is set to ACTIVE.

If the snapshot procedure is interrupted, the snapshot mirror is automatically removed when the volume is started.

To back up a volume with the vxassist command, use the following procedure:

  1. Create a snapshot mirror for a volume using the following command:

    # vxassist [-g diskgroup] [-b] snapstart volume 

    For example. to create a snapshot mirror of a volume called voldef, use the following command:

    # vxassist [-g diskgroup] snapstart voldef 

    The vxassist snapstart task creates a write-only mirror, which is attached to and synchronized from the volume to be backed up.

    If you start vxassist snapstart in the background using the -b option, you can use the vxassist snapwait command to wait for the creation of the mirror to complete as shown here:

    # vxassist [-g diskgroup] snapwait volume 

    If vxassist snapstart is not run in the background, it does not exit until the mirror has been synchronized with the volume. The mirror is then ready to be used as a plex of a snapshot volume. While attached to the original volume, its contents continue to be updated until you take the snapshot.

    Create as many snapshot mirrors as you need for the snapshot volume. For a backup, you should usually only require one.

    It is also possible to make a snapshot plex from an existing plex in a volume. See “Converting a Plex into a Snapshot Plex” for details.

  2. Choose a suitable time to create a snapshot. If possible, plan to take the snapshot at a time when users are accessing the volume as little as possible.

  3. Create a snapshot volume using the following command:

    # vxassist [-g diskgroup] snapshot [nmirror=N] volume snapshot

    If required, use the nmirror attribute to specify the number of mirrors in the snapshot volume.

    For example, to create a snapshot of voldef, use the following command:

    # vxassist [-g diskgroup] snapshot voldef snapvol

    The vxassist snapshot task detaches the finished snapshot mirror, creates a new volume, and attaches the snapshot mirror to it. This step should only take a few minutes. The snapshot volume, which reflects the original volume at the time of the snapshot is now available for backing up, while the original volume continues to be available for applications and users.

    If required, you can make snapshot volumes for several volumes in a disk group at the same time. See “Backing Up Multiple Volumes Using Snapshots” for more information.

  4. Use fsck (or some utility appropriate for the application running on the volume) to clean the temporary volume's contents. For example, you can use this command:

    # fsck -y /dev/vx/rdsk/snapshot
    NOTE: The specified device must have a valid entry in the /etc/filesystems file.
  5. Use a backup utility or operating system command to copy the temporary volume to tape, or to some other appropriate backup media.

    The snapshot volume occupies as much space as the original volume. To avoid wasting space, remove the snapshot volume when your backup is complete. Remove the new volume with this command:

    # vxedit [-g diskgroup] -rf rm snapshot

    Alternatively, you can merge the snapshot copy with the original volume (provided it was not a RAID-5 volume) as described in the section, “Merging a Snapshot Volume (snapback)”, or dissociate it entirely from the original volume as described in “Dissociating a Snapshot Volume (snapclear)”.

Converting a Plex into a Snapshot Plex

In some circumstances, you may find it more convenient to convert an existing plex in a volume into a snapshot plex rather than running vxassist snapstart. For example, you may want to do this if you are short of disk space for creating the snapshot plex and the volume that you want to snapshot contains more than two plexes.

NOTE: It is advisable to retain at least two plexes in a volume to maintain data redundancy.

To convert an existing plex into a snapshot plex for a volume on which Persistent FastResync is enabled, use the following command:

# vxplex [-g diskgroup] dcoplex=dcologplex convert \ 
  state=SNAPDONE plex

dcologplex is the name of an existing DCO log plex that is to be associated with the new snapshot plex. You can use the vxprint command to find out the name of the DCO log volume as described in “Adding a DCO and DCO Log Volume”.

For example, to make a snapshot plex from the plex trivol-03 in the 3-plex volume trivol, you would use the following command:

# vxplex dcoplex=trivol_dcl-03 convert state=SNAPDONE trivol-03

Here the DCO log plex trivol_dco_03 is specified as the DCO log plex for the new snapshot plex.

To convert an existing plex into a snapshot plex in the SNAPDONE state for a volume on which Non-Persistent FastResync is enabled, use the following command:

# vxplex [-g diskgroup] convert state=SNAPDONE plex

A converted plex is in the SNAPDONE state, and can be used immediately to create a snapshot volume.

NOTE: The last complete regular plex in a volume, an incomplete regular plex, or a dirty region logging (DRL) log plex cannot be converted into a snapshot plex.

Backing Up Multiple Volumes Using Snapshots

To make it easier to create snapshots of several volumes at the same time, the snapshot option accepts more than one volume name as its argument, for example:

# vxassist [-g diskgroup] snapshot volume1 volume2 ...

By default, each replica volume is named SNAPnumber-volume, where number is a unique serial number, and volume is the name of the volume being snapshotted. This default pattern can be overridden by using the option -o name=pattern, as described on the vxassist(1M) manual page. For example, the pattern SNAP%v-%d reverses the order of the number and volume components in the name.

To snapshot all the volumes in a single disk group, specify the option -o allvols to vxassist:

# vxassist -g diskgroup -o allvols snapshot

This operation requires that all snapstart operations are complete on the volumes. It fails if any of the volumes in the disk group do not have a complete snapshot plex in the SNAPDONE state.

Merging a Snapshot Volume (snapback)

NOTE: The information in this section does not apply to RAID-5 volumes.

Snapback merges a snapshot copy of a volume with the original volume. The snapshot plex is detached from the snapshot volume and attached to the original volume. The snapshot volume is then removed. This task resynchronizes the data in the volume so that the plexes are consistent.

NOTE: To enhance the efficiency of the snapback operation for mirrored volumes, enable FastResync on the volume before taking the snapshot, as described in “Enabling FastResync on a Volume”.

To merge a snapshot with its original volume, use the following command:

# vxassist snapback snapshot

where snapshot is the snapshot copy of the volume.

By default, the data in the original plex is used to update the merged volume. To copy the data from the replica volume instead, use the following command:

# vxassist -o resyncfromreplica snapback snapshot
CAUTION: Unmount the file system corresponding to the primary volume before using the resyncfromreplica option.

Dissociating a Snapshot Volume (snapclear)

The link between a snapshot and its original volume can be permanently broken so that the snapshot volume becomes an independent volume.

If Non-Persistent FastResync is enabled on the original volume, use the following command to dissociate the snapshot volume, snapshot:

# vxassist snapclear snapshot

If Persistent FastResync is enabled, and both the snapshot volume and the original volume are still in the same disk group, use either of the following commands to stop FastResync tracking on both volumes with respect to each other:

# vxassist snapclear volume snap_object1
# vxassist snapclear snapshot snap_object2

Here snap_object1 is the snap object in the original volume that refers to the snapshot volume, and snap_object2 is the snap object in the snapshot volume that refers to the original volume. For example, if myvol and SNAP-myvol are in the same disk group mydg, either of the following commands stops tracking for both myvol and SNAP-myvol:

# vxassist -g mydg snapclear SNAP-myvol myvol_snp
# vxassist -g mydg snapclear myvol SNAP-myvol_snp

If you have split or moved the snapshot volume and the original volume into different disk groups, you must run snapclear on the each volume separately, specifying the snap object in the volume that points to the other volume:

# vxassist snapclear volume snap_object

For example, if myvol1 and SNAP-myvol1 are in separate disk groups mydg1 and mydg2 respectively, the following commands stop the tracking on SNAP-myvol1 with respect to myvol1 and on myvol1 with respect to SNAP-myvol1:

# vxassist -g mydg2 snapclear SNAP-myvol1 myvol1_snp
# vxassist -g mydg1 snapclear myvol1 SNAP-myvol1_snp

Displaying Snapshot Information (snapprint)

The vxassist snapprint command displays the associations between the original volumes and their respective replicas (snapshot copies):

# vxassist snapprint [volume] 

Output from this command is shown in the following examples:

# vxassist -g mydg snapprint v1
V  NAME         USETYPE      LENGTH
SS SNAPOBJ      NAME         LENGTH     %DIRTY
DP NAME         VOLUME       LENGTH     %DIRTY
v  v1           fsgen        20480
ss SNAP-v1_snp  SNAP-v1      20480      4
dp v1-01        v1           20480      0
dp v1-02        v1           20480      0
v  SNAP-v1      fsgen        20480
ss v1_snp       v1           20480      0
# vxassist -g mydg snapprint v2
V  NAME         USETYPE      LENGTH
SS SNAPOBJ      NAME         LENGTH     %DIRTY
DP NAME         VOLUME       LENGTH     %DIRTY
v  v2           fsgen        20480
ss --           SNAP-v2      20480      0
dp v2-01        v2           20480      0
v  SNAP-v2      fsgen        20480
ss --           v2           20480      0

In this example, Persistent FastResync is enabled on volume v1, and Non-Persistent FastResync on volume v2. Lines beginning with v, dp and ss indicate a volume, detached plex and snapshot plex respectively. The %DIRTY field indicates the percentage of a snapshot plex or detached plex that is dirty with respect to the original volume. Notice that no snap objects are associated with volume v2 or with its snapshot volume SNAP-v2. See “How Persistent FastResync Works with Snapshots” for more information about snap objects.

If a volume is specified, the snapprint command displays an error message if no FastResync maps are enabled for that volume.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2001 Hewlett-Packard Development Company, L.P.