1748230 Members
4257 Online
108759 Solutions
New Discussion юеВ

Re: General Quory

 
Rg_4
Advisor

General Quory

command to find out the VGID of a PV
4 REPLIES 4
Sunny123_1
Esteemed Contributor

Re: General Quory

Hi

If you want which vg includes which pv then use

#strings /etc/lvmtab


Regards
Sunny
Suraj K Sankari
Honored Contributor

Re: General Quory

Hi,

vgexport -p -s -v -m /etc/lvmconf/vg01.map vg01
cat /etc/lvmconf/vg01.map

Suraj
James R. Ferguson
Acclaimed Contributor

Re: General Quory

Hi:

You could do:

# ./fetchlvmid
#!/usr/bin/sh
typeset RDEV=$1
KIND=$(xd -An -j 8192 -N8 -tc ${RDEV} 2> /dev/null | xargs)
if [ "${KIND}" = "L V M R E C 0 1" ]; then
INFO=$(xd -An -j8200 -N16 -tx ${RDEV})
PVID=$(echo ${INFO} | awk '{print $1 $2}')
VGID=$(echo ${INFO} | awk '{print $3 $4}')
fi
echo "${RDEV} PVID = ${PVID}"
echo "${RDEV} VGID = ${VGID}"
exit 0

# ./fetchlvmid /dev/rdsk/c2t6d0
/dev/rdsk/c2t6d0 PVID = 411b9f8740815108
/dev/rdsk/c2t6d0 VGID = 411b9f8740815108

Regards!

...JRF...
kevin_m
Valued Contributor

Re: General Quory

xd -An -j8200 -N16 -tx /dev/dsk/cXXtYYdZZ

The last 2 fields are the VGID read off the disk itself. Not sure if you are looking for that information or what volume group the server has it associated with.