Pages

Fixing PV ID Mismatch While Varyon VG in IBM AIX


In IBM AIX environments, administrators sometimes encounter a PV (Physical Volume) ID mismatch issue when trying to varyon a Volume Group (VG).

This usually occurs after disk replacements, SAN migrations, or cloning operations that cause the disk’s metadata to differ from the system’s Object Data Manager (ODM) records.

When this mismatch happens, the Volume Group fails to varyon, preventing access to logical volumes (LVs) and filesystems.

This article explains how to safely fix the issue by cleaning and re-creating the Volume Group while preserving existing data.

Common Error Messages:

You may see one of the following errors when attempting to varyon the VG:
0516-010 : Unable to varyon volume group <vgname>.
PV ID xxxxxxxxxxx mismatch detected for hdiskX.
or
0516-052 varyonvg: Volume group cannot be varied on because PV identifiers do not mat
ch.

Step-by-Step Resolution:
Follow these steps carefully to fix the PV ID mismatch and recover the VG:

1. Export the Volume Group
Remove the VG definition from ODM to prevent configuration conflicts:
# exportvg datavg
This does not delete data — it only removes the VG entry from the system database.

2. Clear the Disk Metadata
Reset the PV information on the affected disk to remove the old PV ID:
# chdev -a pv=clear -l hdiskX
This prepares the disk for reinitialization with a new PV header.

3. Remove and Reconfigure the Disk
Remove the disk from the device list, then rescan to reconfigure it:
# rmdev -dl hdiskX
# cfgmgr -v
Running cfgmgr forces AIX to detect the disk again with a fresh PV ID.

4. Re-Import the Volume Group or Recreate the Volume Group

Option A: Import the VG
If the disk’s metadata is still valid and intact, you can import the VG instead of recreating it:
# importvg -y datavg hdiskX
This rebuilds the VG definition in ODM using the VG metadata stored on the disk.

Option B: Recreate the VG
If importvg fails, recreate the VG using the cleaned disk:
# recreatevg -y datavg hdiskX
recreatevg scans the disk and rebuilds the VG structure in ODM.
It can re-detect existing LVs if they are still intact on the disk.

5. Rename Logical Volumes (Optional)
If LV names differ or need alignment with old names:
# chlv -n <New_LV_Name> <Old_LV_Name>

6. Rename Filesystems
Adjust mount points to match your previous setup:
# chfs -m <New_FS_Name> <Old_FS_Name>

7. Mount Filesystems
Finally, mount your filesystems and verify they are online:
# mount <New_FS_Name>
# df -g

No comments:

Post a Comment