| United States-English |
|
|
|
![]() |
VERITAS Volume Manager 3.5 Administrator's Guide > Chapter 8 Administering
VolumesBacking up Volumes Online |
|
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” and “Backing Up Volumes Online Using Snapshots”. For information on implementing off-host online backup, see Chapter 11 “Configuring Off-Host Processing”. 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:
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 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:
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:
When the backup is complete, you have three choices for what to do with the snapshot volume:
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.
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 \ dcologplex is the name of an existing DCO 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 volume as described in “Adding a DCO and DCO 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 plex trivol_dco_03 is specified as the DCO 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.
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 for which the snapshot is being taken. 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.
Snapback merges a snapshot copy of a volume with the original volume. One or more snapshot plexes are detached from the snapshot volume and re-attached to the original volume. The snapshot volume is removed if all its snapshot plexes are snapped back. This task resynchronizes the data in the volume so that the plexes are consistent.
To merge one snapshot plex with the original volume, use the following command: # vxassist snapback snapshot where snapshot is the snapshot copy of the volume. To merge all snapshot plexes in the snapshot volume with the original volume, use the following command: # vxassist -o allplexes snapback snapshot To merge a specified number of plexes from the snapshot volume with the original volume, use the following command: # vxassist snapback nmirror=number snapshot Here the nmirror attribute specifies the number of mirrors in the snapshot volume that are to be re-attached. Once the snapshot plexes have been reattached and their data resynchronized, they are ready to be used in another snapshot operation. By default, the data in the original volume is used to update the snapshot plexes that have been re-attached. To copy the data from the replica volume instead, use the following command: # vxassist -o resyncfromreplica snapback snapshot
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 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
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. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||