ETERNUS SF AdvancedCopy Manager Operator's Guide 13.0 -Solaris- |
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, the preprocessing and postprocessing are not performed.
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 C.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 |
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, 2002-2006 5: 6: # 7: # Preprocessing of Replication(Source) processing 8: # 9: # Argument: $1 Device name of Source disk 10: # $2 Mount point of Source disk 11: # 12: # Error number 13: # 2: Argument error 14: # 10: umount error 15: 16: # Argument check 17: case $# in 18: 2) 19: ;; 20: *) 21: exit 2 22: ;; 23: esac 24: 25: device=$1 26: mount_point=$2 27: 28: # Determination postprocessing file name 29: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 30: then 31: # /dev/dsk/c?t?d?s? -> c?t?d?s? 32: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 33: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 34: then 35: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 36: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 37: dev="`echo $device | /usr/bin/cut -d/ -f5`" 38: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 39: then 40: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 41: then 42: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 43: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 44: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 45: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 46: device="`echo $device | /usr/bin/cut -d: -f1`" 47: else 48: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 49: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 50: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 51: fi 52: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 53: then 54: # /dev/vx/dsk/volume -> _vx_rootdg_volume 55: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 56: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 57: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 58: then 59: # /dev/vx/dmp/device -> _vx_pv_device 60: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 61: else 62: exit 0 63: fi 64: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 65: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".sfstype" 66: 67: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 68: 69: if [ "$mount_point" != "" ] 70: # When device was mounted 71: # 72: then 73: 74: # When device cannot be unmounted 75: # 76: # if [ "$device" = "/dev/dsk/c*t*d*s*" ] 77: # then 78: # /usr/sbin/lockfs -w $mount_point > /dev/null 2>&1 79: # sync 80: # sync 81: # echo "lockfs,$mount_point" > $post_file 82: # 83: # When device can be unmounted 84: # 85: # else 86: # 87: /usr/bin/df -ln $mount_point | /usr/bin/cut -f2 -d: | /usr/bin/cut -f2 -d' ' > $fstype_file 88: 89: /usr/sbin/umount $mount_point 2>/dev/null 90: 91: if [ $? != 0 ] 92: then 93: retry_count=3 94: sleep_time=1 95: result_flag=1 96: 97: while [ $retry_count -gt 0 ] 98: do 99: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 100: if [ $? != 0 ] 101: then 102: retry_count=`expr $retry_count - 1` 103: /usr/bin/sleep $sleep_time 104: else 105: /usr/bin/rm -f $err_log_path/$dev.umount 106: result_flag=0 107: break 108: fi 109: done 110: 111: if [ $result_flag != 0 ] 112: then 113: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 114: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 115: exit 10 116: fi 117: fi 118: 119: echo "mount,$mount_point" > $post_file 120: 121: # fi 122: 123: # When device was not mounted 124: # 125: else 126: echo "none" > $post_file 127: fi 128: 129: exit 0 |
RepDst.pre (copy destination volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing of Replication(Destination) processing 8: # 9: # Argument: $1 Device name of Destination disk 10: # $2 Mount point of Destination disk 11: # 12: # Error number 13: # 2: Argument error(system error) 14: # 10: umount error 15: 16: # Argument check 17: case $# in 18: 2) 19: ;; 20: *) 21: exit 2 22: ;; 23: esac 24: 25: device=$1 26: mount_point=$2 27: 28: # Determination postprocessing file name 29: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 30: then 31: # /dev/dsk/c?t?d?s? -> c?t?d?s? 32: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 33: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 34: then 35: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 36: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 37: dev="`echo $device | /usr/bin/cut -d/ -f5`" 38: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 39: then 40: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 41: then 42: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 43: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 44: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 45: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 46: device="`echo $device | /usr/bin/cut -d: -f1`" 47: else 48: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 49: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 50: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 51: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 52: fi 53: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 54: then 55: # /dev/vx/dsk/volume -> _vx_rootdg_volume 56: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 57: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 58: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 59: then 60: # /dev/vx/dmp/device -> _vx_pv_device 61: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 62: else 63: exit 0 64: fi 65: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 66: 67: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 68: 69: if [ "$mount_point" != "" ] 70: # When device was mounted 71: # 72: then 73: 74: /usr/sbin/umount $mount_point 2>/dev/null 75: 76: if [ $? != 0 ] 77: then 78: retry_count=3 79: sleep_time=1 80: result_flag=1 81: 82: while [ $retry_count -gt 0 ] 83: do 84: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 85: if [ $? != 0 ] 86: then 87: retry_count=`expr $retry_count - 1` 88: /usr/bin/sleep $sleep_time 89: else 90: /usr/bin/rm -f $err_log_path/$dev.umount 91: result_flag=0 92: break 93: fi 94: done 95: 96: if [ $result_flag != 0 ] 97: then 98: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 99: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 100: exit 10 101: fi 102: fi 103: 104: echo "mount,$mount_point" > $post_file 105: 106: # When device was not mounted 107: # 108: else 109: echo "none" > $post_file 110: fi 111: 112: exit 0 |
To reproducing agency volume not to unmount although mounted, please make the following examples of customize reference and customize a script.
If you do not want to unmount the copy source volume
Use an editor to remove the comments ("#") on lines 76 to 81, 85, and 121 in the copy source volume preprocessing script (RepSrc.pre), and specify the target copy source volume name in the if statement on line 76.
If you do not want to unmount the copy destination volume for the copy source volume
Use an editor to remove the comments ("#") on lines 84 to 136 in the copy destination volume postprocessing script (RepDst.post), and specify the target copy destination volume name in the if statement on line 84.
This operation is possible only when the file system is one of the following two:
ufs
SynfinityFILE (single-partition configuration)
The preprocessing and postprocessing of the copy source volume in the customized script is described below.
Copy source volume status |
Copy source preprocessing |
Copy source postprocessing |
---|---|---|
Mounted |
Suppresses updating of the copy source volume |
Cancels the suppressed updating of the copy source volume |
The preprocessing and postprocessing of the copy destination volume in the customized script is described below.
Copy destination postprocessing |
---|
Check of matching of the copy destination volume |
In the employment which used the standard script, since the beginning of the cash of a file system and renewal of subsequent are deterred by unmounting a file system before an advanced copy (EC/OPC), the adjustment of the data of the whole file system is guaranteed.
Although the flash of the cash of a file system and renewal of subsequent are deterred using lockfs-w when customizing a script and not unmounting a file system, a guarantee of the contents of a file is not offered about the file in Write Open (the database space of Oracle which is supporting on-line backup removes).
Moreover, when there is a process under renewal of metadata, the data adjustment of the file system itself is not secured on the specification of lockfs, either.
Therefore, it is necessary to take into consideration and cope with it by employment about the data adjustment when not unmounting a file system.
The replication source volume (RepSrcPost.js) and the replication destination volume (RepDstPost.js) 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, 2002-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/dsk/"`" != "" ] 28: then 29: # /dev/dsk/c?t?d?s? -> c?t?d?s? 30: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 31: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 32: then 33: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 34: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 35: dev="`echo $device | /usr/bin/cut -d/ -f5`" 36: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 37: then 38: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 39: then 40: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 41: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 42: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 43: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 44: device="`echo $device | /usr/bin/cut -d: -f1`" 45: else 46: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 47: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 48: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 49: fi 50: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 51: then 52: # /dev/vx/dsk/volume -> _vx_rootdg_volume 53: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 54: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 55: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 56: then 57: # /dev/vx/dmp/device -> _vx_pv_device 58: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 59: else 60: exit 0 61: fi 62: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 63: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".sfstype" 64: 65: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 66: 67: # Confirmation of postprocessing 68: if [ ! -r $post_file ] 69: then 70: exit 0 71: fi 72: post="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f1`" 73: mount_point="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f2`" 74: 75: # Confirmation of FStype 76: if [ ! -r $fstype_file ] 77: then 78: fs="" 79: else 80: fs="`/usr/bin/cat $fstype_file`" 81: fi 82: 83: # No processing 84: if [ "$post" = "none" ] 85: then 86: /usr/bin/rm -rf $post_file 2> /dev/null 87: /usr/bin/rm -rf $fstype_file 2> /dev/null 88: exit 0 89: fi 90: 91: # mount processing 92: if [ "$post" = "mount" ] 93: then 94: /usr/bin/df -l $device > /dev/null 2>&1 95: if [ $? != 0 ] 96: then 97: if [ ! -r $fstype_file ] 98: then 99: /usr/sbin/mount $device $mount_point 2> /dev/null 100: else 101: if [ "$fs" = "" ] 102: then 103: /usr/sbin/mount $device $mount_point 2> /dev/null 104: else 105: /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null 106: fi 107: fi 108: if [ $? != 0 ] 109: then 110: retry_count=3 111: sleep_time=1 112: result_flag=1 113: 114: while [ $retry_count -gt 0 ] 115: do 116: if [ ! -r $fstype_file ] 117: then 118: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 119: else 120: if [ "$fs" = "" ] 121: then 122: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 123: else 124: /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 125: fi 126: fi 127: if [ $? != 0 ] 128: then 129: retry_count=`expr $retry_count - 1` 130: /usr/bin/sleep $sleep_time 131: else 132: /usr/bin/rm -f $err_log_path/$dev.mount 133: result_flag=0 134: break 135: fi 136: done 137: 138: if [ $result_flag != 0 ] 139: then 140: exit 11 141: fi 142: fi 143: fi 144: /usr/bin/rm -rf $post_file 2> /dev/null 145: /usr/bin/rm -rf $fstype_file 2> /dev/null 146: exit 0 147: fi 148: 149: # lockfs processing 150: if [ "$post" = "lockfs" ] 151: then 152: /usr/sbin/lockfs -u $mount_point > /dev/null 2>&1 153: /usr/bin/rm -rf $post_file 2> /dev/null 154: /usr/bin/rm -rf $fstype_file 2> /dev/null 155: exit 0 156: fi 157: 158: exit 0 |
RepDst.post (copy destination volume script)
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-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: # 12: fsck error 15: 16: # Argument check 17: case $# in 18: 1) 19: ;; 20: *) 21: exit 2 22: ;; 23: esac 24: 25: device=$1 26: 27: # Determination of postprocessing file name 28: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 29: then 30: # /dev/dsk/c?t?d?s? -> c?t?d?s? 31: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 32: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 33: then 34: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 35: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 36: dev="`echo $device | /usr/bin/cut -d/ -f5`" 37: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 38: then 39: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 40: then 41: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 42: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 43: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 44: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 45: device="`echo $device | /usr/bin/cut -d: -f1`" 46: else 47: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 48: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 49: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 50: fi 51: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 52: then 53: # /dev/vx/dsk/volume -> _vx_rootdg_volume 54: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 55: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 56: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 57: then 58: # /dev/vx/dmp/device -> _vx_pv_device 59: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 60: else 61: exit 0 62: fi 63: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 64: 65: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 66: 67: # Confirmation of postprocessing 68: if [ ! -r $post_file ] 69: then 70: exit 0 71: fi 72: post="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f1`" 73: mount_point="`/usr/bin/cat $post_file | /usr/bin/cut -d',' -f2`" 74: 75: # Confirmation of FStype 76: fs="`/usr/sbin/fstyp $device 2> /dev/null`" 77: if [ $? != 0 ] 78: then 79: fs="" 80: fi 81: 82: # When source device cannot be unmounted, fsck for destination device is needed 83: # 84: #if [ "$device" = "/dev/dsk/c*t*d*s*" ] 85: #then 86: # fsck_dev="`echo $device | sed "s/\/dsk\//\/rdsk\//"`" 87: # 88: # if [ "$fs" = "" ] 89: # then 90: # fsck -m $fsck_dev > /dev/null 2>&1 91: # else 92: # if [ "$fs" = "sfxfs" ] 93: # then 94: # sfxadm $fsck_dev > /dev/null 2>&1 95: # fsck -y -F $fs -o p,log $fsck_dev > /dev/null 2>&1 96: # else 97: # fsck -m -F $fs $fsck_dev > /dev/null 2>&1 98: # fi 99: # fi 100: # if [ $? != 0 ] 101: # then 102: # if [ "$fs" = "" ] 103: # then 104: # result="`fsck -n $fsck_dev |grep \?`" 105: # else 106: # result="`fsck -n -F $fs $fsck_dev |grep \?`" 107: # fi 108: # if [ "$result" = "FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? no" ] 109: # then 110: # if [ "$fs" = "" ] 111: # then 112: # fsck -y $fsck_dev > /dev/null 2>&1 113: # else 114: # fsck -y -F $fs $fsck_dev > /dev/null 2>&1 115: # fi 116: # if [ $? != 0 ] 117: # then 118: # if [ "$fs" = "" ] 119: # then 120: # fsck -y $fsck_dev > $err_log_path/$dev.fsck 2>&1 121: # else 122: # fsck -y -F $fs $fsck_dev > $err_log_path/$dev.fsck 2>&1 123: # fi 124: # if [ $? != 0 ] 125: # then 126: # exit 12 127: # else 128: # rm -f $err_log_path/$dev.fsck 129: # fi 130: # fi 131: # else 132: # echo "$result" > $err_log_path/$dev.fsck 133: # exit 12 134: # fi 135: # fi 136: #fi 137: 138: # No processing 139: if [ "$post" = "none" ] 140: then 141: /usr/bin/rm -rf $post_file 2> /dev/null 142: exit 0 143: fi 144: 145: # mount processing 146: if [ "$post" = "mount" ] 147: then 148: /usr/bin/df -l $device > /dev/null 2>&1 149: if [ $? != 0 ] 150: then 151: if [ "$fs" = "" ] 152: then 153: /usr/sbin/mount $device $mount_point 2> /dev/null 154: else 155: if [ "$fs" = "sfxfs" ] 156: then 157: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 158: /usr/sbin/sfxadm $dev > /dev/null 2>&1 159: fi 160: /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null 161: fi 162: if [ $? != 0 ] 163: then 164: retry_count=3 165: sleep_time=1 166: result_flag=1 167: 168: while [ $retry_count -gt 0 ] 169: do 170: if [ "$fs" = "" ] 171: then 172: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 173: else 174: if [ "$fs" = "sfxfs" ] 175: then 176: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 177: /usr/sbin/sfxadm $dev > $err_log_path/$dev.sfxadm 2>&1 178: fi 179: /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.sfxadm 2>&1 180: fi 181: if [ $? != 0 ] 182: then 183: retry_count=`expr $retry_count - 1` 184: /usr/bin/sleep $sleep_time 185: else 186: result_flag=0 187: break 188: fi 189: done 190: 191: if [ $result_flag != 0 ] 192: then 193: exit 11 194: fi 195: fi 196: fi 197: /usr/bin/rm -rf $post_file 2> /dev/null 198: exit 0 199: fi 200: 201: exit 0 |
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 89,99th]
(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 118th]
(addition) |
while /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
[Example] unmount processing change of destination volume preprocessing script (RepDst.pre)
[lines 74,84th]
(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 103rd]
(addition) |
while /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
[Example] mount processing change of source volume postprocessing script (RepSrc.post)
[lines 99,103,105,118,122,124th]
(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 144th]
(addition) |
until /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
[Example] mount processing change of destination volume postprocessing script
[lines 153,160,172,179th]
(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 197th]
(addition) |
until /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
Contents
Index
![]() ![]() |