Re: How to find PVID which is part of VG version 2.0 or 2.1? (956 Views)
Reply
Occasional Advisor
Dmitriy_21
Posts: 10
Registered: ‎06-22-2007
Message 1 of 3 (997 Views)
Accepted Solution

How to find PVID which is part of VG version 2.0 or 2.1?

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

 

Please use plain text.
Honored Contributor
Bill Hassell
Posts: 14,178
Registered: ‎05-29-2000
Message 2 of 3 (970 Views)

Re: How to find PVID which is part of VG version 2.0 or 2.1?

[ Edited ]

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

 



Please use plain text.
Occasional Advisor
Dmitriy_21
Posts: 10
Registered: ‎06-22-2007
Message 3 of 3 (956 Views)

Re: How to find PVID which is part of VG version 2.0 or 2.1?

Bill,
Thank you for your help.
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation