Synchronizes all physical partitions on a physical volume with the related copies of the logical partition to which they correspond.
Logical Volume Manager Library (liblvm.a)
#include <lvm.h>
int lvm_resyncpv (VG_ID, PV_ID, Force) struct unique_id *VG_ID; struct unique_id *PV_ID; int Force;
The lvm_resyncpv subroutine synchronizes all copies of the corresponding logical partition for each physical partition on the physical volume specified by the PV_ID parameter. The VG_ID parameter specifies the volume group that contains the physical volume to be resynced. The volume group must be varied on, or the LVM_OFFLINE error code is returned.
The Force parameter is used to specify whether all physical copies or only stale physical copies of a logical partition are to be resynchronized. When the Force parameter is False, a good physical copy is propagated only to the stale physical copies. This is sufficient for most logical volumes.
If the Force parameter is True, a good physical copy is chosen and propagated to all other copies of the logical partition regardless of whether they are stale. Setting the Force parameter to True is sometimes necessary in cases where mirror write consistency recovery was not specified for the logical volume. This is especially important after a crash occurs while writing to the logical volume. It is recommended that mirror write consistency be selected for most mirrored logical volumes. For more information on mirror-write consistency, see the lvm_createlv and lvm_changelv subroutines.
Notes:
- The resync of the physical volume is done by resyncing entire logical partitions to which any stale physical partitions belong on the physical volume. Because a complete logical partition is resynced, other physical volumes other than the one specified may be partially or completely resynced.
- You must have root user authority to use this subroutine.
VG_ID | Specifies the volume group that contains the physical volume to be resynced. |
PV_ID | Specifies the physical volume. |
Force | Specifies the physical copies of a logical partition to be synchronized. |
The lvm_resyncpv subroutine returns a value of 0 upon successful completion.
If the lvm_resyncpv subroutine fails, it returns one of the following error codes:
This subroutine is part of Base Operating System (BOS) Runtime.
The lvm_changelv subroutine, lvm_createlv subroutine, lvm_resynclv subroutine, lvm_resynclp subroutine, lvm_varyonvg subroutine.
List of Logical Volume Subroutines and Logical Volume Programming Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.