[linux-lvm] How to reliably detect duplicate PVs with the same UUID

Dénes Németh mr.nemeth.denes at gmail.com
Tue Sep 18 19:50:03 UTC 2012


Hi all

Can anyone help me how
1. can I detect if multiple PV with the same UUID is present?
2. determine the name of the name of the volume group in which the multiple
pvs are found

The only thing that I could come up with:

The return status of pvs is zero.
if [ `pvs | grep Duplicate | wc -l` -ne 0 ] ; then
  echo "Found duplicates"
fi

The problem with this is that "Duplicates" is language specific :(

The second problem with pvs is that it incorrectly reports device names.
It says that "using /dev/sda instead of /dev/sdb"
/dev/sda pvuuid vgname

it is compleatly undeterministic if sda or sdb is reported
even if logical volume is active in that volume group
naturally after vgimportclone /dev/sdb
pvs returns to behave normally

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/linux-lvm/attachments/20120918/a65c7942/attachment.htm>


More information about the linux-lvm mailing list