Make sure all your LV's are mirrored in a AIX volume group
brian_s 270002K5X3 Comment (1) Visits (31000)
AIX makes it super easy to mirror a volume group initially (i.e. mirrorvg). Unfortunately it is somewhat difficult to keep everything mirrored after the initial setup. For example, when new filesystems are added they will not be mirrored automatically.
To check to see if a LV is mirrored, you need to check that a couple of conditions are met.
In the "lsvg -l volumegroup" output you will see a column labeled "PVs". In a mirrored LV this will always be at least 2. However, it is possible that PVs will be 2 or more when the LV isn't mirrored (for example this happens if the LV is larger than 1 of the physical disks). Here is an example of a LV with 2 PVs that isn't mirrored (notice LPs and PPs are the same number):
The other thing to check in the "lsvg -l" output is the LP's versus the PP's. In a mirrored LV the PPs (Physical Partitions) will be at least double the LPs (Logical Partitions). However, it is possible for the PPs to be double the LPs and the LV to not be truly mirrored (for example if there are multiple copies all on same physical hdisk). Here is an example of an LV with PPs double the LPs but its not truly mirrored because both copies are on the same disk (notice the PVs = 1).
So to check that an LV is mirrored you need to make sure that PV's is at least 2 AND that the PP's is at least double the LP's. Here is an example of a mirrored LV:
Here is a simple script to check this. You can specify a volume group name as a parameter, or it will default to rootvg if nothing is specified. If there is no output, all the LV's in the volume group are mirrored. If it detects issues, it will print out a line for each LV not mirrored. It excludes the livedump, fwdump, and sysdump LV's from being checked.