Hi
I used in the past output of xd command line to get PVID of the device which is part of VG.
However this is not working anymore when PV added to VG version 2.0 or 2.1 (pvcreate -V 2.x...) .
Any disk added to VG version 2.0 or 2.1 report same information.
This is PV used by VG version 1.0 (all good)
# xd -An -j8200 -N16 -tx /dev/disk/disk30
a4724926 4e727b29 a4724926 4e736059
This PV used with VG version 2.0
# xd -An -j8200 -N16 -tx /dev/disk/disk41
20000 0 41303030 30303030
This PV used with VG version 2.1
# xd -An -j8200 -N16 -tx /dev/disk/disk67
20000 0 41303030 30303030
As you can see there is no difference between output for device disk41 & disk67.
Does anyone have any solution how to correctly obtain PVID for VG version 2.0 or 2.1?
Thanks
Dmitriy
Solved! Go to Solution.
LVM layout 2 puts things in different locations. Even lvmtab has a cousin: lvmtab_p
Unlike lvmtab though, lvmtab_p has more information that is visible.
You can use strings /etc/lvmtab_p to see the VGID. But for scripting, you can identify the LVM layout with this code:
xd -An -j8192 -N8 -tc $MYDISK | tr -d " \t"
where $MYDISK is a disk PV. The result will be LVMREC01 or LVMREC02.
For the PVID, use:
xd -An -j8208 -N17 -tc $MYDISK
For the VGID, use:
xd -An -j8344 -N17 -tc $MYDISK