ETERNUS SF AdvancedCopy Manager 運用手引書 13.0 -HP-UX-
目次 索引 前ページ次ページ

付録A バックアップ・リストアの前後処理

本章では、HP-UX版AdvancedCopy Managerのバックアップおよびリストアの前後処理を行うシェルスクリプトについて説明します。

A.1 概要 

バックアップ・リストアの前後処理のシェルスクリプトは、バックアップ実行コマンドまたはリストア実行コマンドを実施した際に、バックアップ・リストア処理の前後で起動されます。

これらのシェルスクリプトには、AdvancedCopy Managerが、業務ボリュームのバックアップおよびリストアを行う際に必要な処理を記述します。

この章では、前後処理の設定について説明します。

A.2 バックアップの前後処理 

AdvancedCopy Managerでのバックアップは、基本的に業務ボリュームがアンマウントされた状態で処理を行う必要があります。

そのため、業務ボリュームが物理ディスクの場合、前処理では、業務ボリューム名からそのボリュームのマウント状態を獲得し、次の処理を行います。

業務ボリュームの状態

前処理

マウントされている

業務ボリュームをアンマウントします。(注)

アンマウントされている

何も処理しません。

(注)都合によりどうしても業務ボリュームをアンマウントできない場合は、本マニュアルの『業務ボリュームをアンマウントしたくない場合』を参照し、前処理のシェルスクリプトをカスタマイズしてください。

後処理は、前処理で行った処理によって何をするのかを判断します。

前処理

後処理

業務ボリュームをアンマウントした。

業務ボリュームをマウントし直します。

何も処理しなかった。

何も処理しません。

データベースとして使用している業務ボリュームのように、最初から業務ボリュームがマウントされていない場合は、前後処理ともに何も処理しません。

この他にも、特殊な前後処理が必要な場合は、シェルスクリプトに処理を追加する必要があります。

スクリプトをカスタマイズする場合、エラーコードは以下の規約に従ってください。

エラーコード

用途

0-99

使用不可(AdvancedCopy Managerが予約)

100-255

使用可能

ファイルシステムが構築された論理ボリュームを含むボリュームグループをバックアップする場合は、本マニュアルの『ボリュームグループをバックアップする場合』を参照し、ファイルシステムが構築された全ての論理ボリュームに対してアンマウント/マウントが実施されるように前後処理スクリプトをカスタマイズする必要があります。
バックアップ実行時の後処理スクリプトの217,301行目のファイルシステム名は、運用に合わせて適宜修正してください。

後処理に失敗した場合は、資源情報の整合性が不完全になっている可能性がありますので、資源整合コマンド(swstsrsemtch)を実施してください。

A.2.1 バックアップ実行時の前処

バックアップ実行時の前処理のシェルスクリプト名は、以下の通りです。

非クラスタ運用の場合

/etc/opt/FJSVswsts/sh/OpcBackup.pre

クラスタ運用の場合

/etc/opt/FJSVswsts/<論理ノード名>/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 or VG name of transaction disk
 10: #                 $2 Mount point of transaction disk
 11: #                 $3 Device or VG name of backup disk
 12: #
 13: #       Error number
 14: #               2: Argument error
 15: #              10: umount error
 16: #              30: VG configuration file not found error
 17: #              99: Script not customize
 18: 
 19: 
 20: # Argument check
 21: case $# in
 22: 1)
 23:         ;;
 24: 2)
 25:         ;;
 26: 3)
 27:         ;;
 28: *)
 29:         exit 2
 30:         ;;
 31: esac
 32: 
 33: device=$1
 34: mount_point=$2
 35: bk_device=$3
 36: 
 37: # Determination postprocessing file name
 38: if [ "$SWSTGNODE" != "" ]
 39: then
 40:         swstg_node="/`echo $SWSTGNODE`"
 41: else
 42:         swstg_node=""
 43: fi
 44: 
 45: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log"
 46: 
 47: # Device type check
 48: trans="`echo $device | /usr/bin/grep "/dev/dsk/"`"
 49: lvmtrans="`echo $device | /usr/bin/grep "/dev/"`"
 50: vxpvtrans="`echo $device | /usr/bin/grep "/dev/vx/dmp/"`"
 51: if [ "$trans" != "" ]
 52: then
 53:         dev_type="physical"
 54:         dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`"
 55:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 56:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 57:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 58: elif [ "$vxpvtrans" != "" ]
 59: then
 60:         dev_type="vxvm_pv"
 61:         # /dev/vx/dmp/XXXX -> XXXX
 62:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`"
 63:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 64:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 65:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 66: elif [ "$lvmtrans" != "" ]
 67: then
 68:         dev_type="logical"
 69:         # /dev/XXXX -> XXXX
 70:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
 71:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 72:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 73:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 74: else
 75:         exit 0
 76: fi
 77: 
 78: # Save VG name of backup disk
 79: bk_trans="`echo $bk_device | /usr/bin/grep "/dev/dsk/"`"
 80: bk_lvmtrans="`echo $bk_device | /usr/bin/grep "/dev/"`"
 81: bk_vxpvtrans="`echo $bk_device | /usr/bin/grep "/dev/vx/dmp/"`"
 82: if [ "$bk_trans" = "" -a "$bk_lvmtrans" != "" -a "$bk_vxpvtrans" = "" ]
 83: then
 84:         bk_vg_name="`echo $bk_device | /usr/bin/awk -F\/ '{ print $3 }'`"
 85:         cfg_file="/etc/lvmconf/"$bk_vg_name".conf"
 86:         if [ ! -r $cfg_file ]
 87:         then
 88:                 exit 30
 89:         fi
 90:         echo $bk_device > $bd_file
 91: fi
 92: 
 93: # When the transaction disk is a physical device #############################
 94: if [ "$dev_type" = "physical" ]
 95: then
 96: 
 97:         if [ "$mount_point" != "" ]
 98:         then
 99: # When device cannot be unmounted --- 1
100: #
101: #               if [ "$device" = "/dev/dsk/c*t*d*" ]
102: #               then
103: #                       if [ "$bk_device" != "" ]
104: #                       then
105: #                               echo $bk_device > $bd_file
106: #                       fi
107: #                       df -ln $mount_point 2>/dev/null | awk -F: '{ print $2 }' | awk '{ print $1 }' > $fstype_file
108: #                       sync
109: #                       sync
110: #                       echo "fsck" > $post_file
111: #
112: # When device can be unmounted --- 2
113: #               else
114:                         /usr/bin/df -ln $mount_point 2>/dev/null | /usr/bin/awk -F: '{ print $2 }' | /usr/bin/awk '{ print $1 }' > $fstype_file
115:                         /usr/sbin/umount $mount_point 2>/dev/null
116:                         if [ $? != 0 ]
117:                         then
118:                               retry_count=3
119:                                 sleep_time=1
120:                                 result_flag=1
121: 
122:                                 while [ $retry_count -gt 0 ]
123:                                 do
124:                                     /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1
125:                                     if [ $? != 0 ]
126:                                     then
127:                                         retry_count=`expr $retry_count - 1`
128:                                         /usr/bin/sleep $sleep_time
129:                                     else
130:                                         result_flag=0
131:                                         break
132:                                     fi
133:                                 done
134: 
135:                                 if [ $result_flag != 0 ]
136:                                 then
137:                                     /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 
138:                                     /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 
139: 
140:                                     exit 10
141:                                 else
142:                                     /usr/bin/rm -f $err_log_path/$dev.umount
143:                                 fi
144:                         fi
145:                         echo "mount" > $post_file
146: #               fi
147: # When device was not mounted --- 3
148: #
149:         else
150:                 echo "none" > $post_file
151:         fi
152: 
153: # When the transaction disk is a volume group ################################
154: elif [ "$dev_type" = "logical" ]
155: then
156: 
157: # Devices is volume group and script not customize
158:     exit 99
159: 
160: # When devices of volume group cannot be unmounted --- 4
161: #
162: #       # Specify the name of volume group not to unmount
163: #       if [ "$device" = "/dev/vg**" ]
164: #       then
165: #               if [ "$bk_device" != "" ]
166: #               then
167: #                       echo $bk_device > $bd_file
168: #               fi
169: #               sync
170: #               sync
171: #               echo "fsck" > $post_file
172: #       fi
173: #
174: # When devices of volume group can be unmounted --- 5
175: #
176: #       # Specify the name of volume group to unmount
177: #       if [ "$device" = "/dev/vg**" ]
178: #       then
179: #               # Unmount all logical volumes of the volume group
180: #               mount_point="/**"
181: #               /usr/sbin/umount $mount_point 2>/dev/null
182: #               if [ $? != 0 ]
183: #               then
184: #                    retry_count=3
185: #                    sleep_time=1
186: #                    result_flag=1
187: #
188: #                    while [ $retry_count -gt 0 ]
189: #                    do
190: #
191: #                       # $dev is volume group name
192: #
193: #                        /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1
194: #                        if [ $? != 0 ]
195: #                        then
196: #                            retry_count=`expr $retry_count - 1`
197: #                            sleep $sleep_time
198: #                        else
199: #                            rm -f $err_log_path/$dev.umount
200: #                            result_flag=0
201: #                            break
202: #                        fi
203: #                    done
204: #
205: #                    if [ $result_flag != 0 ]
206: #                    then
207: #                        /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 
208: #                        /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 
209: #
210: #                        exit 10
211: #                    fi
212: #               fi
213: #               echo "mount" > $post_file
214: #       fi
215: #
216: # When devices of volume group was not mounted --- 6
217: #
218: #       # Specify the name of volume group to do nothing
219: #       if [ "$device" = "/dev/vg**" ]
220: #       then
221: #                echo "none" > $post_file
222: #       fi
223: #
224: # When the transaction disk is a VxVM physical volume --- 7 #################
225: elif [ "$dev_type" = "vxvm_pv" ]
226: then
227:         # Nothing is done to VxVM PV. 
228:         echo "none" > $post_file
229: fi
230: 
231: exit 0

業務ボリュームをアンマウントしたくない場合

マウントされているがアンマウントしたくない業務ボリュームに対しては、101〜110行目、113、146行目(物理ボリュームの場合)または163〜172行目(ボリュームグループの場合)のコメント(“#”)をエディタ等で消去し、101行目または163行目のif文で対象となるデバイスを指示してください。なお、108行目または169行目のsyncコマンドを実施してからバックアップ後処理を実施するまでの間は、業務ボリュームのファイルシステム更新操作を行わないようにしてください。もし、この間にファイルシステム更新操作が行われると、ファイルシステムが不完全な状態でバックアップが採取されるか、またはバックアップ後処理で実施するfsckコマンドがエラーとなる可能性があります。

A.2.2 バックアップ実行時の後処

バックアップ実行時の後処理のシェルスクリプト名は、以下の通りです。

非クラスタ運用の場合

/etc/opt/FJSVswsts/sh/OpcBackup.post

クラスタ運用の場合

/etc/opt/FJSVswsts/<論理ノード名>/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 or VG name of transaction disk
 10: #                         $2 Mount point of transaction disk
 11: #
 12: #       Error number
 13: #                2: Argument error
 14: #               11: mount error
 15: #               31: vgcfgrestore error
 16: #               12: fsck error
 17: 
 18: # Argument check
 19: case $# in
 20: 1)
 21:         ;;
 22: 2)
 23:         ;;
 24: *)
 25:         exit 2
 26:         ;;
 27: esac
 28: 
 29: device=$1
 30: mount_point=$2
 31: 
 32: # Determination of postprocessing file name
 33: 
 34: if [ "$SWSTGNODE" != "" ]
 35: then
 36:         swstg_node="/`echo $SWSTGNODE`"
 37: else
 38:         swstg_node=""
 39: fi
 40: 
 41: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log"
 42: 
 43: # Device type check
 44: trans="`echo $device | /usr/bin/grep "/dev/dsk/"`"
 45: lvmtrans="`echo $device | /usr/bin/grep "/dev/"`"
 46: vxpvtrans="`echo $device | /usr/bin/grep "/dev/vx/dmp/"`"
 47: if [ "$trans" != "" ]
 48: then
 49:         dev_type="physical"
 50:         dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`"
 51:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 52:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 53:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 54: elif [ "$vxpvtrans" != "" ]
 55: then
 56:         dev_type="vxvm_pv"
 57:         # /dev/vx/dmp/XXXX -> XXXX
 58:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`"
 59:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 60:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 61:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 62: elif [ "$lvmtrans" != "" ]
 63: then
 64:         dev_type="logical"
 65:         # /dev/vgXX -> vgXX
 66:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
 67:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 68:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 69:         bd_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".bd"
 70: else
 71:         exit 0
 72: fi
 73: 
 74: # Confirmation of postprocessing
 75: if [ ! -r $post_file ]
 76: then
 77:         exit 0
 78: fi
 79: post="`/usr/bin/cat $post_file`"
 80: 
 81: # Confirmation of FStype
 82: if [ ! -r $fstype_file ]
 83: then
 84:         fs=""
 85: else
 86:         fs="`/usr/bin/cat $fstype_file`"
 87: fi
 88: 
 89: # Restore VG Configuration
 90: if [ -r $bd_file ]
 91: then
 92:         bk_device="`/usr/bin/cat $bd_file`"
 93:         bk_trans="`echo $bk_device | /usr/bin/grep "/dev/dsk/"`"
 94:         bk_lvmtrans="`echo $bk_device | /usr/bin/grep "/dev/"`"
 95:         bk_vxpvtrans="`echo $bk_device | /usr/bin/grep "/dev/vx/dmp/"`"
 96:         if [ "$bk_trans" = "" -a "$bk_lvmtrans" != "" -a "$bk_vxpvtrans" = "" ]
 97:         then
 98:                 bk_vg_name="`echo $bk_device |/usr/bin/awk -F\/ '{ print $3 }'`"
 99:                 cfg_file="/etc/lvmconf/"$bk_vg_name".conf"
100:                 if [ ! -r $cfg_file ]
101:                 then
102:                         exit 31
103:                 fi
104:                 bk_pv_rname="`/usr/sbin/vgcfgrestore -n $bk_device -l 2> /dev/null |/usr/bin/awk '{print $1}' | /usr/bin/grep \"/dev/rdsk\"`"
105:                 if [ "$bk_pv_rname" = "" ]
106:                 then
107:                     echo "NULL: /usr/sbin/vgcfgrestore -n $bk_device -l 2> /dev/null |/usr/bin/awk '{print $1}' | /usr/bin/grep \"/dev/rdsk\"" > $err_log_path/$dev.vgcfgrestore
108:                     exit 31
109:                 fi
110:                 /usr/sbin/vgchange -a n $bk_device > /dev/null 2>&1
111:                 reststatus=0
112:                 for bk_pv_rname1 in $bk_pv_rname
113:                 do
114:                     /usr/sbin/vgcfgrestore -n $bk_device $bk_pv_rname1 > /dev/null 2>&1
115:                     if [ $? != 0 ]
116:                     then
117:                         /usr/sbin/vgcfgrestore -n $bk_device $bk_pv_rname1 >> $err_log_path/$dev.vgcfgrestore 2>&1
118:                     fi
119:                     if [ $? = 0 ]
120:                     then
121:                         /usr/bin/rm -f $err_log_path/$dev.vgcfgrestore
122:                         reststatus=1
123:                         break
124:                     fi
125:                 done
126:                 if [ "$SWSTGNODE" != "" ]
127:                 then
128:                     /usr/sbin/vgchange -c y $bk_device > /dev/null 2>&1
129:                     /usr/sbin/vgchange -a e $bk_device > /dev/null 2>&1
130:                 else
131:                     /usr/sbin/vgchange -a y $bk_device > /dev/null 2>&1
132:                 fi
133:                 if [ $reststatus = 0 ]
134:                 then
135:                     exit 31
136:                 fi
137:         fi
138: fi
139: 
140: # No processing
141: # When device was not mounted --- 3
142: # When devices of volume group was not mounted --- 6
143: # When the transaction disk is a VxVM physical volume --- 7
144: if [ "$post" = "none" ]
145: then
146:         /usr/bin/rm -rf $post_file 2> /dev/null
147:         /usr/bin/rm -rf $fstype_file 2> /dev/null
148:         /usr/bin/rm -rf $bd_file 2> /dev/null
149:         exit 0
150: fi
151: 
152: # mount processing
153: if [ "$post" = "mount" ]
154: then
155: 
156: # When device can be unmounted --- 2
157:         if [ "$dev_type" = "physical" ]
158:         then
159:                 /usr/bin/df -l $device > /dev/null 2>&1
160:                 if [ $? != 0 ]
161:                 then
162:                         if [ ! -r $fstype_file ]
163:                         then
164:                                 /usr/sbin/mount $device $mount_point 2> /dev/null
165:                         else
166:                                 if [ "$fs" = "" ]
167:                                 then
168:                                         /usr/sbin/mount $device $mount_point 2> /dev/null
169:                                 else
170:                                         /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null
171:                                 fi
172:                         fi
173:                         if [ $? != 0 ]
174:                         then
175:                                 retry_count=3
176:                                 sleep_time=1
177:                                 result_flag=1
178: 
179:                                 while [ $retry_count -gt 0 ]
180:                                 do
181:                                     if [ ! -r $fstype_file ]
182:                                     then
183:                                         /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1
184:                                     else
185:                                         if [ "$fs" = "" ]
186:                                         then
187:                                             /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1
188:                                         else
189:                                             /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1
190:                                         fi
191:                                     fi
192:                                     if [ $? != 0 ]
193:                                     then
194:                                         retry_count=`expr $retry_count - 1`
195:                                         /usr/bin/sleep $sleep_time
196:                                     else
197:                                         /usr/bin/rm -f $err_log_path/$dev.mount
198:                                         result_flag=0
199:                                         break
200:                                     fi
201:                                 done
202: 
203:                                 if [ $result_flag != 0 ]
204:                                 then
205:                                     exit 11
206:                                 fi
207:                         fi
208:                 fi
209: #       elif [ "$dev_type" = "logical" ]
210: #       then
211: #
212: # When devices of volume group can be unmounted --- 5
213: #       # Specify the name of volume group to mount
214: #               if [ "$device" = "/dev/vg**" ]
215: #               then
216: #                       # Mount all logical volumes of the volume group
217: #                       fs="hfs"
218: #                       lvname="/dev/vg**/*****"
219: #                       lv_mount_point="/**"
220: #
221: #                       /usr/bin/df -l $lvname > /dev/null 2>&1
222: #                       if [ $? != 0 ]
223: #                       then
224: #                               /usr/sbin/mount -F $fs $lvname $lv_mount_point 2> /dev/null
225: #                               if [ $? != 0 ]
226: #                               then
227: #                                        retry_count=3
228: #                                        sleep_time=1
229: #                                        result_flag=1
230: 
231: #                                        while [ $retry_count -gt 0 ]
232: #                                        do
233: #                                            /usr/sbin/mount -F $fs $lvname $lv_mount_point > $err_log_path/$dev.mount 2>&1
234: #                                            if [ $? != 0 ]
235: #                                            then
236: #                                                retry_count=`expr $retry_count - 1`
237: #                                                /usr/bin/sleep $sleep_time
238: #                                            else
239: #                                                rm -f $err_log_path/$dev.mount
240: #                                                result_flag=0
241: #                                                break
242: #                                            fi
243: #                                        done
244: #
245: #                                        if [ $result_flag != 0 ]
246: #                                        then
247: #                                            exit 11
248: #                                        fi
249: #                               fi
250: #                       fi
251: #               fi
252: 
253:         fi
254:         /usr/bin/rm -rf $post_file 2> /dev/null
255:         /usr/bin/rm -rf $fstype_file 2> /dev/null
256:         /usr/bin/rm -rf $bd_file 2> /dev/null
257:         exit 0
258: fi
259: 
260: # fsck processing
261: # When device cannot be unmounted                  --- 1
262: # When devices of volume group cannot be unmounted --- 4
263: if [ "$post" = "fsck" ]
264: then
265:         if [ -r $bd_file ]
266:         then
267:                 bk_device="`/usr/bin/cat $bd_file`"
268:                 bk_trans="`echo $bk_device | /usr/bin/grep "/dev/dsk/"`"
269:                 if [ "$bk_trans" != "" ]
270:                 then
271:                         if [ ! -r $fstype_file ]
272:                         then
273:                                 /usr/sbin/fsck -y $bk_device > /dev/null 2>&1
274:                         else
275:                                 if [ "$fs" = "" ]
276:                                 then
277:                                         /usr/sbin/fsck -y $bk_device > /dev/null 2>&1
278:                                 else
279:                                         /usr/sbin/fsck -y -F $fs $bk_device > /dev/null 2>&1
280:                                 fi
281:                         fi
282:                         if [ $? != 0 ]
283:                         then
284:                                 if [ "$fs" = "" ]
285:                                 then
286:                                         /usr/sbin/fsck -y $bk_device > $err_log_path/$dev.fsck 2>&1
287:                                 else
288:                                         /usr/sbin/fsck -y -F $fs $bk_device > $err_log_path/$dev.fsck 2>&1
289:                                 fi
290:                                 if [ $? != 0 ]
291:                                 then
292:                                         exit 12
293:                                 else
294:                                         /usr/bin/rm -f $err_log_path/$dev.fsck
295:                                 fi
296:                         fi
297: #               else
298: #                       # Specify the name of volume group to fsck
299: #                       if [ "$bk_device" = "/dev/vg**" ]
300: #                       then
301: #                               fs="hfs"
302: #                               lvname="/dev/vg**/r*****"
303: #
304: #                               fsck -F $fs -y $lvname > /dev/null 2>&1
305: #                               if [ $? != 0 ]
306: #                               then
307: #                                    if [ "$fs" = "" ]
308: #                                    then
309: #                                            fsck -y $lvname > $err_log_path/$dev.fsck 2>&1
310: #                                    else
311: #                                            fsck -y -F $fs $lvname > $err_log_path/$dev.fsck 2>&1
312: #                                    fi
313: #                                    if [ $? != 0 ]
314: #                                    then
315: #                                            exit 12
316: #                                    else
317: #                                            rm -f $err_log_path/$dev.fsck
318: #                                    fi
319: #                               fi
320: #                       fi
321:                 fi
322:         fi
323:         /usr/bin/rm -rf $post_file 2> /dev/null
324:         /usr/bin/rm -rf $fstype_file 2> /dev/null
325:         /usr/bin/rm -rf $bd_file 2> /dev/null
326:         exit 0
327: fi
328: 
329: exit 0

ボリュームグループをバックアップする場合

ファイルシステムが構築された論理ボリュームを含むボリュームグループがバックアップ対象の場合は、前後処理スクリプトを修正する必要があります。

スクリプトを修正後,前処理スクリプト(OpcBackup.pre)の158行目のexit文をコメント("#")化してください。

カスタマイズをしていない状態では、ボリュームグループに対する前処理はエラーとなります。

バックアップボリュームがボリュームグループの場合は、バックアップ後処理において、バックアップボリュームをLVMとして使用可能にするためにvgcfgrestoreコマンドによってボリュームグループ構成情報のリストアを実施しています。上記のスクリプトでは、標準のバックアップファイル「/etc/lvmconf/"ボリュームグループ名".conf」からボリューム構成情報のリストアを行っています。ボリュームグループ構成情報が別ファイルにバックアップされている場合は、スクリプトをカスタマイズしてください。
クラスタ運用している場合は、クラスタを構成する各ノードにボリュームグループ構成情報が存在している必要があります。

mountコマンドやfsckコマンドなどのOSコマンドのパラメーターやオプションなどは運用に合わせて,適宜修正してください。

共有モードのボリュームグループの場合

共有モードのボリュームグループの再構成は、後処理スクリプト(OpcBackup.post)の90-138,144,145および150をコメント化して、後処理スクリプトではボリュームグループの再構成を実施しないようにしてください。
バックアップ実行後に手動で以下の操作を行い、ボリュームグループの再構成を行ってください。
  1. ボリュームグループの停止(業務を構成している全ノードで実行します)

    # /usr/sbin/vgchange -a n <vg_name>
    
    #

  2. ボリュームグループ構成情報のリストア(ボリュームグループを作成したノードで実行します)

    # /usr/sbin/vgcfgrestore -n <vg_name> <pv_path> 
    
    #
  3. 共有可能なボリュームグループのマーク(ボリュームグループを作成したノードで実行します)

    # /usr/sbin/vgchange -S y -c y <vg_name> 
    
    #
  4. ボリュームグループの起動(業務を構成している全ノードで実行します)

    # /usr/sbin/vgchange -a s <vg_name>
    
    #

■VERITAS Cluster Serverでクラスタ運用する場合

VERITAS Cluster Serverでクラスタ運用を行う場合で、業務ボリュームのマウントポイントがクラスタ業務に登録されている場合は、前後処理スクリプトのカスタマイズが必要となります。

前後処理スクリプト内のマウント/アンマウント処理を、マウントポイントリソースのオフライン/オンライン処理に変更してください。

また、マウントポイントリソースのオフライン/オンラインを行ってから、実際にボリュームがアンマウント/マウントされるまでに時間差があります。そのため実際にアンマウント/マウントされるまで待ち合わせる処理(sleepやdfコマンドの結果を監視するなど)をオフライン/オンラインの成否を判定する個所の後に追加してください。

以下に前後処理スクリプトのカスタマイズ例を示します。

[例] バックアップ前処理スクリプト(OpcBackup.pre)のアンマウント処理変更
[115,124,181,193行目]

(変更前)

/usr/sbin/umount $mount_point

(変更後)

/opt/VRTSvcs/bin/hares -offline リソース名 -sys システム名

[例] バックアップ前処理スクリプト(OpcBackup.pre)のアンマウント待ち処理追加
[145,213行目]

(追加)

while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done

[例] バックアップ後処理スクリプト(OpcBackup.post)のマウント処理変更
[164,168,170,183,187,189,224,233行目]

(変更前)

/usr/sbin/mount $device $mount_point
/usr/sbin/mount -F $fs $device $mount_point
/usr/sbin/mount -F $fs $lvname $lv_mount_point

(変更後)

/opt/VRTSvcs/bin/hares -online リソース名 -sys システム名

[例] バックアップ後処理スクリプト(OpcBackup.post)のマウント待ち処理追加
[209,252行目]

(追加)

while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done

A.3 リストアの前後処理 

AdvancedCopy Managerでのリストアは、業務ボリュームがアンマウントされた状態で処理を行う必要があります。

そのため、業務ボリュームが物理ディスクの場合、前処理では、業務ボリューム名からそのボリュームのマウント状態を獲得し、次の処理を行います。

業務ボリュームの状態

前処理

マウントされている

業務ボリュームをアンマウントします。

アンマウントされている

何も処理しません。

後処理は、前処理で行った処理によって何をするのかを判断します。

前処理

後処理

業務ボリュームをアンマウントした。

業務ボリュームをマウントし直します。

何も処理しなかった。

何も処理しません。

この他にも、特殊な前後処理が必要な場合は、シェルスクリプトに処理を追加する必要があります。

スクリプトをカスタマイズする場合、エラーコードは以下の規約に従ってください。

エラーコード

用途

0-99

使用不可(AdvancedCopy Managerが予約)

100-255

使用可能

ファイルシステムが構築された論理ボリュームを含むボリュームグループをリストアする場合は、本マニュアルの『ボリュームグループをリストアする場合』を参照し、ファイルシステムが構築された全ての論理ボリュームに対してアンマウント/マウント処理を実施するように前後処理スクリプトをカスタマイズする必要があります。
リストア実行時の後処理スクリプトの196行目のファイルシステム名は、運用に合わせて適宜修正してください。

後処理に失敗した場合は、資源情報の整合性が不完全になっている可能性がありますので、資源整合コマンド(swstsrsemtch)を実施してください。

A.3.1 リストア実行時の前処

リストア実行時の前処理のシェルスクリプト名は、以下の通りです。

非クラスタ運用の場合

/etc/opt/FJSVswsts/sh/OpcRestore.pre

クラスタ運用の場合

/etc/opt/FJSVswsts/<論理ノード名>/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 or VG name of transaction disk
 10: #                             $2 Mount point of transaction disk
 11: #
 12: #       Error number
 13: #               2: Argument error (system error)
 14: #              10: umount error
 15: #              30: VG configuration file not found error
 16: #              99: Script not customize
 17: 
 18: 
 19: # Argument check
 20: case $# in
 21: 1)
 22:         ;;
 23: 2)
 24:         ;;
 25: *)
 26:         exit 2
 27:         ;;
 28: esac
 29: 
 30: device=$1
 31: mount_point=$2
 32: 
 33: # Determination of postprocessing file name
 34: 
 35: if [ "$SWSTGNODE" != "" ]
 36: then
 37:         swstg_node="/`echo $SWSTGNODE`"
 38: else
 39:         swstg_node=""
 40: fi
 41: 
 42: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log"
 43: 
 44: # Device type check
 45: trans="`echo $device | /usr/bin/grep "/dev/dsk/"`"
 46: lvmtrans="`echo $device | /usr/bin/grep "/dev/"`"
 47: vxpvtrans="`echo $device | /usr/bin/grep "/dev/vx/dmp/"`"
 48: if [ "$trans" != "" ]
 49: then
 50:         dev_type="physical"
 51:         dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`"
 52:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 53:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 54: elif [ "$vxpvtrans" != "" ]
 55: then
 56:         dev_type="vxvm_pv"
 57:         # /dev/vx/dmp/XXXX -> XXXX
 58:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`"
 59:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 60:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 61: elif [ "$lvmtrans" != "" ]
 62: then
 63:         dev_type="logical"
 64:         # /dev/vgXX -> vgXX
 65:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
 66:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 67:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 68: else
 69:         exit 0
 70: fi
 71: 
 72: # When the transaction disk is a physical device #############################
 73: if [ "$dev_type" = "physical" ]
 74: then
 75: 
 76: # When device was mounted --- 1
 77:         if [ "$mount_point" != "" ]
 78:         then
 79:                 /usr/bin/df -ln $mount_point 2>/dev/null | /usr/bin/awk -F: '{ print $2 }' | /usr/bin/awk '{ print $1 }' > $fstype_file
 80:                 /usr/sbin/umount $mount_point 2> /dev/null
 81:                 if [ $? != 0 ]
 82:                 then
 83:                     retry_count=3
 84:                     sleep_time=1
 85:                     result_flag=1
 86:             
 87:                     while [ $retry_count -gt 0 ]
 88:                     do
 89:                         /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1
 90:                         if [ $? != 0 ]
 91:                         then
 92:                             retry_count=`expr $retry_count - 1`
 93:                             /usr/bin/sleep $sleep_time
 94:                         else
 95:                             /usr/bin/rm -f $err_log_path/$dev.umount
 96:                             result_flag=0
 97:                             break
 98:                         fi
 99:                     done
100:             
101:                     if [ $result_flag != 0 ]
102: 
103:                     then
104:                         /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 
105:                         /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 
106: 
107:                         exit 10
108:                     fi
109:                 fi
110:                 echo "mount" > $post_file
111: 
112: # When device was not mounted --- 2
113:         else
114:                 echo "none" > $post_file
115:         fi
116: 
117: # When the transaction disk is a volume group ################################
118: elif [ "$dev_type" = "logical" ]
119: then
120: 
121:         # Check VG configuration file exists
122:         vg_name="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
123:         cfg_file="/etc/lvmconf/"$vg_name".conf"
124:         if [ ! -r $cfg_file ]
125:         then
126:                 exit 30
127:         fi
128: 
129: # Devices is volume group and script not customize
130:         exit 99
131: 
132: # When devices of volume group was mounted --- 3
133: #       # Specify the name of volume group to unmount
134: #       if [ "$device" = "/dev/vg**" ]
135: #       then
136: #
137: #               # Unmount all logical volumes of the volume group
138: #               mount_point="/**"
139: #               /usr/sbin/umount $mount_point 2>/dev/null
140: #               if [ $? != 0 ]
141: #               then
142: #                    retry_count=3
143: #                    sleep_time=1
144: #                    result_flag=1
145: #            
146: #                    while [ $retry_count -gt 0 ]
147: #                    do
148: #                        /usr/sbin/umount $mount_point > $err_log_path/$dev.umount 2>&1
149: #                        if [ $? != 0 ]
150: #                        then
151: #                            retry_count=`expr $retry_count - 1`
152: #                            sleep $sleep_time
153: #                        else
154: #                            rm -f $err_log_path/$dev.umount
155: #                            result_flag=0
156: #                            break
157: #                        fi
158: #                    done
159: #            
160: #                    if [ $result_flag != 0 ]
161: #
162: #                    then
163: #                        /usr/sbin/fuser -cu $mount_point> $err_log_path/$dev.fuser 2>&1 
164: #                        /usr/bin/ps -ef > $err_log_path/$dev.ps 2>&1 
165: #
166: #                        exit 10
167: #                    fi
168: #               fi
169: #               echo "mount" > $post_file
170: #       fi
171: 
172: # When devices of volume group was not mounted --- 4
173: #       # Specify the name of volume group to do nothing
174: #       if [ "$device" = "/dev/vg**" ]
175: #       then
176: #                echo "none" > $post_file
177: #       fi
178: #
179: # When the transaction disk is a VxVM physical volume --- 5 ##################
180: elif [ "$dev_type" = "vxvm_pv" ]
181: then
182:         # Nothing is done to VxVM PV. 
183:         #
184:         echo "none" > $post_file
185: fi
186: exit 0

マウントされているがアンマウントできない業務ボリュームに対しては、リストアはできません。リストア先のデバイスを指示してください。

A.3.2 リストア実行時の後処

リスト実行時の後処理のシェルスクリプト名は、以下の通りです。

非クラスタ運用の場合

/etc/opt/FJSVswsts/sh/OpcRestore.post

クラスタ運用の場合

/etc/opt/FJSVswsts/<論理ノード名>/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 or VG name of transaction disk
 10: #                                 $2 Mount point of transaction disk
 11: #
 12: #       Error number
 13: #               2: Argument error
 14: #              11: mount error
 15: #              31: vfcfgrestore error
 16: #              12: fsck error
 17: 
 18: # Argument check
 19: case $# in
 20: 1)
 21:         ;;
 22: 2)
 23:         ;;
 24: *)
 25:         exit 2
 26:         ;;
 27: esac
 28: 
 29: device=$1
 30: mount_point=$2
 31: 
 32: # Determination of postprocessing file name
 33: 
 34: if [ "$SWSTGNODE" != "" ]
 35: then
 36:         swstg_node="/`echo $SWSTGNODE`"
 37: else
 38:         swstg_node=""
 39: fi
 40: 
 41: err_log_path="/var/opt/FJSVswsts"$swstg_node"/log"
 42: 
 43: trans="`echo $device | /usr/bin/grep "/dev/dsk/"`"
 44: lvmtrans="`echo $device | /usr/bin/grep "/dev/"`"
 45: vxpvtrans="`echo $device | /usr/bin/grep "/dev/vx/dmp/"`"
 46: if [ "$trans" != "" ]
 47: then
 48:         dev_type="physical"
 49:         dev="`echo $device | /usr/bin/sed "s/\/dev\/dsk\///"`"
 50:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 51:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 52: elif [ "$vxpvtrans" != "" ]
 53: then
 54:         dev_type="vxvm_pv"
 55:         # /dev/vx/dmp/XXXX -> XXXX
 56:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $5 }'`"
 57:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 58:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 59: elif [ "$lvmtrans" != "" ]
 60: then
 61:         dev_type="logical"
 62:         # /dev/vgXX -> vgXX
 63:         dev="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
 64:         post_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".pre"
 65:         fstype_file="/etc/opt/FJSVswsts"$swstg_node"/data/DEFAULT/"$dev".fstype"
 66: else
 67:         exit 0
 68: fi
 69: 
 70: # Confirmation of postprocessing
 71: if [ ! -r $post_file ]
 72: then
 73:         exit 0
 74: fi
 75: post="`/usr/bin/cat $post_file`"
 76: 
 77: # Confirmation of FStype
 78: if [ ! -r $fstype_file ]
 79: then
 80:         fs=""
 81: else
 82:         fs="`/usr/bin/cat $fstype_file`"
 83: fi
 84: 
 85: # Restore VG Configuration
 86: if [ "$dev_type" = "logical" ]
 87: then
 88:         vg_name="`echo $device | /usr/bin/awk -F\/ '{ print $3 }'`"
 89:         cfg_file="/etc/lvmconf/"$vg_name".conf"
 90:         if [ ! -r $cfg_file ]
 91:         then
 92:                 exit 31
 93:         fi
 94:         pv_rname="`/usr/sbin/vgcfgrestore -n $device -l 2> /dev/null | /usr/bin/awk '{print $1}' | /usr/bin/grep \"/dev/rdsk\"`"
 95:         if [ "$pv_rname" = "" ]
 96:         then
 97:             echo "NULL: /usr/sbin/vgcfgrestore -n $device -l 2> /dev/null | /usr/bin/awk '{print $1}' | /usr/bin/grep \"/dev/rdsk\"" > $err_log_path/$dev.vgcfgrestore 2>&1
 98:             exit 31
 99:         fi
100:         /usr/sbin/vgchange -a n $device > /dev/null 2>&1
101:         reststatus=0
102:         for pv_rname1 in $pv_rname
103:         do
104:                 /usr/sbin/vgcfgrestore -n $device $pv_rname1 > /dev/null 2>&1
105:                 if [ $? != 0 ]
106:                 then
107:                     /usr/sbin/vgcfgrestore -n $device $pv_rname1 >> $err_log_path/$dev.vgcfgrestore 2>&1
108:                 fi
109:                 if [ $? = 0 ]
110:                 then
111:                     /usr/bin/rm -f $err_log_path/$dev.vgcfgrestore
112:                     reststatus=1
113:                        break
114:                 fi
115:         done
116:     if [ "$SWSTGNODE" != "" ]
117:     then
118:         /usr/sbin/vgchange -c y $device > /dev/null 2>&1
119:         /usr/sbin/vgchange -a e $device > /dev/null 2>&1
120:     else
121:         /usr/sbin/vgchange -a y $device > /dev/null 2>&1
122:     fi
123:     if [ $reststatus = 0 ]
124:     then
125:         exit 31
126:     fi
127: fi
128: 
129: # No processing
130: # When device was not mounted --- 2
131: # When devices of volume group was not mounted --- 4
132: # When the transaction disk is a VxVM physical volume --- 5
133: if [ "$post" = "none" ]
134: then
135:         /usr/bin/rm -rf $post_file 2> /dev/null
136:         /usr/bin/rm -rf $fstype_file 2> /dev/null
137:         exit 0
138: fi
139: 
140: # mount processing
141: if [ "$post" = "mount" ]
142: then
143: 
144: # When device was mounted --- 1
145:         if [ "$dev_type" = "physical" ]
146:         then
147:                 /usr/bin/df -l $device > /dev/null 2>&1
148:                 if [ $? != 0 ]
149:                 then
150:                         if [ ! -r $fstype_file ]
151:                         then
152:                                 /usr/sbin/mount $device $mount_point 2> /dev/null
153:                         else
154:                                 if [ "$fs" = "" ]
155:                                 then
156:                                         /usr/sbin/mount $device $mount_point 2> /dev/null
157:                                 else
158:                                         /usr/sbin/mount -F $fs $device $mount_point 2> /dev/null
159:                                 fi
160:                         fi
161:                         if [ $? != 0 ]
162:                         then
163:                                 retry_count=3
164:                                 sleep_time=1
165:                                 result_flag=1
166: 
167:                                 while [ $retry_count -gt 0 ]
168:                                 do
169:                                     if [ ! -r $fstype_file ]
170:                                     then
171:                                         /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1
172:                                     else
173:                                         if [ "$fs" = "" ]
174:                                         then
175:                                             /usr/sbin/mount $device $mount_point > $err_log_path/$dev.mount 2>&1
176:                                         else
177:                                             /usr/sbin/mount -F $fs $device $mount_point > $err_log_path/$dev.mount 2>&1
178:                                         fi
179:                                                     fi
180:                                     if [ $? != 0 ]
181:                                     then
182:                                         retry_count=`expr $retry_count - 1`
183:                                         /usr/bin/sleep $sleep_time
184:                                     else
185:                                         /usr/bin/rm -f $err_log_path/$dev.mount
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: #       elif [ "$dev_type" = "logical" ]
198: #       then
199: #
200: # When devices of volume group was mounted --- 3
201: #               # Specify the name of volume group to mount
202: #               if [ "$device" = "/dev/vg**" ]
203: #               then
204: #                       # Mount all logical volumes of the volume group
205: #                       fs="hfs"
206: #                       lvname="/dev/vg**/*****"
207: #                       lv_mount_point="/**"
208: #
209: #                       fsck -F $fs -y $lvname > /dev/null 2>&1
210: #                       if [ $? != 0 ]
211: #                       then
212: #                               fsck -F $fs -y $lvname > $err_log_path/$dev.fsck 2>&1
213: #                               if [ $? != 0 ]
214: #                               then
215: #                                       exit 12
216: #                               else
217: #                                       rm -f $err_log_path/$dev.fsck
218: #                               fi
219: #                       fi
220: #                       /usr/bin/df -l $lvname > /dev/null 2>&1
221: #                       if [ $? != 0 ]
222: #                       then
223: #                               /usr/sbin/mount -F $fs $lvname $lv_mount_point 2> /dev/null
224: #                               if [ $? != 0 ]
225: #                               then
226: #                                    retry_count=3
227: #                                    sleep_time=1
228: #                                    result_flag=1
229: #    
230: #                                    while [ $retry_count -gt 0 ]
231: #                                    do
232: #                                        /usr/sbin/mount -F $fs $lvname $lv_mount_point > $err_log_path/$dev.mount 2>&1
233: #                                        if [ $? != 0 ]
234: #                                        then
235: #                                            retry_count=`expr $retry_count - 1`
236: #                                            /usr/bin/sleep $sleep_time
237: #                                        else
238: #                                            rm -f $err_log_path/$dev.mount
239: #                                            result_flag=0
240: #                                            break
241: #                                        fi
242: #                                    done
243: #    
244: #                                    if [ $result_flag != 0 ]
245: #                                    then
246: #                                        exit 11
247: #                                    fi
248: #                               fi
249: #                       fi
250: #               fi
251:         fi
252:         /usr/bin/rm -rf $post_file 2> /dev/null
253:         /usr/bin/rm -rf $fstype_file 2> /dev/null
254:         exit 0
255: fi
256: 
257: exit 0

ボリュームグループをリストアする場合

ファイルシステムが構築された論理ボリュームを含むボリュームグループがリストア対象の場合は、前後処理スクリプトを修正する必要があります。

スクリプトを修正後,前処理スクリプト(OpcRestore.pre)の130行目のexit文をコメント("#")化してください。

◆前処理スクリプト(OpcRestore.pre)の134〜170行目のコメント("#")および後処理スクリプト(OpcRestore.post)の197,198,202〜250行目のコメント("#")をエディタ等で消去し、ファイルシステムが構築された全ての論理ボリュームに対してアンマウント/マウント処理が実施されるようにコメント内の記述を適宜修正してください。("*"で示す箇所は実際の環境に合わせて変更してください。また、複数の論理ボリュームが対象となる場合は、前処理スクリプト(OpcRestore.pre)の138〜168行目の処理および、後処理スクリプト(OpcRestore.post)の206〜249行目の処理をボリューム数分記述してください。)

◆バックアップ時に業務ボリュームがマウントされていた場合,かつバックアップボリュームに対してfsckを実施していない場合は,リストア後に業務ボリューム内のファイルシステムが構築された全ての論理ボリュームに対してfsckを実施する必要があります。

カスタマイズをしていない状態では、ボリュームグループに対する前処理はエラーとなります。

業務ボリュームがボリュームグループの場合は、リストア後処理において、業務ボリュームをLVMとして使用可能にするためにvgcfgrestoreコマンドによってボリュームグループ構成情報のリストアを実施しています。上記のスクリプトでは、標準のバックアップファイル「/etc/lvmconf/"ボリュームグループ名".conf」からボリューム構成情報のリストアを行っています。ボリュームグループ構成情報が別ファイルにバックアップされている場合は、スクリプトをカスタマイズしてください。
クラスタ運用している場合は、クラスタを構成する各ノードにボリュームグループ構成情報が存在している必要があります。

mountコマンドやfsckコマンドなどのOSコマンドのパラメーターやオプションなどは運用に合わせて,適宜修正してください。

共有モードのボリュームグループの場合

共有モードのボリュームグループの再構成は、後処理スクリプト(OpcRestore.post)の96-127,133,134および138をコメント化して、後処理スクリプトではボリュームグループの再構成を実施しないようにしてください。
リストア実行後に手動で以下の操作を行い、ボリュームグループの再構成を行ってください。
  1. ボリュームグループの停止(業務を構成している全ノードで実行します)

    # /usr/sbin/vgchange -a n <vg_name>
    
    #
  2. ボリュームグループ構成情報のリストア(ボリュームグループを作成したノードで実行します)

    # /usr/sbin/vgcfgrestore -n <vg_name> <pv_path> 
    
    #
  3. 共有可能なボリュームグループのマーク(ボリュームグループを作成したノードで実行します)

    # /usr/sbin/vgchange -S y -c y <vg_name> 
    
    #
  4. ボリュームグループの起動(業務を構成している全ノードで実行します)

    # /usr/sbin/vgchange -a s <vg_name>
    
    #

■VERITAS Cluster Serverでクラスタ運用する場合

VERITAS Cluster Serverでクラスタ運用を行う場合で、業務ボリュームのマウントポイントがクラスタ業務に登録されている場合は、前後処理のカスタマイズが必要となります。

前後処理スクリプト内のマウント/アンマウント処理を、マウントポイントリソースのオフライン/オンライン処理に変更してください。

また、マウントポイントリソースのオフライン/オンラインを行ってから、実際にボリュームがアンマウント/マウントされるまでに時間差があります。そのため実際にアンマウント/マウントされるまで待ち合わせる処理(sleepやdfコマンドの結果を監視するなど)をオフライン/オンラインの成否を判定する個所の後に追加してください。

以下に前後処理スクリプトの変更例を示します

[例] リストア前処理スクリプト(OpcRestore.pre)のアンマウント処理変更
[80,89,139,148行目]

(変更前)

/usr/sbin/umount $mount_point

(変更後)

/opt/VRTSvcs/bin/hares -offline リソース名 -sys システム名

[例] リストア前処理スクリプト(OpcRestore.pre)のアンマウント待ち処理追加
[110,169行目]

(追加)

while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done

[例] リストア後処理スクリプト(OpcRestore.post)のマウント処理変更
[152,156,158,171,175,177,223,232行目]

(変更前)

/usr/sbin/mount $device $mount_point
/usr/sbin/mount -F $fs $device $mount_point
/usr/sbin/mount -F $fs $lvname $lv_mount_point

(変更後)

/opt/VRTSvcs/bin/hares -online リソース名 -sys システム名

[例] リストア後処理スクリプト(OpcRestore.post)のマウント待ち処理追加
[197,251行目]

(追加)

while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done


目次 索引 前ページ次ページ

All Rights Reserved, Copyright(C) 富士通株式会社 2002-2006