Operating System - HP-UX
1834637 Members
2885 Online
110069 Solutions
New Discussion

HOW to know the PVID and VGID of disk

 
SOLVED
Go to solution
HP UNIX Professionals
Frequent Advisor

HOW to know the PVID and VGID of disk

Hi Experts,

I need to know the PVID and VGID of disk in vg00 volume goupu, Anybody know how to to view and what is the command i have to run for that

OS - HPUNIX 11iv3

Thanks & Regards,

VINAY
5 REPLIES 5
Torsten.
Acclaimed Contributor

Re: HOW to know the PVID and VGID of disk

You can do a *preview* vgexport to get the VGID, e.g.

# vgexport -v -p -s -m /tmp/vg00.map vg00





Why you need this?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor
Solution

Re: HOW to know the PVID and VGID of disk

Hi Vinay:

See my last post in this thread for a "how-to":

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1181590

Regards!

...JRF...
HP UNIX Professionals
Frequent Advisor

Re: HOW to know the PVID and VGID of disk

Hi JRF,

Your great...The link that u give is very usefull to me

Thanks

vinay
Doug O'Leary
Honored Contributor

Re: HOW to know the PVID and VGID of disk

Hey;

Not sure why you'd need to do that, but here are two functions I use in a script to verify that pvlinked disks are part of the vg to which they're suppposed to be assigned:

disp_vgids()
{
strings -t d /etc/lvmtab | grep /dev | grep -v /dev/dsk | \
sort -k 2 | while read offset vg
do
xd -An -j$(($offset+1024)) -N8 -tuL /etc/lvmtab | read v1 v2
printf "%-15s %x%x\n" ${vg##*/} ${v1} ${v2}
done
}

id_vgid()
{ pv=$1

xd -An -j8200 -N16 -tx ${pv} 2>/dev/null | awk '{printf("%s%s", $3, $4)}'
}


disp_vgids is simply run; it'll display the vgids for all vgs in /etc/lvmtab.

id_vgid takes, as an argument, a CTD device:

id_vgid /dev/dsk/c3t6d0

for instance.

Hope that helps.

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Bill Hassell
Honored Contributor

Re: HOW to know the PVID and VGID of disk

This requirement has come up several times for me but remembering all the dd and xd options was a pain so I wrote a script to do it. Just run it like this:

# showLVMinfo c1t6d0 c4t0d0 c4t2d0

Local CPU ID = 1653309383, hex value=0x628b7fc7

/dev/rdsk/c1t6d0:
CPUID=0x628b7fc7 (1653309383), VGID 0x420a6ffb, PVID 0x420a6ffb

/dev/rdsk/c4t0d0:
CPUID=0x628b7fc7 (1653309383), VGID 0x48af267d, PVID 0x48af2579

/dev/rdsk/c4t2d0:
CPUID=0x628b7fc7 (1653309383), VGID 0x48af267d, PVID 0x48af257c


In this example, the last 2 disks belong to the same VG (VGID the same).



Bill Hassell, sysadmin