The method to customize the shell script for replication pre/post-processing is explained below.
When you do not want to unmount the replication target volume
If you do not want to unmount a mounted volume, remove the comment characters ("#") from lines 68-72, 75 and 107 (in the case of a physical volume) or lines 123-128 (in the case of a volume group) in the pre-processing script (RepSrc.pre), and point to the target device in line 70 or 125. In addition, do not perform an update operation on a replication source volume file system after performing the sync command on line 68 or 125 until post-processing for original volume. If a file system update is performed in the meantime, the replica is extracted with an imperfect file system. In this case the fsck command which is carried out by the post-processing script (RepDst.post) may serve as an error.
The replication source volume must be unmounted.
When replicating a file system which is part of a logical volume in a volume group, the processing scripts will need to be modified as follows:
Remove the comment ("#") from lines 133-166 in the source volume pre-processing script (RepSrc.pre), and lines 144-184 in the source volume post-processing script (RepSrc.post). Correct the description in a comment so that the unmount/mount processing is carried out for all logical volumes in which a file system is constructed. Change the sections indicated with an upper case "X" to match the actual environment. If more than one logical volume is being processed, repeat lines 136-164 of the pre-processing script and lines 151-183 of the post-processing script once for each logical volume. Remove the comment ("#") from lines 117-150 in the destination volume pre-processing script (RepDst.pre), and lines 210, 211 and 214-251 in the destination volume post-processing script (RepDst.post). Correct the description in a comment so that the unmount/mount processing is carried out for all logical volumes in which a file system is constructed. Change the sections indicated with an upper case "X" to match the actual environment. If more than one logical volume is being processed, repeat lines 120-149 of the pre-processing script and lines 218-250 of the post-processing script once for each logical volume.
When not unmounting copied material volume, it is necessary to carry out fsck to all the logical volumes by which the file system in copy place volume was built with the post-processing script of copy place volume.
Insert a comment ("#") into line 118 of the source volume pre-processing script and line 112 of the destination pre-processing script.
Note
Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.
When a destination volume is a volume group, in order to enable use of the volume for LVM, volume group configuration information is restored using the "vgcfgrestore" command in the restore post-processing. 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 the script will need to be customized.
Modify the parameters and options of the OS commands (such as the mount command and the fsck command), appropriately for their use.
For shared-mode volume groups:
When reconfiguring shared-mode volume groups, comment out lines 78-118, 121, 122 and 152 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 names on line 150 of the replication source volume post-processing shell script (RepSrc.post) and lines 127, 139, and 217 of the replication destination volume post-processing shell script (RepDst.post) as appropriate for the operation.
Cluster operation using VERITAS Cluster Server
Customization of the pre-processing and post-processing scripts is required when performing cluster operations using VERITAS Cluster Server, and when the mount point of the original/source volume is registered in the cluster transaction.
Change unmount/mount processing in the pre-processing and post-processing scripts 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 offline/online 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 77, 87, 137 and 146]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[lines 106 and 165]
(addition) | while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |
[lines 71, 81, 121 and 130]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
[lines 100 and 149]
(addition) | while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |
[lines 98, 102, 104, 117, 121, 123, 157 and 166]
(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 |
[lines 143 and185]
(addition) | while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |
[lines 165, 169, 171, 188, 190, 224 and 233]
(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 |
[lines 210 and 252]
(addition) | while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |