前処理シェルスクリプトには、複写元ボリューム用(RepSrc.pre)と複写先ボリューム用(RepDst.pre)の2種類があり、それぞれのスクリプトは以下のディレクトリに格納されています。必要に応じて、カスタマイズしてください。
クラスタ運用でない場合
/etc/opt/FJSVswsrp/shディレクトリ |
クラスタ運用の場合
/etc/opt/FJSVswsrp/logicalNodeName/shディレクトリ |
複写元ボリューム用の前処理シェルスクリプト(RepSrc.pre)
Red Hat Enterprise Linux 8、Red Hat Enterprise Linux 7、またはRed Hat Enterprise Linux 6の場合
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # Copyright FUJITSU LIMITED, 2002-2017 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: # 13: Illegal mount type (stack/bind mount) 16: # 14: fsfreeze error 17: 18: # Argument check 19: case $# in 20: 2) 21: ;; 22: *) 23: exit 2 24: ;; 25: esac 26: 27: device=$1 28: mount_point=$2 29: 30: # Determination postprocessing file name 31: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 32: then 33: # /dev/sd? -> sd? 34: dev="`echo $device | /bin/sed "s/\/dev\///"`" 35: elif [ "`echo $device | /bin/grep "/dev/vd"`" != "" ] 36: then 37: # /dev/vd? -> vd? 38: dev="`echo $device | /bin/sed "s/\/dev\///"`" 39: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 40: then 41: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 42: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 43: dev="`echo $device | /bin/cut -d/ -f5`" 44: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 45: then 46: if [ "`echo $device | /bin/grep ":"`" != "" ] 47: then 48: devnam="`echo $device | /bin/cut -d: -f2-`" 49: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 50: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 51: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 52: dev="`echo $dev | /bin/sed "s/:/_/"`" 53: device="`echo $device | /bin/cut -d: -f1`" 54: if [ "`echo $devnam | /bin/grep "/dev/disk/by-id/"`" != "" ] 55: then 56: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-id/<device> -> class_volume__by_id_<device> 57: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-id\//_by-id_/"`" 58: elif [ "`echo $devnam | /bin/grep "/dev/disk/by-path/"`" != "" ] 59: then 60: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-path/<device> -> class_volume__by_path_<device> 61: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-path\//_by-path_/"`" 62: fi 63: else 64: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 65: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 66: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 67: fi 68: elif [ "`echo $device | /bin/grep "/dev/vx/dmp/"`" != "" ] 69: then 70: # /dev/vx/dmp/device -> _vx_pv_device 71: dev="_vx_pv_`echo $device | /bin/sed "s/\/dev\/vx\/dmp\///"`" 72: elif [ "`echo $device | /bin/grep "/dev/mapper/"`" != "" ] 73: then 74: # "/dev/mapper/<device>" -> "_mapper_<device>" 75: dev="_mapper_`echo $device | /bin/sed "s/\/dev\/mapper\///"`" 76: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ] 77: then 78: # "/dev/disk/by-id/<device>" -> "_by-id_<device>" 79: dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`" 80: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 81: then 82: # "/dev/disk/by-path/<device>" -> "_by-path_<device>" 83: dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`" 84: else 85: exit 0 86: fi 87: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 88: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".sfstype" 89: 90: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 91: 92: if [ "$mount_point" != "" ] 93: # When device was mounted 94: # 95: then 96: 97: proc="" 98: # When device cannot be unmounted(sync) 99: # if [ "$device" = "/dev/sdX" -o "$device" = "/dev/sdY" ] 100: # then 101: # proc="sync" 102: # /bin/sync 103: # /bin/sync 104: # /bin/sync 105: # echo "none" > $post_file 106: # fi 107: 108: # When device cannot be unmounted(fsfreeze) 109: # if [ "$device" = "/dev/sdX" -o "$device" = "/dev/sdY" ] 110: # then 111: # proc="fsfreeze" 112: # result="`/sbin/fsfreeze -f $mount_point 2>&1 `" 113: # if [ $? != 0 ] 114: # then 115: # echo "$result" > $err_log_path/$dev.fsfreeze 116: # exit 14 117: # fi 118: # echo "fsfreeze,$mount_point" > $post_file 119: # fi 120: 121: # When device can be unmounted 122: # 123: # if [ "$proc" = "" ];then 124: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 2|/bin/grep "^$mount_point\$"|/usr/bin/wc -w` != 1 ]; then 125: # stack mount (multi device on $mount_point) 126: /bin/mount > $err_log_path/$dev.umount 2>&1 127: exit 13 128: fi 129: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$device\$"|/usr/bin/wc -w` != 1 ]; then 130: cdevice="/dev/`/usr/bin/readlink $device | /bin/sed "s/..\/..\///"`" 131: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$cdevice\$"|/usr/bin/wc -w` != 1 ]; then 132: # bind mount (device has multi mount point) 133: /bin/mount > $err_log_path/$dev.umount 2>&1 134: exit 13 135: fi 136: fi 137: 138: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 139: 140: /bin/umount $mount_point 2>/dev/null 141: 142: if [ $? != 0 ] 143: then 144: retry_count=3 145: sleep_time=1 146: result_flag=1 147: 148: while [ $retry_count -gt 0 ] 149: do 150: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 151: if [ $? != 0 ] 152: then 153: retry_count=`expr $retry_count - 1` 154: /bin/sleep $sleep_time 155: else 156: /bin/rm -f $err_log_path/$dev.umount 157: result_flag=0 158: break 159: fi 160: done 161: 162: if [ $result_flag != 0 ] 163: then 164: /sbin/fuser -vum $mount_point> $err_log_path/$dev.fuser 2>&1 165: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 166: exit 10 167: fi 168: fi 169: 170: echo "mount,$mount_point" > $post_file 171: 172: # fi 173: 174: # When device was not mounted 175: # 176: else 177: echo "none" > $post_file 178: fi 179: 180: exit 0
SUSE Linux Enterprise Server 15またはSUSE Linux Enterprise Server 12の場合
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2017 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: # 13: Illegal mount type (stack/bind mount) 16: 17: # Argument check 18: case $# in 19: 2) 20: ;; 21: *) 22: exit 2 23: ;; 24: esac 25: 26: device=$1 27: mount_point=$2 28: 29: # Determination postprocessing file name 30: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 31: then 32: # /dev/sd? -> sd? 33: dev="`echo $device | /bin/sed "s/\/dev\///"`" 34: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 35: then 36: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 37: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 38: dev="`echo $device | /usr/bin/cut -d/ -f5`" 39: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 40: then 41: if [ "`echo $device | /bin/grep ":"`" != "" ] 42: then 43: devnam="`echo $device | /usr/bin/cut -d: -f2-`" 44: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 45: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 46: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 47: dev="`echo $dev | /bin/sed "s/:/_/"`" 48: device="`echo $device | /usr/bin/cut -d: -f1`" 49: if [ "`echo $devnam | /bin/grep "/dev/disk/by-id/"`" != "" ] 50: then 51: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-id/<device> -> class_volume__by_id_<device> 52: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-id\//_by-id_/"`" 53: elif [ "`echo $devnam | /bin/grep "/dev/disk/by-path/"`" != "" ] 54: then 55: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-path/<device> -> class_volume__by_path_<device> 56: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-path\//_by-path_/"`" 57: fi 58: else 59: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 60: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 61: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 62: fi 63: elif [ "`echo $device | /bin/grep "/dev/vx/dmp/"`" != "" ] 64: then 65: # /dev/vx/dmp/device -> _vx_pv_device 66: dev="_vx_pv_`echo $device | /bin/sed "s/\/dev\/vx\/dmp\///"`" 67: elif [ "`echo $device | /bin/grep "/dev/mapper/"`" != "" ] 68: then 69: # "/dev/mapper/<device>" -> "_mapper_<device>" 70: dev="_mapper_`echo $device | /bin/sed "s/\/dev\/mapper\///"`" 71: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ] 72: then 73: # "/dev/disk/by-id/<device>" -> "_by-id_<device>" 74: dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`" 75: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 76: then 77: # "/dev/disk/by-path/<device>" -> "_by-path_<device>" 78: dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`" 79: else 80: exit 0 81: fi 82: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".spre" 83: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".sfstype" 84: 85: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 86: 87: if [ "$mount_point" != "" ] 88: # When device was mounted 89: # 90: then 91: proc="" 92: # When device cannot be unmounted(sync) 93: # if [ "$device" = "/dev/sdX" -o "$device" = "/dev/sdY" ] 94: # then 95: # proc="sync" 96: # /bin/sync 97: # /bin/sync 98: # /bin/sync 99: # echo "none" > $post_file 100: # fi 101: 102: # When device can be unmounted 103: # 104: # if [ "$proc" = "" ];then 105: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 2| /bin/grep "^$mount_point\$"| /usr/bin/wc -w` != 1 ]; then 106: /bin/mount > $err_log_path/$dev.umount 2>&1 107: exit 13 108: fi 109: 110: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 1| /bin/grep "^$device\$"| /usr/bin/wc -w` != 1 ]; then 111: cdevice="/dev/`/usr/bin/readlink $device | /bin/sed "s/..\/..\///"`" 112: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 1|/bin/grep "^$cdevice\$"|/usr/bin/wc -w` != 1 ]; then 113: /bin/mount > $err_log_path/$dev.umount 2>&1 114: exit 13 115: fi 116: fi 117: 118: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 119: 120: /bin/umount $mount_point 2>/dev/null 121: 122: if [ $? != 0 ] 123: then 124: retry_count=3 125: sleep_time=1 126: result_flag=1 127: 128: while [ $retry_count -gt 0 ] 129: do 130: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 131: if [ $? != 0 ] 132: then 133: retry_count=`expr $retry_count - 1` 134: /bin/sleep $sleep_time 135: else 136: /bin/rm -f $err_log_path/$dev.umount 137: result_flag=0 138: break 139: fi 140: done 141: 142: if [ $result_flag != 0 ] 143: then 144: /bin/fuser -vum $mount_point> $err_log_path/$dev.fuser 2>&1 145: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 146: exit 10 147: fi 148: fi 149: 150: echo "mount,$mount_point" > $post_file 151: 152: # fi 153: 154: # When device was not mounted 155: # 156: else 157: echo "none" > $post_file 158: fi 159: 160: exit 0
複写先ボリューム用の前処理シェルスクリプト(RepDst.pre)
Red Hat Enterprise Linux 8、Red Hat Enterprise Linux 7、またはRed Hat Enterprise Linux 6の場合
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # Copyright FUJITSU LIMITED, 2002-2012 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 14: # 10: umount error 15: # 13: Illegal mount type (bind/stack mount) 16: 17: # Argument check 18: case $# in 19: 2) 20: ;; 21: *) 22: exit 2 23: ;; 24: esac 25: 26: device=$1 27: mount_point=$2 28: 29: # Determination postprocessing file name 30: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 31: then 32: # /dev/sd? -> sd? 33: dev="`echo $device | /bin/sed "s/\/dev\///"`" 34: elif [ "`echo $device | /bin/grep "/dev/vd"`" != "" ] 35: then 36: # /dev/vd? -> vd? 37: dev="`echo $device | /bin/sed "s/\/dev\///"`" 38: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 39: then 40: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 41: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 42: dev="`echo $device | /bin/cut -d/ -f5`" 43: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 44: then 45: if [ "`echo $device | /bin/grep ":"`" != "" ] 46: then 47: devnam="`echo $device | /bin/cut -d: -f2-`" 48: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 49: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 50: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 51: dev="`echo $dev | /bin/sed "s/:/_/"`" 52: device="`echo $device | /bin/cut -d: -f1`" 53: if [ "`echo $devnam | /bin/grep "/dev/disk/by-id/"`" != "" ] 54: then 55: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-id/<device> -> class_volume__by_id_<device> 56: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-id\//_by-id_/"`" 57: elif [ "`echo $devnam | /bin/grep "/dev/disk/by-path/"`" != "" ] 58: then 59: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-path/<device> -> class_volume__by_path_<device> 60: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-path\//_by-path_/"`" 61: fi 62: else 63: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 64: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 65: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 66: fi 67: elif [ "`echo $device | /bin/grep "/dev/vx/dmp/"`" != "" ] 68: then 69: # /dev/vx/dmp/device -> _vx_pv_device 70: dev="_vx_pv_`echo $device | /bin/sed "s/\/dev\/vx\/dmp\///"`" 71: elif [ "`echo $device | /bin/grep "/dev/mapper/"`" != "" ] 72: then 73: # "/dev/mapper/<device>" -> "_mapper_<device>" 74: dev="_mapper_`echo $device | /bin/sed "s/\/dev\/mapper\///"`" 75: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ] 76: then 77: # "/dev/disk/by-id/<device>" -> "_by-id_<device>" 78: dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`" 79: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 80: then 81: # "/dev/disk/by-path/<device>" -> "_by-path_<device>" 82: dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`" 83: else 84: exit 0 85: fi 86: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 87: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dfstype" 88: 89: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 90: 91: if [ "$mount_point" != "" ] 92: # When device was mounted 93: # 94: then 95: 96: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 2|/bin/grep "^$mount_point\$"|/usr/bin/wc -w` != 1 ]; then 97: # stack mount (multi device on $mount_point) 98: /bin/mount > $err_log_path/$dev.umount 2>&1 99: exit 13 100: fi 101: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$device\$"|/usr/bin/wc -w` != 1 ]; then 102: cdevice="/dev/`/usr/bin/readlink $device | /bin/sed "s/..\/..\///"`" 103: if [ `/bin/cat /proc/mounts |/bin/cut -d' ' -f 1|/bin/grep "^$cdevice\$"|/usr/bin/wc -w` != 1 ]; then 104: # bind mount (device has multi mount point) 105: /bin/mount > $err_log_path/$dev.umount 2>&1 106: exit 13 107: fi 108: fi 109: 110: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 111: 112: /bin/umount $mount_point 2>/dev/null 113: 114: if [ $? != 0 ] 115: then 116: retry_count=3 117: sleep_time=1 118: result_flag=1 119: 120: while [ $retry_count -gt 0 ] 121: do 122: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 123: if [ $? != 0 ] 124: then 125: retry_count=`expr $retry_count - 1` 126: /bin/sleep $sleep_time 127: else 128: /bin/rm -f $err_log_path/$dev.umount 129: result_flag=0 130: break 131: fi 132: done 133: 134: if [ $result_flag != 0 ] 135: then 136: /sbin/fuser -vum $mount_point> $err_log_path/$dev.fuser 2>&1 137: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 138: exit 10 139: fi 140: fi 141: 142: echo "mount,$mount_point" > $post_file 143: 144: # When device was not mounted 145: # 146: else 147: echo "none" > $post_file 148: fi 149: 150: exit 0
SUSE Linux Enterprise Server 15またはSUSE Linux Enterprise Server 12の場合
1: #!/bin/sh 2: 3: # AdvancedCopy Manager 4: # All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2011 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 14: # 10: umount error 15: # 13: Illegal mount type (bind/stack mount) 16: 17: # Argument check 18: case $# in 19: 2) 20: ;; 21: *) 22: exit 2 23: ;; 24: esac 25: 26: device=$1 27: mount_point=$2 28: 29: # Determination postprocessing file name 30: if [ "`echo $device | /bin/grep "/dev/sd"`" != "" ] 31: then 32: # /dev/sd? -> sd? 33: dev="`echo $device | /bin/sed "s/\/dev\///"`" 34: elif [ "`echo $device | /bin/grep "/dev/FJSV"`" != "" ] 35: then 36: # /dev/FJSVmphd/dsk/mplb?s? -> mplb?s? 37: # /dev/FJSVmphd/dsk/mphd?s? -> mphd?s? 38: dev="`echo $device | /usr/bin/cut -d/ -f5`" 39: elif [ "`echo $device | /bin/grep "/dev/sfdsk/"`" != "" ] 40: then 41: if [ "`echo $device | /bin/grep ":"`" != "" ] 42: then 43: devnam="`echo $device | /usr/bin/cut -d: -f2-`" 44: # /dev/sfdsk/class/dsk/volume:sd? -> class_volume_sd? 45: dev="`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 46: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 47: dev="`echo $dev | /bin/sed "s/:/_/"`" 48: device="`echo $device | /usr/bin/cut -d: -f1`" 49: if [ "`echo $devnam | /bin/grep "/dev/disk/by-id/"`" != "" ] 50: then 51: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-id/<device> -> class_volume__by_id_<device> 52: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-id\//_by-id_/"`" 53: elif [ "`echo $devnam | /bin/grep "/dev/disk/by-path/"`" != "" ] 54: then 55: # /dev/sfdsk/class/dsk/volume:/dev/disk/by-path/<device> -> class_volume__by_path_<device> 56: dev="`echo $dev | /bin/sed "s/\/dev\/disk\/by-path\//_by-path_/"`" 57: fi 58: else 59: # /dev/sfdsk/class/dsk/volume -> _gds_class_volume 60: dev="_gds_`echo $device | /bin/sed "s/\/dev\/sfdsk\///"`" 61: dev="`echo $dev | /bin/sed "s/\/dsk\//_/"`" 62: fi 63: elif [ "`echo $device | /bin/grep "/dev/vx/dmp/"`" != "" ] 64: then 65: # /dev/vx/dmp/device -> _vx_pv_device 66: dev="_vx_pv_`echo $device | /bin/sed "s/\/dev\/vx\/dmp\///"`" 67: elif [ "`echo $device | /bin/grep "/dev/mapper/"`" != "" ] 68: then 69: # "/dev/mapper/<device>" -> "_mapper_<device>" 70: dev="_mapper_`echo $device | /bin/sed "s/\/dev\/mapper\///"`" 71: elif [ "`echo $device | /bin/grep "/dev/disk/by-id/"`" != "" ] 72: then 73: # "/dev/disk/by-id/<device>" -> "_by-id_<device>" 74: dev="_by-id_`echo $device | /bin/sed "s/\/dev\/disk\/by-id\///"`" 75: elif [ "`echo $device | /bin/grep "/dev/disk/by-path/"`" != "" ] 76: then 77: # "/dev/disk/by-path/<device>" -> "_by-path_<device>" 78: dev="_by-path_`echo $device | /bin/sed "s/\/dev\/disk\/by-path\///"`" 79: else 80: exit 0 81: fi 82: post_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dpre" 83: fstype_file="/etc/opt/FJSVswsrp/"$SWSTGNODE"/data/DEFAULT/"$dev".dfstype" 84: 85: err_log_path="/var/opt/FJSVswsrp/"$SWSTGNODE"/log" 86: 87: if [ "$mount_point" != "" ] 88: # When device was mounted 89: # 90: then 91: 92: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 2| /bin/grep "^$mount_point\$"| /usr/bin/wc -w` != 1 ]; then 93: /bin/mount > $err_log_path/$dev.umount 2>&1 94: exit 13 95: fi 96: 97: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 1| /bin/grep "^$device\$"| /usr/bin/wc -w` != 1 ]; then 98: cdevice="/dev/`/usr/bin/readlink $device | /bin/sed "s/..\/..\///"`" 99: if [ `/bin/cat /proc/mounts | /usr/bin/cut -d' ' -f 1|/bin/grep "^$cdevice\$"|/usr/bin/wc -w` != 1 ]; then 100: /bin/mount > $err_log_path/$dev.umount 2>&1 101: exit 13 102: fi 103: fi 104: 105: /bin/awk "\$2==\"$mount_point\" {print \$3}" /proc/mounts > $fstype_file 106: 107: /bin/umount $mount_point 2>/dev/null 108: 109: if [ $? != 0 ] 110: then 111: retry_count=3 112: sleep_time=1 113: result_flag=1 114: 115: while [ $retry_count -gt 0 ] 116: do 117: /bin/umount $mount_point > $err_log_path/$dev.umount 2>&1 118: if [ $? != 0 ] 119: then 120: retry_count=`expr $retry_count - 1` 121: /bin/sleep $sleep_time 122: else 123: /bin/rm -f $err_log_path/$dev.umount 124: result_flag=0 125: break 126: fi 127: done 128: 129: if [ $result_flag != 0 ] 130: then 131: /bin/fuser -vum $mount_point> $err_log_path/$dev.fuser 2>&1 132: /bin/ps -ef > $err_log_path/$dev.ps 2>&1 133: exit 10 134: fi 135: fi 136: 137: echo "mount,$mount_point" > $post_file 138: 139: # When device was not mounted 140: # 141: else 142: echo "none" > $post_file 143: fi 144: 145: exit 0