ETERNUS SF AdvancedCopy Manager Operator's Guide 13.0 -AIX- |
Contents
Index
![]() ![]() |
This chapter explains the shell scripts that perform the pre- and post-processing of replication in AdvancedCopy Manager.
The shell scripts that perform the pre- and post-processing of replication start before and after replication (copy) processing.
These shell scripts contain processing code required by AdvancedCopy Manager for the copy source volume and copy destination volume.
This chapter describes the setup of preprocessing and postprocessing.
The replication preprocessing and postprocessing in AdvancedCopy Manager needs to be performed for both the replication source volume and the replication destination volume. However, the purpose for each is different.
Preprocessing and postprocessing for a replication source volume
The purpose of the processing is to freeze the replication source data in a state in which consistency is temporarily ensured. Replication source data is frozen temporarily in preprocessing, and after the replication has been created, the frozen status is released in postprocessing.
Preprocessing and postprocessing for a replication destination volume
The purpose of the processing is to prevent any application from accessing a replication destination volume during replication (copy) processing. In preprocessing, replication data for the destination is placed in access-disabled status, and after the replication has been created, this status is released in postprocessing.
Specific processing performed in preprocessing and postprocessing varies according to the data on the volume. The next section describes the preprocessing and postprocessing of a file system and a database.
The preprocessing and postprocessing for a file system is the unmount processing and mount processing of the file system. (For Windows, the processing consists of allocating and canceling a drive letter.) The preprocessing and postprocessing for the replication source volume ensure the integrity of the replication source data. The preprocessing and postprocessing for the replication destination volume are performed to make access from other processes during synchronization processing and snapshot copying impossible. If no volume is mounted and deactivate, the preprocessing and postprocessing are not performed.
When the replication target volume is a physical disk, the implementation status of the preprocessing and postprocessing for a file system is shown below. This table shows whether preprocessing and postprocessing are performed depending on the command type .It also shows the copy status upon execution of the command.
Command |
Copy status |
Source/target |
Preprocessing |
Postprocessing |
---|---|---|---|---|
Replication start command (swsrpstartsync) |
uncopy or replication establishment |
Source |
X |
X |
target |
O--*1 |
X |
||
Replication making command (swsrpmake) |
equivalence maintenance |
Source |
O |
O |
target |
X |
O--*2 |
||
Replication cancellation command (swsrpcancel) |
equivalence maintenance |
Source |
O |
O |
target |
X |
O--*2 |
||
Replication establishment |
Source |
X |
X |
|
target |
X |
X |
||
copying |
Source |
X |
X |
|
target |
X |
X |
||
Snap shot replication making command (swsrpmake) |
uncopy |
Source |
O |
O |
target |
O |
O |
O : executed, X : not executed
The postprocessing for the preprocessing performed in (1) is performed in (2). In the postprocessing in (2), re-mount is performed for the mount point where unmount was performed in the preprocessing in (1).
The preprocessing and postprocessing for a file system can be customized. The processing is started in accordance with the table above when a replication management command is executed. For replication between servers, these scripts are executed by remote execution by TCP/IP in the preprocessing and postprocessing of a volume that is not connected.
The operation image before and after processing is shown in Figure B.1.
If processing other than the standard preprocessing and postprocessing is required in the preprocessing and postprocessing, customize the scripts.
When customizing a script, strictly observe the following rules regarding error code:
Error code |
Usage |
---|---|
0-99 |
Unusable (reserved for AdvancedCopy Manager) |
100-255 |
Usable |
When the replication target is the volume group that includes logical volume in which the file system has been built, see "When the replication target is a volume group" and the script of preprocessing and postprocessing has to be customized to execute unmount/mount processing for all logical volume in which the file system has been built.
AdvancedCopy Manager does not support any functions for the preprocessing and postprocessing of a database. You will need to perform your own preprocessing and postprocessing before and after the execution of a AdvancedCopy Manager command.
The replication source volume (RepSrcPre.js) and the replication destination volume (RepDstPre.js) are prepared for a pretreatment script, and it is stored in the following directory subordinates. Please customize a script according to the necessity for processing.
In the case of non-cluster operation
/etc/opt/FJSVswsrp/sh directory subordinate
In the case of cluster operation
/etc/opt/FJSVswsrp/<logic node name>/sh directory subordinate
RepSrc.pre (copy source volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2004-2006 5: 6: # 7: # Preprocessing of Replication(Source) processing 8: # 9: # Argument: $1 Device name of Source disk 10: # $2 Reserve 11: # 12: # Error number 13: # 2: Argument error(system error) 14: # 10: umount error 15: # 99: Script not customize 16: 17: # Argument check 18: case $# in 19: 2) 20: ;; 21: *) 22: exit 2 23: ;; 24: esac 25: 26: device=$1 27: 28: # Determination of postprocessing file name 29: if [ "`echo $device | /usr/bin/grep "/dev/hdisk"`" != "" ] 30: then 31: dev_type="lvm_pv" 32: # /dev/hdisk? -> hdisk? 33: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 34: 35: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 36: then 37: dev_type="vxvm_pv" 38: # /dev/vx/dmp/device -> device 39: dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`" 40: 41: elif [ "`echo $device | /usr/bin/grep "/dev/"`" != "" ] 42: then 43: dev_type="lvm_vg" 44: # /dev/VG_Name -> VG_Name 45: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 46: 47: else 48: # Other Volume 49: exit 0 50: fi 51: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 52: 53: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 54: 55: # When the Source disk is a volume group ################################### 56: if [ "$dev_type" = "lvm_vg" ] 57: then 58: 59: # Devices are volume group and script not customize 60: exit 99 61: 62: # When devices of volume group can be unmounted 63: # Specify the name of volume group to unmount 64: if [ "$device" = "/dev/vg**" ] 65: then 66: echo "mount" > $post_file 67: 68: # Unmount all logical volumes of the volume group 69: mount_point="/**" 70: /usr/sbin/umount $mount_point 2>/dev/null 71: if [ $? != 0 ] 72: then 73: retry_count=3 74: sleep_time=1 75: result_flag=1 76: 77: while [ $retry_count -gt 0 ] 78: do 79: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 80: if [ $? != 0 ] 81: then 82: retry_count=`expr $retry_count - 1` 83: /usr/bin/sleep $sleep_time 84: else 85: /usr/bin/rm -f $err_log_path/$dev.umount 86: result_flag=0 87: break 88: fi 89: done 90: 91: if [ $result_flag != 0 ] 92: then 93: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 94: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 95: exit 10 96: fi 97: fi 98: 99: # mount_point="/**" 100: # /usr/sbin/umount $mount_point 2>/dev/null 101: # if [ $? != 0 ] 102: # then 103: # retry_count=3 104: # sleep_time=1 105: # result_flag=1 106: # 107: # while [ $retry_count -gt 0 ] 108: # do 109: # /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 110: # if [ $? != 0 ] 111: # then 112: # retry_count=`expr $retry_count - 1` 113: # sleep $sleep_time 114: # else 115: # rm -f $err_log_path/$dev.umount 116: # result_flag=0 117: # break 118: # fi 119: # done 120: # 121: # if [ $result_flag != 0 ] 122: # then 123: # /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 124: # /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 125: # exit 10 126: # fi 127: # fi 128: fi 129: 130: # When the Source disk is a VxVM physical volume ############################# 131: elif [ "$dev_type" = "vxvm_pv" ] 132: then 133: # Nothing is done to VxVM physical volume. 134: echo "none" > $post_file 135: 136: # When the Source disk is a LVM physical volume ############################## 137: elif [ "$dev_type" = "lvm_pv" ] 138: then 139: # Nothing is done to LVM physical volume. 140: echo "none" > $post_file 141: fi 142: 143: exit 0 |
RepDst.pre (copy destination volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2004-2006 5: 6: # 7: # Preprocessing of Replication(Destination) processing 8: # 9: # Argument: $1 Device name of Destination disk 10: # $2 Reserve 11: # 12: # Error number 13: # 2: Argument error 14: # 10: umount error 15: # 50: varyoffvg error 16: # 99: Script not customize 17: 18: # Argument check 19: case $# in 20: 2) 21: ;; 22: *) 23: exit 2 24: ;; 25: esac 26: 27: device=$1 28: 29: # Determination of postprocessing file name 30: if [ "`echo $device | /usr/bin/grep "/dev/hdisk"`" != "" ] 31: then 32: dev_type="lvm_pv" 33: # /dev/hdisk? -> hdisk? 34: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 35: 36: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 37: then 38: dev_type="vxvm_pv" 39: # /dev/vx/dmp/device -> device 40: dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`" 41: 42: elif [ "`echo $device | /usr/bin/grep "/dev/"`" != "" ] 43: then 44: dev_type="lvm_vg" 45: # /dev/VG_Name -> VG_Name 46: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 47: 48: else 49: # Other Volume 50: exit 0 51: fi 52: 53: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 54: 55: /usr/bin/rm -rf $post_file 2> /dev/null 56: 57: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 58: 59: # When the Destination disk is a volume group ############################# 60: if [ "$dev_type" = "lvm_vg" ] 61: then 62: 63: # Devices are volume group and script not customize 64: exit 99 65: 66: # When devices of volume group can be unmounted 67: # Specify the name of volume group to unmount 68: if [ "$device" = "/dev/vg**" ] 69: then 70: printf "mount," > $post_file 71: 72: # Unmount all logical volumes of the volume group 73: mount_point="/**" 74: /usr/sbin/umount $mount_point 2>/dev/null 75: if [ $? != 0 ] 76: then 77: retry_count=3 78: sleep_time=1 79: result_flag=1 80: 81: while [ $retry_count -gt 0 ] 82: do 83: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 84: if [ $? != 0 ] 85: then 86: retry_count=`expr $retry_count - 1` 87: /usr/bin/sleep $sleep_time 88: else 89: /usr/bin/rm -f $err_log_path/$dev.umount 90: result_flag=0 91: break 92: fi 93: done 94: 95: if [ $result_flag != 0 ] 96: then 97: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 98: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 99: exit 10 100: fi 101: fi 102: 103: # mount_point="/**" 104: # /usr/sbin/umount $mount_point 2>/dev/null 105: # if [ $? != 0 ] 106: # then 107: # retry_count=3 108: # sleep_time=1 109: # result_flag=1 110: # 111: # while [ $retry_count -gt 0 ] 112: # do 113: # /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 114: # if [ $? != 0 ] 115: # then 116: # retry_count=`expr $retry_count - 1` 117: # sleep $sleep_time 118: # else 119: # rm -f $err_log_path/$dev.umount 120: # result_flag=0 121: # break 122: # fi 123: # done 124: # 125: # if [ $result_flag != 0 ] 126: # then 127: # /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 128: # /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 129: # exit 10 130: # fi 131: # fi 132: 133: fi 134: 135: # varyoff destination volume group 136: ACTIVE_VGS=`/usr/sbin/lsvg -o` 137: for i in $ACTIVE_VGS 138: do 139: if [ "$dev" = "$i" ] 140: then 141: /usr/sbin/varyoffvg $i 2> /dev/null 142: if [ $? != 0 ] 143: then 144: /usr/sbin/varyoffvg $i > $err_log_path/$dev.varyoffvg 2>&1 145: if [ $? != 0 ] 146: then 147: exit 50 148: fi 149: fi 150: printf "varyon" >> $post_file 151: break 152: fi 153: done 154: 155: # When the Destination disk is a VxVM physical volume ######################### 156: elif [ "$dev_type" = "vxvm_pv" ] 157: then 158: # Nothing is done to VxVM physical volume. 159: echo "none," > $post_file 160: 161: # When the Destination disk is a LVM physical volume ########################## 162: elif [ "$dev_type" = "lvm_pv" ] 163: then 164: # Nothing is done to LVM physical volume. 165: echo "none," > $post_file 166: 167: fi 168: 169: exit 0 |
The replication source volume (RepSrcPost) and the replication destination volume (RepDstPost) are prepared for a post-processing script, and it is stored in the following directory subordinates. Please customize a script according to the necessity for processing.
In the case of non-cluster operation
/etc/opt/FJSVswsrp/sh directory subordinate
In the case of cluster operation
/etc/opt/FJSVswsrp/<logic node name>/sh directory subordinate
RepSrc.post (copy source volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2004-2006 5: 6: # 7: # Postprocessing of Replication(Source) processing 8: # 9: # Argument: $1 Device name of Source disk 10: # 11: # Error number 12: # 2: Argument error 13: # 11: mount error 14: 15: # Argument check 16: case $# in 17: 1) 18: ;; 19: *) 20: exit 2 21: ;; 22: esac 23: 24: device=$1 25: 26: # Determination of postprocessing file name 27: if [ "`echo $device | /usr/bin/grep "/dev/hdisk"`" != "" ] 28: then 29: dev_type="lvm_pv" 30: # /dev/hdisk? -> hdisk? 31: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 32: 33: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 34: then 35: dev_type="vxvm_pv" 36: # /dev/vx/dmp/device -> device 37: dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`" 38: 39: elif [ "`echo $device | /usr/bin/grep "/dev/"`" != "" ] 40: then 41: dev_type="lvm_vg" 42: # /dev/VG_Name -> VG_Name 43: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 44: 45: else 46: # Other Volume 47: exit 0 48: fi 49: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 50: 51: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 52: 53: # Confirmation of postprocessing 54: if [ ! -r $post_file ] 55: then 56: exit 0 57: fi 58: 59: post="`/usr/bin/cat $post_file`" 60: 61: # mount processing 62: if [ "$post" = "mount" ] 63: then 64: 65: # When devices of volume group can be unmounted 66: #Specify the name of volume group to mount 67: 68: if [ "$device" = "/dev/vg**" ] 69: then 70: mount_error=0 71: # Mount all logical volumes of the volume group 72: lvname="/dev/**" 73: lv_mount_point="/**" 74: 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";}'` 75: if [ $mount_status = "not_mounted" ] 76: then 77: /usr/sbin/mount $lvname $lv_mount_point 2> /dev/null 78: if [ $? != 0 ] 79: then 80: retry_count=3 81: sleep_time=1 82: result_flag=1 83: 84: while [ $retry_count -gt 0 ] 85: do 86: /usr/sbin/mount $lvname $lv_mount_point > $err_log_path/$dev.mount 2>&1 87: if [ $? != 0 ] 88: then 89: retry_count=`expr $retry_count - 1` 90: /usr/bin/sleep $sleep_time 91: else 92: /usr/bin/rm -f $err_log_path/$dev.mount 93: result_flag=0 94: break 95: fi 96: done 97: 98: if [ $result_flag != 0 ] 99: then 100: mount_error=1 101: fi 102: fi 103: fi 104: 105: # lvname="/dev/**" 106: # lv_mount_point="/**" 107: # 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";}'` 108: # if [ $mount_status = "not_mounted" ] 109: # then 110: # /usr/sbin/mount $lvname $lv_mount_point 2>/dev/null 111: # if [ $? != 0 ] 112: # then 113: # retry_count=3 114: # sleep_time=1 115: # result_flag=1 116: # 117: # while [ $retry_count -gt 0 ] 118: # do 119: # /usr/sbin/mount $lvname $lv_mount_point > $err_log_path/$dev.mount 2>&1 120: # if [ $? != 0 ] 121: # then 122: # retry_count=`expr $retry_count - 1` 123: # /usr/bin/sleep $sleep_time 124: # else 125: # rm -f $err_log_path/$dev.mount 126: # result_flag=0 127: # break 128: # fi 129: # done 130: # 131: # if [ $result_flag != 0 ] 132: # then 133: # mount_error=1 134: # fi 135: # fi 136: # fi 137: 138: if [ $mount_error != 0 ] 139: then 140: exit 11 141: fi 142: fi 143: fi 144: 145: /usr/bin/rm -rf $post_file 2> /dev/null 146: exit 0 |
RepDst.post (Copy destination volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2004-2006 5: 6: # 7: # Postprocessing of Replication(Destination) processing 8: # 9: # Argument: $1 Device name of Destination disk 10: # 11: # Error number 12: # 2: Argument error 13: # 11: mount error 14: # 53: chdev error 15: # 54: exportvg error 16: # 56: recreatevg error 17: # 52: chfs error 18: 19: # Reconstruct volume group function. 20: ReconstructVG () 21: { 22: 23: # delete PV temporally. 24: /usr/sbin/chdev -l $pvname -a pv=clear > /dev/null 2>&1 25: if [ $? != 0 ] 26: then 27: /usr/sbin/chdev -l $pvname -a pv=clear > $err_log_path/$dev.chdev 2>&1 28: if [ $? != 0 ] 29: then 30: return 53 31: else 32: /usr/bin/rm -f $err_log_path/$dev.chdev 33: fi 34: fi 35: 36: # export destination volume group 37: /usr/sbin/exportvg $dev > /dev/null 2>&1 38: if [ $? != 0 ] 39: then 40: /usr/sbin/exportvg $dev > $err_log_path/$dev.exportvg 2>&1 41: if [ $? != 0 ] 42: then 43: return 54 44: else 45: /usr/bin/rm -f $err_log_path/$dev.exportvg 46: fi 47: fi 48: 49: # recreate destination volume group 50: prefix="/fs" 51: /usr/sbin/recreatevg -l $conv_file -L $prefix -y $dev $pvname > /dev/null 2>&1 52: if [ $? != 0 ] 53: then 54: /usr/sbin/recreatevg -l $conv_file -L $prefix -y $dev $pvname > $err_log_path/$dev.recreatevg 2>&1 55: if [ $? != 0 ] 56: then 57: return 56 58: else 59: /usr/bin/rm -f $err_log_path/$dev.recreatevg 60: fi 61: fi 62: 63: return 0 64: } 65: 66: # Mount Logical Volume function 67: MountLV () 68: { 69: 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";}'` 70: if [ $mount_status = "not_mounted" ] 71: then 72: /usr/sbin/mount $lvname $dst_mount_point 2> /dev/null 73: if [ $? != 0 ] 74: then 75: retry_count=3 76: sleep_time=1 77: result_flag=1 78: 79: while [ $retry_count -gt 0 ] 80: do 81: /usr/sbin/mount $lvname $dst_mount_point > $err_log_path/$dev.mount 2>&1 82: if [ $? != 0 ] 83: then 84: retry_count=`expr $retry_count - 1` 85: /usr/bin/sleep $sleep_time 86: else 87: /usr/bin/rm -f $err_log_path/$dev.mount 88: result_flag=0 89: break 90: fi 91: done 92: 93: if [ $result_flag != 0 ] 94: then 95: exit 11 96: fi 97: fi 98: fi 99: } 100: 101: # Change mount point function 102: ChangeMountPoint () 103: { 104: /usr/sbin/chfs -m $dst_mount_point $prefix$src_mount_point > /dev/null 2>&1 105: if [ $? != 0 ] 106: then 107: /usr/sbin/chfs -m $dst_mount_point $prefix$dst_mount_point > /dev/null 2>&1 108: if [ $? != 0 ] 109: then 110: /usr/sbin/chfs -m $dst_mount_point $prefix$dst_mount_point > $err_log_path/$dev.chfs 2>&1 111: if [ $? != 0 ] 112: then 113: exit 52 114: else 115: /usr/bin/rm -f $err_log_path/$dev.chfs 116: fi 117: fi 118: fi 119: } 120: 121: ############################### 122: # 123: # RepDst.post Main process. 124: # 125: ############################### 126: 127: # Argument check 128: case $# in 129: 1) 130: ;; 131: *) 132: exit 2 133: ;; 134: esac 135: 136: device=$1 137: 138: # Determination of postprocessing file name 139: if [ "`echo $device | /usr/bin/grep "/dev/hdisk"`" != "" ] 140: then 141: dev_type="lvm_pv" 142: # /dev/hdisk? -> hdisk? 143: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 144: 145: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 146: then 147: dev_type="vxvm_pv" 148: # /dev/vx/dmp/device -> device 149: dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`" 150: 151: elif [ "`echo $device | /usr/bin/grep "/dev/"`" != "" ] 152: then 153: dev_type="lvm_vg" 154: # /dev/VG_Name -> VG_Name 155: dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`" 156: 157: else 158: # Other Volume 159: exit 0 160: fi 161: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 162: conv_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".tmp" 163: 164: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 165: 166: # Confirmation of postprocessing 167: if [ ! -r $post_file ] 168: then 169: exit 0 170: fi 171: # When the Destination disk is a volume group ############################# 172: if [ "$dev_type" = "lvm_vg" ] 173: then 174: 175: post="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f1`" 176: vg_status="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f2`" 177: 178: if [ "$vg_status" = "varyon" ] 179: then 180: if [ "$device" = "/dev/vg**" ] 181: then 182: pvname="hdisk**" 183: 184: # decide conversion of LV name 185: /usr/bin/rm -rf $conv_file 2> /dev/null 186: echo "Srclv****:Dstlv*****" >> $conv_file 187: echo "Dstlv****:Dstlv*****" >> $conv_file 188: # echo "Srclv****:Dstlv*****" >> $conv_file 189: # echo "Dstlv****:Dstlv*****" >> $conv_file 190: 191: # Reconstruct Volume Group 192: ReconstructVG 193: result=$? 194: if [ $result != 0 ] 195: then 196: exit $result 197: fi 198: 199: # delete tmpfile 200: /usr/bin/rm -rf $conv_file 2> /dev/null 201: fi 202: fi 203: 204: if [ "$device" = "/dev/vg**" ] 205: then 206: 207: # decide new mount point 208: lvname="/dev/**" 209: src_mount_point="/**" 210: dst_mount_point="/**" 211: 212: if [ "$vg_status" = "varyon" ] 213: then 214: # Change mount point 215: ChangeMountPoint 216: fi 217: 218: if [ "$post" = "mount" ] 219: then 220: # Mount all logical volumes of the volume group 221: MountLV 222: fi 223: 224: # lvname="/dev/**" 225: # src_mount_point="/**" 226: # dst_mount_point="/**" 227: # 228: # if [ "$vg_status" = "varyon" ] 229: # then 230: # # Change mount point 231: # ChangeMountPoint 232: # fi 233: # 234: # if [ "$post" = "mount" ] 235: # then 236: # # Mount all logical volumes of the volume group 237: # MountLV 238: # fi 239: 240: fi 241: fi 242: 243: /usr/bin/rm -rf $post_file 2> /dev/null 244: exit 0 245: |
When the volume group containing the logic volume by which the file system was built is a replication object, it is necessary to correct an order processing script.
Please correct the comment of the 64-128th lines in preprocessing script of original volume, and 68-142th line in post processing script of original volume by the editor etc., and modify the comment sentence so that the unmount/mount processing is carried out for all logical volumes in which a file system is constructed. (Please change the part shown by "*" according to an actual environment. Moreover, please describe it according to the number to be processed the processing of the 99-127th line of the preprocessing script of original volume and the processing of the 105-136nd line of the post processing script of original volume.
Please correct the comment of the 68-133th lines in preprocessing script of replica volume, and 180-201th and 204-240th line in post processing script of replica volume by the editor etc., and modify the comment sentence so that the unmount/mount processing is carried out for all logical volumes in which a file system is constructed. (Please change the part shown by "*" according to an actual environment. Moreover, please describe it according to the number to be processed the processing of the 103-131th line of the preprocessing script of replica volume and the processing of the 188-189th and 224-238th line of the post processing script of replica volume.
The procedure for editing the post-processing script for the replica volume is given below.
Specify the physical volume name of the replica volume on line 182.
Specify the correspondence between the logical volume names of the original volume and replica volume in quotation marks on line 186. Use "logical volume name of original volume:logical volume of replica volume" as the format. If the original volume includes multiple logical volumes, specify the correspondence for each logical volume.
Specify the logical volume name of the replica volume in quotation marks on line 187. Use "logical volume name of replica volume:logical volume name of replica volume" as the format. If the replica volume contains multiple logical volumes, specify all of the logical volume names on line 187.
Specify the volume name of the replica volume on line 208.
On line 209, specify the mount point of the logical volume of the original volume specified on line 208.
On line 210, specify the mount point of the logical volume of the replica volume specified on line 208.
After making the necessary corrections to the script, convert the exit statements on line 60 of the original volume pre-processing script and line 64 of the replica volume pre-processing script 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 processing statements on lines 212 to 217 of the replica volume post-processing script into comments ("#").
Note that unmount/mount processing to a volume group is not carried out in the state where not customized.
Please correct suitably parameters, options, etc. of the OS command, such as the mount command and the fsck command, according to employment.
If the operation involves activation of the replica volume group, the replica volume post-processing script rewrites (recreatevg) the LVM management information. This processing may take a long time.
Customize of a preprocessing and postprocessing script is needed, when performing cluster oprating by VERITAS Cluster Server, and when mount point of original/source volume is registered into cluster transaction.
Please change unmount/mount processing in preprocessing and postprocessing script into offline/online processing of mount point resource.
Moreover, the Volume is actually after doing offline/online of mount point resource and there will be a time difference by the time mount/unmount is done.
Therefore, please add the processing (The Result of sleep and the df Command is observed) meets until mount/unmount is actually done after the location where the success or failure of offline/online is judged.
The examples below show how the preprocessing and postprocessing scripts are modified.
[Example] unmount processing change of source volume preprocessing script (RepSrc.pre)
[lines 70,79,100,109th]
(Before change) |
/usr/sbin/umount $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[Example] unmount wait processing addtion of source volume preprocessing script (RepSrc.pre)
[line 98,128h]
(addition) |
mount_status="mounted" |
[Example] unmount processing change of destination volume preprocessing script (RepDst.pre)
[lines 74,83,104,113rd]
(Before change) |
/usr/sbin/umount $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[Example] unmount wait processing addtion of destination volume preprocessing script (RepDst.pre)
[line 102,132nd]
(addition) |
mount_status="mounted" |
[Example] mount processing change of source volume postprocessing script (RepSrc.post)
[lines 77,86,110,119th]
(Before change) |
/usr/sbin/mount $lvname $lv_mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[Example] mount wait processing addtion of source volume postprocessing script (RepSrc.post)
[line 104,137th]
(addition) |
mount_status="not_mounted" |
[Example] mount processing change of destination volume postprocessing script
[lines 72,81st]
(Before change) |
/usr/sbin/mount $lvname $lv_mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[Example] mount wait processing addtion of destination volume postprocessing script
[line 99th]
(addition) |
mount_status="not_mounted" |
Contents
Index
![]() ![]() |