Disk Arrays
Showing results for 
Search instead for 
Did you mean: 

Does "vgchgid" change the same "VGID" as is written/read by "vgexport -s" ?

Go to solution
Stuart Abramson_2
Honored Contributor

Does "vgchgid" change the same "VGID" as is written/read by "vgexport -s" ?

When I do a "vgexport -s ...." I get a table like this:

VGID 000119a83ac36a3c
1 lvol01
2 lvol02
3 lvol03
4 lvol04

I find this useful for moving VGs around in my shop. I dont' have to put a long list of device file names after the "vgimport".

Is this "VGID" the same "ID" that "vgchgid" changes when my BCV scripts "import" the BCV volumes on my BCV server?

When I do BCV "splits" from one system to another, can I create my map file with "vgexport -s .."?

James R. Ferguson
Acclaimed Contributor

Re: Does "vgchgid" change the same "VGID" as is written/read by "vgexport -s" ?

Hi Stuart:

Yes, the '-s' option of a 'vgexport' / 'vgimport' is quite convenient for moving volume groups; since, as you have seem, it writes the Volume Group ID (VGID) into the "mapfile" during 'vgexport'. This ID is matched during 'vgimport' and thus only the physical disk bearing the matching VGID are collected into the "new" volume group.

The VGID is indeed the same ID the is examined by 'vgchgid'.

An LVM mapfile isn't really anything special. You can create one for a 'vgimport' even if it wasn't created during a 'vgexport'. The format is as you have seen. The records with numbers, a blank and a string merely signify the logical volume name to be associated with the minor number of the device file that will be created by 'vgimport' for each logical volume noted when the physical disk's VGRA is read.

You can obtain the VGID of a physical disk with the following, and hence can specify it in a mapfile of your construction, for use with a 'vgimport'. To obtain the VGID do:

# xd -An -j8200 -N16 -tx /dev/rdsk/cXtYdZ

The output will appear in four fields. The third and fourth field when joined together, are the VGID in question. For example, the above might yield:

58a721f3 31bbc985

Thus the VGID=58a721f331bbc985


Giada Bonfà
Frequent Advisor

Re: Does "vgchgid" change the same "VGID" as is written/read by "vgexport -s" ?


vgchgid changes the VGID that you find on mapfile. The vgchgid command is useful when you do a BCV and after splitting LUN you want to import the destination LUN on the same server of primary volume.
On the same server cannot exist two volume group with the same VGID.

After splitting the volumes you can do:

vgexport -s -p -m mapfile..

and then use the mapfile to import the LUN on another server without using vgchgid.

Tell us if you need more advice.
Good luck