The method to customize the shell script for restore pre/post-processing is explained below.
When restoring a file system that is part of a logical volume in a volume group, insert a comment character ("#") into line 70 of the pre-processing script (OpcRestore.pre) to remove the exit statement.
Remove the comment character from lines 75-141 of the pre-processing script (OpcRestore.pre), and also from lines 95-170 of the post-processing script (OpcRestore.post). Correct the description in the comment so that unmount/mount processing is carried out on all the logical volumes used to build the file system. Modify the parts shown as "X" to match the actual environment. If more than one logical volume is being processed, repeat lines 111-140 of the pre-processing script (OpcRestore.exe) and lines 133-164 of the post-processing script (OpcRestore.post) once for each additional logical volume).
When the backup volume is mounted, the LVM management information in the backup volume is rewritten and the normal procedure cannot be used to restore the volume. In such cases, convert lines 65 to 79 and 95 to 170 in the post-processing script (OpcRestore.post) into comments ("#"). Furthermore, an additional step is required after restoration is completed. Refer to "9.1.4 Notes on restoration" for more information.
Note
Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.
Please correct parameters, options, etc. of the OS command, such as the "mount" command and the "fsck" command, according to their employment.
Cluster operations on VERITAS Cluster Server
Customization of the pre-processing and post-processing scripts is required, when performing cluster operations on VERITAS Cluster Server, and when the mount point of the transaction volume is registered in the cluster transaction.
Change the unmount/mount processing in the pre-processing and post-processing script into offline/online processing of the mount point resource.
The mount point resource relating to the Volume is immediately offline/online whilst there will be a time delay before access is actually prevented when mount/unmount is used.
Please note that once the online/offline command is issued there will be a delay before the mount/unmount command can be executed. The "sleep" and "df" commands can be used to delay the mount/ unmount until after the process that sets the volumes online or offline has completed.
The examples below show how the pre-processing and post-processing scripts are modified.
[lines 81, 90, 112 and 121]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[lines 110 and 141]
(addition) | mount_status="mounted" while [ $mount_status = "mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |
[lines 105, 114, 138 and 147]
(before change) | /usr/sbin/mount $lvname $lv_mount_point |
(after change) | /opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[lines 132 and 165]
(addition) | mount_status="not_mounted" while [ $mount_status = "not_mounted" ] do mount_status=`/usr/sbin/mount | /usr/bin/nawk -v lv=$lvname 'lv==$1{flag=1; exit;} END{if(flag==1) print "mounted"; else print "not_mounted";}'` done |