1844837 Members
3296 Online
110233 Solutions
New Discussion

vgchgid question

 
SOLVED
Go to solution
dictum9
Super Advisor

vgchgid question


What does the man page mean, "Change VGID on the disks"? Does that it mean it puts them in a different volume group?
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: vgchgid question

I think you need to read a little further in the man page:

"Background
Both the EMC and XP disk arrays have a feature which allows a user to split-off a set of mirrored copies of physical volumes (termed BCVs or BCs) just as LVM split-off logical volumes with lvsplit command. As the result of the "split," the split-off devices will have the same VGID as the original disks. The vgchgid command is needed to modify the VGID on the BCV devices. Once the VGID has been altered, the BCV disks can be imported into a new volume group by using the vgimport command."


Pete

Pete
James R. Ferguson
Acclaimed Contributor

Re: vgchgid question

Hi:

It enables one to do that.

http://docs.hp.com/en/B2355-60105/vgchgid.1M.html

Remember, when you 'pvcreate' a disk, an LVM header is written with a Physical Volume ID (PVID). Similarly, a VGID (Volume Group ID) is written when a 'vgcreate' is done using the physical volume. These IDs are actually composed of the 'uname -i' ID and the timestamp (in epoch seconds) of the instantiation.

The VGID form the basis for enabling a 'vgimport -s' to find all disks that below to a volume group. Similarly, a 'vgscan' that is run to rebuild '/etc/lvmtab' examines the previously writen VGIDs to determine "who" belongs "where".

Regards!

...JRF...
dictum9
Super Advisor

Re: vgchgid question

change it to what?



Quote=======================
The vgchgid command is designed to change the LVM Volume Group ID (VGID) on a supplied set of disks
James R. Ferguson
Acclaimed Contributor

Re: vgchgid question

Hi (again):

> change it to what?

Read again what I wrote about what constitutes a VGID --- uname's ID and epoch seconds!

Regards!

...JRF...
Sandman!
Honored Contributor

Re: vgchgid question

Change it to the VGID of the volume group it is to be vgimport'ed into. The VGID is a unique identifier comprised of the CPU-ID and the date and time stamp of when the desired VG was created.
James R. Ferguson
Acclaimed Contributor

Re: vgchgid question

Hi:

Maybe this will help you (a picture is worth 1000 words...):

cat ./showlvmid
#!/usr/bin/sh

typeset RAWDEV=${1}

[ -z "${RAWDEV}" -o ! -c "${RAWDEV}" ] && { echo "Not a raw device"; exit 1; }

KIND=`xd -An -j 8192 -N8 -tc ${RAWDEV} 2> /dev/null | xargs`

if [ "${KIND}" = "L V M R E C 0 1" ]; then
INFO=`xd -An -j8200 -N16 -tx ${RAWDEV}`
PVID=`echo ${INFO} | awk '{print $1 $2}'`
VGID=`echo ${INFO} | awk '{print $3 $4}'`
echo "${RAWDEV} PVID = ${PVID}"
echo "${RAWDEV} VGID = ${VGID}"
else
echo "${RAWDEV} is not an LVM disk"
fi
exit 0

If you take the low-order 8-characters (or $2 or $4) you have the epoch seconds. Then, by example, if they were "33fb2abf", do:

# perl -nle 'print scalar localtime(0x33fb2abf)'
Wed Aug 20 13:34:55 1997

...to see the 'vgcreate' date.

Regards!

...JRF...