ETERNUS SF AdvancedCopy Manager Operator's Guide 13.0 -Solaris- |
Contents
Index
![]() ![]() |
This appendix describes shell scripts used for preprocessing and postprocessing of backup and restoration.
Note that a shell script described in this appendix has different linefeed positions due to formatting of this manual.
Shell scripts used for preprocessing and postprocessing of backup or restoration are started before and after backup or restoration when a backup or restore execution command is executed.
These shell scripts describe processing required by AdvancedCopy Manager to back up or restore a transaction volume.
This chapter describes the setup of preprocessing and postprocessing.
Backup on AdvancedCopy Manager must be performed basically while access to a transaction volume from other processes is inhibited.
Normally, the preprocessing acquires the mount status of a transaction volume using the transaction volume name and then performs the following processing:
Transaction volume status |
Preprocessing |
---|---|
Mounted |
Unmount a transaction volume.(*1) |
Unmounted |
Take no action. |
*1 If the transaction volume cannot be unmounted, however, customize the shell script for pre-processing. For information on this customization, see the section on "When you do not want to unmount a transaction volume."
What to do in the postprocessing must be determined depending on what has been done in the preprocessing.
Preprocessing |
Postprocessing |
---|---|
A transaction volume was unmounted. |
Remount the transaction volume. |
Take no action. |
Take no action. |
If no transaction volume has been mounted since the start of system operation (e.g., a transaction volume used as a database), neither pre- nor post-processing is performed.
If special preprocessing or postprocessing is required, you need to add the concerned processing to a shell script.
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 |
If post-processing was failed, execute the Resource match command because the consistency of resource information may be incomplete.
The name of the shell script for pre-processing before backup processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcBackup.pre
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcBackup.pre
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing of backup processing 8: # 9: # Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # $3 Device name of backup disk 12: # 13: # Error number 14: # 2: Argument error 15: # 10: umount error 16: 17: 18: # Argument check 19: case $# in 20: 1) 21: ;; 22: 2) 23: ;; 24: 3) 25: ;; 26: *) 27: exit 2 28: ;; 29: esac 30: 31: device="`echo $1`" 32: mount_point="`echo $2`" 33: bk_device="`echo $3`" 34: 35: # Determination postprocessing file name 36: 37: if [ "$SWSTGNODE" != "" ] 38: then 39: swstg_node="/`echo $SWSTGNODE`" 40: else 41: swstg_node="" 42: fi 43: 44: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 45: 46: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 47: then 48: # /dev/dsk/c?t?d?s? -> c?t?d?s? 49: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 50: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 51: then 52: # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s? 53: # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s? 54: dev="`echo $device | /usr/bin/cut -d/ -f5`" 55: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 56: then 57: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 58: then 59: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 60: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 61: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 62: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 63: device="`echo $device | /usr/bin/cut -d: -f1`" 64: else 65: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 66: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 67: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 68: fi 69: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 70: then 71: # /dev/vx/dsk/volume -> _vx_rootdg_volume 72: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 73: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 74: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 75: then 76: # /dev/vx/dmp/device -> _vx_pv_device 77: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 78: else 79: exit 0 80: fi 81: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 82: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 83: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 84: 85: if [ "$mount_point" != "" ] 86: then 87: 88: # When device cannot be unmounted 89: # 90: # if [ "$device" = "/dev/dsk/c*t*d*s*" ] 91: # then 92: # /usr/sbin/lockfs -w $mount_point > /dev/null 2>&1 93: # if [ "$bk_device" != "" ] 94: # then 95: # echo $bk_device > $bd_file 96: # fi 97: # df -ln $mount_point | cut -f2 -d: | cut -f2 -d' ' > $fstype_file 98: # sync 99: # sync 100: # echo "fsck" > $post_file 101: # 102: # When device can be unmounted 103: # 104: # else 105: /usr/bin/df -ln $mount_point | /usr/bin/cut -f2 -d: | /usr/bin/cut -f2 -d' ' > $fstype_file 106: /usr/sbin/umount $mount_point 2>/dev/null 107: if [ $? != 0 ] 108: then 109: retry_count=3 110: sleep_time=1 111: result_flag=1 112: 113: while [ $retry_count -gt 0 ] 114: do 115: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 116: if [ $? != 0 ] 117: then 118: retry_count=`expr $retry_count - 1` 119: /usr/bin/sleep $sleep_time 120: else 121: /usr/bin/rm -f $err_log_path/$dev.umount 122: result_flag=0 123: break 124: fi 125: done 126: 127: if [ $result_flag != 0 ] 128: then 129: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 130: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 131: 132: exit 10 133: fi 134: fi 135: echo "mount" > $post_file 136: 137: # fi 138: 139: # When device was not mounted 140: # 141: else 142: echo "none" > $post_file 143: fi 144: 145: exit 0 |
Use an editor to delete the comments ("#") on the 90th to 100th, 104th, and 137th lines for a transaction volume that is mounted but you do not want to unmount, and indicate the target device in the if statement on the 90th line.
This operation is possible only when the file system is one of the following two:
ufs
SynfinityFILE (single-partition configuration)
The preprocessing by the customized scripts is as follows:
State of transaction volume |
preprocessing |
---|---|
It is mounted. |
Updating to operating volume is deterred. |
The postprocessing by the customized scripts is as follows:
preprocessing |
Postprocessing |
---|---|
Updating to operating volume was deterred. |
The updating deterrence to operating volume is canceled. Matching of the backup volume is checked. |
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 name of the shell script for post-processing before backup processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcBackup.post
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcBackup.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Postprocessing of backup processing 8: # 9: # Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # 12: # Error number 13: # 2: Argument error 14: # 11: mount error 15: # 12: fsck error 16: 17: # Argument check 18: case $# in 19: 1) 20: ;; 21: 2) 22: ;; 23: *) 24: exit 2 25: ;; 26: esac 27: 28: device="`echo $1`" 29: mount_point="`echo $2`" 30: 31: # Determination of postprocessing file name 32: 33: if [ "$SWSTGNODE" != "" ] 34: then 35: swstg_node="/`echo $SWSTGNODE`" 36: else 37: swstg_node="" 38: fi 39: 40: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 41: 42: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 43: then 44: # /dev/dsk/c?t?d?s? -> c?t?d?s? 45: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 46: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 47: then 48: # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s? 49: # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s? 50: dev="`echo $device | /usr/bin/cut -d/ -f5`" 51: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 52: then 53: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 54: then 55: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 56: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 57: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 58: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 59: device="`echo $device | /usr/bin/cut -d: -f1`" 60: else 61: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 62: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 63: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 64: fi 65: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 66: then 67: # /dev/vx/dsk/volume -> _vx_rootdg_volume 68: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 69: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 70: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 71: then 72: # /dev/vx/dmp/device -> _vx_pv_device 73: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 74: else 75: exit 0 76: fi 77: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 78: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 79: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 80: 81: # Confirmation of postprocessing 82: if [ ! -r $post_file ] 83: then 84: exit 0 85: fi 86: post="`/usr/bin/cat $post_file`" 87: 88: # Confirmation of FStype 89: if [ ! -r $fstype_file ] 90: then 91: fs="" 92: else 93: fs="`/usr/bin/cat $fstype_file`" 94: fi 95: 96: # No processing 97: if [ "$post" = "none" ] 98: then 99: /usr/bin/rm -rf $post_file 2> /dev/null 100: /usr/bin/rm -rf $fstype_file 2> /dev/null 101: exit 0 102: fi 103: 104: # mount processing 105: if [ "$post" = "mount" ] 106: then 107: /usr/bin/df -l $device > /dev/null 2>&1 108: if [ $? != 0 ] 109: then 110: if [ ! -r $fstype_file ] 111: then 112: /usr/sbin/mount $device $mount_point 2> /dev/null 113: else 114: if [ "$fs" = "" ] 115: then 116: /usr/sbin/mount $device $mount_point 2> /dev/null 117: else 118: /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null 119: fi 120: fi 121: if [ $? != 0 ] 122: then 123: retry_count=3 124: sleep_time=1 125: result_flag=1 126: 127: while [ $retry_count -gt 0 ] 128: do 129: if [ ! -r $fstype_file ] 130: then 131: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 132: else 133: if [ "$fs" = "" ] 134: then 135: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 136: else 137: /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 138: fi 139: fi 140: if [ $? != 0 ] 141: then 142: retry_count=`expr $retry_count - 1` 143: /usr/bin/sleep $sleep_time 144: else 145: /usr/bin/rm -f $err_log_path/$dev.mount 146: result_flag=0 147: break 148: fi 149: done 150: 151: if [ $result_flag != 0 ] 152: then 153: exit 11 154: fi 155: fi 156: fi 157: /usr/bin/rm -rf $post_file 2> /dev/null 158: /usr/bin/rm -rf $fstype_file 2> /dev/null 159: exit 0 160: fi 161: 162: # fsck processing 163: if [ "$post" = "fsck" ] 164: then 165: /usr/sbin/lockfs -u $mount_point > /dev/null 2>&1 166: if [ -r $bd_file ] 167: then 168: bk_device="`/usr/bin/cat $bd_file`" 169: fsck_dev="`echo $bk_device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 170: if [ ! -r $fstype_file ] 171: then 172: /usr/sbin/fsck -m $fsck_dev > /dev/null 2>&1 173: else 174: if [ "$fs" = "" ] 175: then 176: /usr/sbin/fsck -m $fsck_dev > /dev/null 2>&1 177: else 178: if [ "$fs" = "sfxfs" ] 179: then 180: /usr/sbin/sfxadm $fsck_dev > /dev/null 2>&1 181: /usr/sbin/fsck -y -F $fs -o p,log $fsck_dev > /dev/null 2>&1 182: else 183: /usr/sbin/fsck -m -F $fs $fsck_dev > /dev/null 2>&1 184: fi 185: fi 186: fi 187: if [ $? != 0 ] 188: then 189: if [ "$fs" = "" ] 190: then 191: result="`/usr/sbin/fsck -n $fsck_dev |/usr/bin/grep \?`" 192: else 193: result="`/usr/sbin/fsck -n -F $fs $fsck_dev |/usr/bin/grep \?`" 194: fi 195: if [ "$result" = "FILE SYSTEM STATE IN SUPERBLOCK IS WRONG; FIX? no" ] 196: then 197: if [ "$fs" = "" ] 198: then 199: /usr/sbin/fsck -y $fsck_dev > $err_log_path/$dev.fsck 2>&1 200: else 201: /usr/sbin/fsck -y -F $fs $fsck_dev > $err_log_path/$dev.fsck 2>&1 202: fi 203: if [ $? != 0 ] 204: then 205: exit 12 206: else 207: /usr/bin/rm -f $err_log_path/$dev.fsck 208: fi 209: else 210: echo "$result" > $err_log_path/$dev.fsck 2>&1 211: exit 12 212: fi 213: fi 214: fi 215: /usr/bin/rm -rf $post_file 2> /dev/null 216: /usr/bin/rm -rf $fstype_file 2> /dev/null 217: /usr/bin/rm -rf $bd_file 2> /dev/null 218: exit 0 219: fi 220: 221: exit |
Customize of a preprocessing and postprocessing script is needed, when performing cluster oprating by VERITAS Cluster Server, and when mount point of transaction 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 backup preprocessing script (OpcBackup.pre)
[lines 106,115th]
(Before change) |
/usr/sbin/umount $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[Example] unmount wait processing addition of backup preprocessing script (OpcBackup.pre)
[line 135th]
(addition) |
while /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
[Example] mount processing change of backup postprocessing script (OpcBackup.post)
[lines 112,116,118,131,135,137th]
(Before change) |
/usr/sbin/mount $device $mount_point or /usr/sbin/mount -F $fs $device $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[Example] mount wait processing addition of backup postprocessing script (OpcBackup.post)
[lines 157th]
(addition) |
until /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
In AdvancedCopy Manager, restore processing must be performed while transaction volumes are unmounted.
Thus, in pre-processing, the mount state of the transaction volume is determined using its name, and the following processing is then performed:
Transaction volume status |
Preprocessing |
---|---|
Mounted |
Unmount the transaction volume. |
Unmounted |
Take no action. |
What to do in the postprocessing must be determined depending on what has been done in the preprocessing.
Preprocessing |
Postprocessing |
---|---|
A transaction volume was unmounted. |
Remount the transaction volume. |
Take no action. |
Take no action. |
If special preprocessing or postprocessing is required, you need to add the concerned processing to a shell script.
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 |
If pos-tprocessing was failed, execute the Resource match command because the consistency of resource information may be incomplete.
The name of the shell script for pre-processing before restore processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcRestore.pre
In the case of cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcRestore.pre
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Preprocessing of restoration processing 8: # 9: # Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # 12: # Error number 13: # 2: Argument error 14: # 10: umount error 15: 16: 17: # Argument check 18: case $# in 19: 1) 20: ;; 21: 2) 22: ;; 23: *) 24: exit 2 25: ;; 26: esac 27: 28: device="`echo $1`" 29: mount_point="`echo $2`" 30: 31: # Determination of postprocessing file name 32: 33: if [ "$SWSTGNODE" != "" ] 34: then 35: swstg_node="/`echo $SWSTGNODE`" 36: else 37: swstg_node="" 38: fi 39: 40: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 41: 42: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 43: then 44: # /dev/dsk/c?t?d?s? -> c?t?d?s? 45: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 46: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 47: then 48: # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s? 49: # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s? 50: dev="`echo $device | /usr/bin/cut -d/ -f5`" 51: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 52: then 53: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 54: then 55: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 56: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 57: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 58: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 59: device="`echo $device | /usr/bin/cut -d: -f1`" 60: else 61: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 62: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 63: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 64: fi 65: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 66: then 67: # /dev/vx/dsk/volume -> _vx_rootdg_volume 68: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 69: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 70: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 71: then 72: # /dev/vx/dmp/device -> _vx_pv_device 73: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 74: else 75: exit 0 76: fi 77: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 78: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 79: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 80: 81: if [ "$mount_point" != "" ] 82: then 83: 84: # When device can be unmounted 85: # 86: /usr/bin/df -ln $mount_point | /usr/bin/cut -f2 -d: | /usr/bin/cut -f2 -d' ' > $fstype_file 87: /usr/sbin/umount $mount_point 2> /dev/null 88: if [ $? != 0 ] 89: then 90: retry_count=3 91: sleep_time=1 92: result_flag=1 93: 94: while [ $retry_count -gt 0 ] 95: do 96: /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1 97: if [ $? != 0 ] 98: then 99: retry_count=`expr $retry_count - 1` 100: /usr/bin/sleep $sleep_time 101: else 102: /usr/bin/rm -f $err_log_path/$dev.umount 103: result_flag=0 104: break 105: fi 106: done 107: 108: if [ $result_flag != 0 ] 109: then 110: /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 111: /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 112: 113: exit 10 114: fi 115: fi 116: echo "mount" > $post_file 117: 118: # When device was not mounted 119: # 120: else 121: echo "none" > $post_file 122: fi 123: 124: exit 0 |
Restore processing is not possible on a mounted transaction volume that cannot be unmounted. Specify a device at the restore destination.
The name of the shell script for post-processing after restore processing is as follows.
In the case of non-cluster operation
/etc/opt/FJSVswsts/sh/OpcRestore.post
In the case of non-cluster operation
/etc/opt/FJSVswsts/<logic node name>/sh/OpcRestore.post
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2006 5: 6: # 7: # Postprocessing of restoration processing 8: # 9: # Argument: $1 Device name of transaction disk 10: # $2 Mount point of transaction disk 11: # 12: # Error number 13: # 2: Argument error 14: # 11: mount error 15: 16: # Argument check 17: case $# in 18: 1) 19: ;; 20: 2) 21: ;; 22: *) 23: exit 2 24: ;; 25: esac 26: 27: device="`echo $1`" 28: mount_point="`echo $2`" 29: 30: # Determination of postprocessing file name 31: 32: if [ "$SWSTGNODE" != "" ] 33: then 34: swstg_node="/`echo $SWSTGNODE`" 35: else 36: swstg_node="" 37: fi 38: 39: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log" 40: 41: if [ "`echo $device | /usr/bin/grep "/dev/dsk/"`" != "" ] 42: then 43: # /dev/dsk/c?t?d?s? -> c?t?d?s? 44: dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`" 45: elif [ "`echo $device | /usr/bin/grep "/dev/FJSV"`" != "" ] 46: then 47: # /dev/FJSVmphd/dsk/mplb?s? -> /dev/FJSVmphd/dsk/mplb?s? 48: # /dev/FJSVmphd/dsk/mphd?s? -> /dev/FJSVmphd/dsk/mphd?s? 49: dev="`echo $device | /usr/bin/cut -d/ -f5`" 50: elif [ "`echo $device | /usr/bin/grep "/dev/sfdsk/"`" != "" ] 51: then 52: if [ "`echo $device | /usr/bin/grep ":"`" != "" ] 53: then 54: # /dev/sfdsk/class/dsk/volume:c?t?d? -> class_volume_c?t?d? 55: dev="`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 56: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 57: dev="`echo $dev | /usr/bin/sed "s/:/_/"`" 58: device="`echo $device | /usr/bin/cut -d: -f1`" 59: else 60: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 61: dev="_gds_`echo $device | /usr/bin/sed "s/\/dev\/sfdsk\///"`" 62: dev="`echo $dev | /usr/bin/sed "s/\/dsk\//_/"`" 63: fi 64: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dsk/"`" != "" ] 65: then 66: # /dev/vx/dsk/volume -> _vx_rootdg_volume 67: # /dev/vx/dsk/disk-group/volume -> _vx_disk-group_volume 68: dev=_vx_"`echo $device | /usr/bin/awk -F\/ '{ if (NF == 6) { print $5"_"$6 } else print "rootdg_"$5 }'`" 69: elif [ "`echo $device | /usr/bin/grep "/dev/vx/dmp/"`" != "" ] 70: then 71: # /dev/vx/dmp/device -> _vx_pv_device 72: dev=_vx_pv_"`echo $device | /usr/bin/cut -d/ -f5`" 73: else 74: exit 0 75: fi 76: post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre" 77: fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype" 78: bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd" 79: 80: # Confirmation of postprocessing 81: if [ ! -r $post_file ] 82: then 83: exit 0 84: fi 85: post="`/usr/bin/cat $post_file`" 86: 87: # Confirmation of FStype 88: if [ ! -r $fstype_file ] 89: then 90: fs="" 91: else 92: fs="`/usr/bin/cat $fstype_file`" 93: fi 94: 95: # No processing 96: if [ "$post" = "none" ] 97: then 98: /usr/bin/rm -rf $post_file 2> /dev/null 99: /usr/bin/rm -rf $fstype_file 2> /dev/null 100: exit 0 101: fi 102: 103: # mount processing 104: if [ "$post" = "mount" ] 105: then 106: /usr/bin/df -l $device > /dev/null 2>&1 107: if [ $? != 0 ] 108: then 109: if [ ! -r $fstype_file ] 110: then 111: /usr/sbin/mount $device $mount_point 2> /dev/null 112: else 113: if [ "$fs" = "" ] 114: then 115: /usr/sbin/mount $device $mount_point 2> /dev/null 116: else 117: if [ "$fs" = "sfxfs" ] 118: then 119: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 120: /usr/sbin/sfxadm $dev > /dev/null 2>&1 121: fi 122: /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null 123: fi 124: fi 125: if [ $? != 0 ] 126: then 127: retry_count=3 128: sleep_time=1 129: result_flag=1 130: 131: while [ $retry_count -gt 0 ] 132: do 133: if [ ! -r $fstype_file ] 134: then 135: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 136: else 137: if [ "$fs" = "" ] 138: then 139: /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1 140: else 141: if [ "$fs" = "sfxfs" ] 142: then 143: dev="`echo $device | /usr/bin/sed "s/\/dsk\//\/rdsk\//"`" 144: /usr/sbin/sfxadm $dev > $err_log_path/$dev.sfxadm 2>&1 145: fi 146: /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1 147: fi 148: fi 149: if [ $? != 0 ] 150: then 151: retry_count=`expr $retry_count - 1` 152: /usr/bin/sleep $sleep_time 153: else 154: /usr/bin/rm -f $err_log_path/$dev.mount 155: result_flag=0 156: break 157: fi 158: done 159: 160: if [ $result_flag != 0 ] 161: then 162: exit 11 163: fi 164: fi 165: fi 166: /usr/bin/rm -rf $post_file 2> /dev/null 167: /usr/bin/rm -rf $fstype_file 2> /dev/null 168: exit 0 169: fi 170: 171: exit 0 |
Customize of a preprocessing and postprocessing script is needed, when performing cluster oprating by VERITAS Cluster Server, and when mount point of transaction 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 restoration preprocessing script (OpcRestore.pre)
[lines 87,96th]
(Before change) |
/usr/sbin/umount $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[Example] unmount wait processing addition of restoration preprocessing script (OpcRestore.pre)
[line 116th]
(addition) |
while /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
[Example] mount processing change of restoration postprocessing script (OpcRestore.post)
[lines 111,115,122,135,139,146th]
(Before change) |
/usr/sbin/mount $device $mount_point or /usr/sbin/mount -F $fs $device $mount_point |
(after change) |
/opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[Example] mount wait processing addition of restoration postprocessing script (OpcRestore.post)
[line 166th]
(addition) |
until /usr/sbin/df -l "$device">/dev/null 2>&1; do :; done |
Contents
Index
![]() ![]() |