Using Off-Host Processing to Back Up Cluster File Systems
Note
It is assumed that you have already prepared the volumes containing the file systems that are to be backed up as described in Setting up Volumes for Instant Snapshots.
To back up a snapshot of a mounted file system which has shared access, perform the following steps:
-
On the master node of the cluster, use the following command to make a full-sized snapshot, snapvol, of the volume containing the file system by breaking off plexes from the original volume:
# vxsnap -g volumedg make source=volume/newvol=snapvol/nmirror=N
The nmirror attribute specifies the number of mirrors, N, in the snapshot volume.
For example, to take a snapshot of the volume cfs_vol in the shared disk group exampledg:
# vxsnap -g exampledg make source=cfs_vol/newvol=scfs_vol
If the volume does not have any available plexes, or its layout does not support plex break-off, use the procedure described in Creating a Volume for Use as a Full-Sized Instant Snapshot to prepare an empty volume for the snapshot, and then use the following command to create the snapshot:
# vxsnap -g volumedg make source=volume/snapvol=snapvol
Note
This step sets up the snapshot volumes ready for the backup cycle, and starts tracking changes to the original volumes. When you are ready to make a backup, proceed to step 2.
-
On the master node, refresh the contents of the snapshot volumes from the original volume using the following command:
# vxsnap -g volumedg refresh snapvol source=vol \
[snapvol2 source=vol2]... syncing=yes
The syncing=yes attribute starts a synchronization of the snapshot in the background.
For example, to refresh the snapshot scfs_vol:
# vxsnap -g exampledg refresh scfs_vol source=cfs_vol syncing=yes
-
On the master node, use the following command to wait for the contents of the snapshot to be fully synchronous with the contents of the original volume:
# vxsnap -g volumedg syncwait snapvol
For example, to wait for synchronization to finish for the snapshots scfs_vol:
# vxsnap -g exampledg syncwait scfs_vol
Note
You cannot move a snapshot volume into a different disk group until synchronization of its contents is complete. You can use the vxsnap print command to check on the progress of synchronization.
-
On the master node, use the following command to split the snapshot volume into a separate disk group, snapvoldg, from the original disk group, volumedg:
# vxdg split volumedg snapvoldg snapvol
For example, to place the snapshot of the volume cfs_vol into the shared disk group splitdg:
# vxdg split exampledg splitdg scfs_vol
-
On the master node, deport the snapshot volume's disk group using the following command:
# vxdg deport snapvoldg
For example, to deport the disk group splitdg:
# vxdg deport splitdg
-
On the OHP host where the backup is to be performed, use the following command to import the snapshot volume's disk group:
# vxdg import snapvoldg
For example, to import the disk group splitdg:
# vxdg import splitdg
-
The snapshot volume is initially disabled following the split. Use the following commands on the OHP host to recover and restart the snapshot volume:
# vxrecover -g snapvoldg -m snapvol
# vxvol -g snapvoldg start snapvol
-
On the OHP host, use the following commands to check and locally mount the snapshot volume:
# fsck -F vxfs /dev/vx/rdsk/diskgroup/volume
# mount -F vxfs /dev/vx/dsk/diskgroup/volume mount_point
Note
On Linux, use the -t option, and on AIX, use the -V option, instead of the -F option for both commands.
For example, to check and mount the volume scfs_vol in the disk group exampledg for shared access on the mount point, /bak/mnt_pnt:
# fsck -F vxfs /dev/vx/rdsk/exampledg/scfs_vol
# mount -F vxfs /dev/vx/dsk/exampledg/scfs_vol /bak/mnt_pnt
-
Back up the file system at this point using a command such as bpbackup in VERITAS NetBackup. After the backup is complete, use the following command to unmount the file system.
# unmount mount_point
-
On the OHP host, use the following command to deport the snapshot volume's disk group:
# vxdg deport snapvoldg
-
On the master node, re-import the snapshot volume's disk group as a shared disk group using the following command:
# vxdg -s import snapvoldg
-
On the master node, use the following command to rejoin the snapshot volume's disk group with the original volume's disk group:
# vxdg join snapvoldg volumedg
For example, to join disk group splitdg with exampledg:
# vxdg join splitdg exampledg
-
The snapshot volume is initially disabled following the join. Use the following commands on the primary host to recover and restart the snapshot volume:
# vxrecover -g volumedg -m snapvol
# vxvol -g volumedg start snapvol
-
When the backup is complete, use the following command to unmount the snapshot volume, and make it ready for its contents to be refreshed from the primary volume:
# umount mount_point
When synchronization is complete, the snapshot is ready to be re-used for backup.
Caution
Before attempting to unmount the snapshot, shut down all applications that access a file system in the snapshot volume, and also unmount any such file system.
Repeat steps 2 through 14 each time that you need to back up the volume.
In some instances, such as recovering the contents of a corrupted volume, it may be useful to resynchronize a volume from its snapshot volume (which is used as a hot standby):
# vxsnap -g diskgroup restore volume source=snapvol destroy=yes|no
The destroy attribute specifies whether the plexes of the snapshot volume are to be reattached to the original volume. For example, to resynchronize the volume cfs_vol from its snapshot volume scfs_vol:
# vxsnap -g exampledg restore cfs_vol source=scfs_vol destroy=no
Note
You must unmount the file system that is configured on the original volume before attempting to resynchronize its contents from a snapshot.
Reattaching Snapshot Plexes
Note
This operation is not supported for space-optimized instant snapshots.
Using the following command, some or all plexes of an instant snapshot may be reattached to the specified original volume, or to a source volume in the snapshot hierarchy above the snapshot volume:
# vxsnap [-g diskgroup] reattach snapvol source=vol \ [nmirror=number]
By default, all the plexes are reattached, which results in the removal of the snapshot. If required, the number of plexes to be reattached may be specified as the value assigned to the nmirror attribute.
Note
The snapshot being reattached must not be open to any application. For example, any file system configured on the snapshot volume must first be unmounted.
For example the following command reattaches 1 plex from the snapshot volume, snapmyvol, to the volume, myvol:
# vxsnap -g mydg reattach snapmyvol source=myvol nmirror=1
While the reattached plexes are being resynchronized from the data in the parent volume, they remain in the SNAPTMP state. After resynchronization is complete, the plexes are placed in the SNAPDONE state.
|