1747993 Members
4876 Online
108756 Solutions
New Discussion юеВ

VGID

 
khilari
Regular Advisor

VGID

when we do vgexport a mapfile is made and in that mapfile there is a vgid. What does that vgid mean?
Thanks
4 REPLIES 4
Patrick Wallek
Honored Contributor

Re: VGID

That VGID is an id that is written in the VGRA (Volume Group Reserve Area) of **EVERY** disk in a volume group.

When you do the vgimport and specify the '-s' and '-m' options, the map file is read to get that VGID. Then vgimport reads the VGRA of every disk on your system and finds all of those with a matching VGID. Those with the matching VGID are then imported made part of the VG you are importing.
Sandman!
Honored Contributor

Re: VGID

A unique identifier for each VG. All VGs that are created on a particular server are given a unique ID. The VGID is unique for all VGs on a particular server but not neccessarily across servers (unless the servers are part of a MC/SG cluster). VGID comprises the CPU ID and the date and time stamp when the vgcreate command was issued.
James R. Ferguson
Acclaimed Contributor

Re: VGID

Hi:

In fact, the VGID is composed on the machine ID (as seen via 'uname -i') and the Epoch timestamp marking the date and time that the volume group was created. The Physical Volume ID (PVID) is similarly stored:

# cat .fetchlvmid
#!/usr/bin/sh
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 = ${PVID}"

# ./fetchlvmid /dev/rdsk/c0t6d0
/dev/rdsk/c0t6d0 PVID = 11823e9d33fb2abe
/dev/rdsk/c0t6d0 VGID = 11823e9d33fb2abe

....where "11823e9" is the hexadecimal value of the 'uname -i' and '33fb2abe' is the Epoch timestamp.

Regards!

...JRF...

Re: VGID

James,
A minor correction on your script, you had:
echo "${RDEV} PVID = ${PVID}"
echo "${RDEV} VGID = ${PVID}"

and I believe it should read:
echo "${RDEV} PVID = ${PVID}"
echo "${RDEV} VGID = ${VGID}"

Also I noticed that the VGID did not completely match that of what I got when I ran vgexport -m mapname.map -s -p vgtoexport. There appeared to be a leading 0 in the string from the output of the vgexport command. Other than that - a great little script-let.