The method to customize the shell script for replication pre/post-processing is explained below.
When the Replication target is a volume group
When replicating a file system which is part of a logical volume in a volume group, the processing scripts will need to be modified as follows:
Modify the coding in lines 64 to 128 of the replication source volume pre-processing script and in lines 68 to 142 of the replication source volume post-processing script such that dismount and mount processing is performed for all the logical volumes comprising the file system. (Change the parts marked "X" to match the actual environment. Also, remove the comment characters from lines 99-127 of the source volume pre-processing script (RepSrc.pre), and from lines 105-136 of the source volume post-processing script (RepSrc.post). If more than two logical volumes are being processed then repeat lines 99-127 of RepSrc.pre and lines 105-136 of RepSrc.post, once for each additional logical volume.
Modify the coding in lines 68 to 133 of the replication destination volume pre-processing script and in lines 180 to 201 and lines 204 to 240 of the replication destination volume post-processing script such that dismount and mount processing is performed for all the logical volumes comprising the file system. Change the parts marked "X" to match the actual environment. Also, remove the comment characters from lines 103-131 of the destination volume pre-processing script (RepDst.pre), and lines 188-189 and 224-238 of the destination volume post-processing script (RepDst.post). If more than two logical volumes are being processed then repeat lines 103-131 of RepDst.pre and lines 188-189 and 224-238 of RepDst.post, once for each additional logical volume.
The procedure for editing the destination volume post-processing script is given below:
Specify the physical volume name of the destination volume on line 182.
Specify the correspondence between the logical volume names of the source volume and destination volume in quotation marks on line 186. Use "logical volume name of source volume:logical volume of destination volume" as the format. If the source volume includes multiple logical volumes, specify the correspondence for each logical volume. This must be specified even when the logical volume is not mounted.
Specify the logical volume name of the destination volume in quotation marks on line 187, in the format "logical volume name of destination volume:logical volume name of destination volume". If the destination volume contains multiple logical volumes, specify all of the logical volume names on line 187. This must be specified even when the logical volume is not mounted.
Specify the volume name of the destination volume on line 208.
On line 209, specify the mount point of the logical volume of the source volume specified on line 208.
On line 210, specify the mount point of the logical volume of the destination volume specified on line 208.
After making the necessary corrections to the script, convert the exit statements on line 60 of the source volume pre-processing script and line 64 of the destination volume pre-processing script (RepDst.pre) into comments ("#").
If the volume group to be replicated includes a logical volume for which no file system has been built, make the above corrections and then convert the statements on lines 212 to 217 of the destination volume post-processing script (RepDst.post) into comments ("#").
Note
Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.
Modify the parameters and options of the OS commands (such as the mount command and the fsck command), appropriately for their use.
If the operation involves activation of the destination volume group, the destination volume post-processing script rewrites (recreatevg) the LVM management information. This processing may take a long time.
Cluster operation using VERITAS Cluster Server
Customization of the pre-processing and post-processing scripts is required when performing cluster operations using VERITAS Cluster Server, and when the mount point of the original/source volume is registered in the cluster transaction.
Change unmount/mount processing in the pre-processing and post-processing scripts into offline/online processing of the mount point resource.
The mount point resource relating to the Volume is immediately offline/online whilst there will be a time delay before access is actually prevented when mount/unmount is used.
Please note that once the offline/online command is issued there will be a delay before the mount/unmount command can be executed. The "sleep" and "df" commands can be used to delay the mount/unmount until after the process that sets the volumes online or offline has completed.
The examples below show how the pre-processing and post-processing scripts are modified.
[lines 70, 79, 100 and 109]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[lines 98 and 128]
(addition) | mount_status="mounted" while [ $mount_status = "mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/XXXXX 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |
[lines 74, 83, 104 and 113]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[lines 102 and 132]
(addition) | mount_status="mounted" while [ $mount_status = "mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=/dev/XXXXX 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |
[lines 77, 86, 110 and 119]
(before change) | /usr/sbin/mount $lvname $lv_mount_point |
(after change) | /opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[lines 104 and 137]
(addition) | mount_status="not_mounted" while [ $mount_status = "not_mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |
[lines 72 and 81]
(before change) | /usr/sbin/mount $lvname $lv_mount_point |
(after change) | /opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[line 99]
(addition) | mount_status="not_mounted" while [ $mount_status = "not_mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |