[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]