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 130 of the pre-processing script (OpcRestore.pre) to remove the exit statement
Eliminate the comment ("#") from lines 134-170 of the pre-processing script (OpcRestore.pre), and also from lines 197,198 and 202-250 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 138-168 of the pre-processing script (OpcRestore.exe) and lines 206-249 of the post-processing script (OpcRestore.post) once for each additional logical volume).
If the operating volume was not unmounted in the pre-processing script, and if fsck is not being carried out to the backup volume, then the fsck command will need to be executed (to all the logical volumes contained in the backup volume) in post-processing
Note
Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.
When the transaction volume is a volume group, in order to enable use of the backup volume as LVM, volume group configuration information is restored using the vgcfgrestore command in the restore post-processing. In the above-mentioned script, volume configuration information is restored from the standard backup file "/etc/lvmconf/volume-group-name.conf". If volume group configuration information is backed up by another file, please customize the script.
In cluster operation, the respective nodes comprising the cluster must have volume group configuration information.
Please correct parameters, options, etc. of the OS command, such as the "mount" command and the "fsck" command, according to their employment.
For shared-mode volume groups:
When reconfiguring shared-mode volume groups, comment out line numbers 96-127, 133, 134 and 138 in the post-processing script (OpcBackup.post) to prevent the volume group from being reconfigured by the post-processing script.
Reconfigure the volume group by manually performing the following steps after the Replication has been executed.
Stop the volume group (on all nodes involved in the transaction).
# /usr/sbin/vgchange -a n <vg_name> # |
Restore volume group configuration information (on the node where the volume group was created).
# /usr/sbin/vgcfgrestore -n <vg_name> <pv_path> # |
Mark the volume group as shareable (on the node where the volume group was created).
# /usr/sbin/vgchange -S y -c y <vg_name> # |
Start the volume group (on all nodes involved in the transaction).
# /usr/sbin/vgchange -a s <vg_name> # |
File system name
Change the file system name on line 205 of the post-processing shell script (OpcRestore.post) that is executed when restore is performed as appropriate for the operation.
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 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 80,89,139,148th]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[line 110,169th]
(addition) | while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |
[lines 152,156,158,171,175,177,223,232nd]
(before change) | /usr/sbin/mount $device $mount_point /usr/sbin/mount -F $fs $device $mount_point /usr/sbin/mount -F $fs $lvname $lv_mount_point |
(after change) | /opt/VRTSvcs/bin/hares -online resource-name -sys system-name |
[line 197,251st]
(addition) | while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |