The method of customizing the shell script for backup pre- and post-processing is explained below.
When you do not want to unmount a transaction volume
If you do not want to unmount a mounted transaction volume, eliminate the comment characters ("#") in lines 101-110, 113 and 146 (in the case of a physical volume) or lines 163-172 (in the case of a volume group), and point to the target device in line 101 or line 163.
In addition, do not perform an update operation on a transaction volume file system after performing the sync command on line 108 or line 169 until backup post-processing. If a file system update is performed in the meantime, the backup is taken with a corrupted file system. In this case the fsck command executed by the post-processing may raise an error.
When you are backing up the volume group containing the logical volume used to build the file system, insert a comment character ("#") into line 158 of the pre-processing script (OpcBackup.pre) to remove the exit statement.
Please remove the comment ("#") from lines 177-214 of the pre-processing script (OpcBackup.pre), as well as from lines 209, 210 and 214-251 of the post-processing script (OpcBackup.post). Correct the description in a comment so that unmount/mount processing is carried out on all the logical volumes across which the file system exists. Change the parts shown as "X" to match the actual environment. If more than one logical volume is being processed, repeat lines 180-212 of the pre-processing script (OpcBackup.exe) and lines 218-250 of the post-processing script (PpcBackup.post) once for each additional logical volume.
If the operating volume was not unmounted in the pre-processing script then the fsck command will need to be executed (on all the logical volumes contained in the backup volume) in post-processing. Remove the comment ("#") in lines 297-320 of the post-processing script (OpcBackup.post), and correct the description in a comment so that fsck processing is carried out on all the logical volumes across which the file system exists. Change the parts shown as "X" to match the actual environment. If more than one logical volume is being processed, repeat lines 309-319 once for each additional logical volume.
Note
Note that unmount/mount processing to a volume group is not carried out if the scripts have not been customized.
When the backup 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 post-processing. The 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.
Correct 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 line numbers 90-138, 144, 145 and 150 in the post-processing script (OpcBackup.post) to prevent the volume group from being reconfigured by the script.
Reconfigure the volume group by manually performing the following steps after the backup 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 lines 217 and 301 of the post-processing shell script (OpcBackup.post) that is executed when backup is performed as appropriate for the operation.
Cluster operation by 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 transaction 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 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 115,124,181,193rd]
(before change) | /usr/sbin/umount $mount_point |
(after change) | /opt/VRTSvcs/bin/hares -offline resource-name -sys system-name |
line 145,213rd]
(addition) | while /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |
[lines 164,168,170,183,187,189,224,233rd]
(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 209,252nd]
(addition) | while ! /usr/bin/df -l "$device">/dev/null 2>&1; do :; done |