1833831 Members
2247 Online
110063 Solutions
New Discussion

vgexport/vgimport

 
SOLVED
Go to solution
khilari
Regular Advisor

vgexport/vgimport

Hi guys i added some disks on one cluster server and now i want to update that on the other server... I have too do vgexport on primary and then copy the mapfile on secondary and then vgimport...
Just wondering what would be the exact commands for vgexport and vgimport for this...
Thanks
9 REPLIES 9
Pete Randall
Outstanding Contributor

Re: vgexport/vgimport

First, you don't need a map file unless your logical volume names differ from the standard (lvol1, lvol2, etc) names.

That said, your vgexport/import will look like this:

vgchange -a n /dev/vg01
vgexport -p -s -m /tmp/vg01map /dev/vg01
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
vgimport -s -m /tmp/vg01map /dev/vg01
vgchange -a y /dev/vg01


Pete

Pete
Patrick Wallek
Honored Contributor

Re: vgexport/vgimport

Pete is close, but if this SG cluster is up and running you really don't want to deactivate the VG first.

You want to export with the '-p' option on the first cluster server so it does not actually wipe out the VG. Then you can take that map file and import it on the 2nd server.

Something like this:

1st server:
vgexport -p -s -m /tmp/vg01map /dev/vg01
Copy the map file to the 2nd server

2nd server:
mkdir /dev/vg01
mknod /dev/vg01/group c 64 0x010000
vgimport -s -m /tmp/vg01map /dev/vg01
khilari
Regular Advisor

Re: vgexport/vgimport

so on the secondary node, lets say i already have that vg and i am updating it, then the vgimport will itself update the volume group. I dont have to delete the vg right???
Patrick Wallek
Honored Contributor

Re: vgexport/vgimport

No, the vgimport will not update if the VG already exists, it will fail.

You do need to remove the VG (vgexport) and add it back in to update it.
Pete Randall
Outstanding Contributor

Re: vgexport/vgimport

Thanks for the clarification, Patrick. I don't do clusters and probably should have given that warning right up front.


Pete

Pete
khilari
Regular Advisor

Re: vgexport/vgimport

so on the secondary node i do.
vgexport /dev/vgcluster
vgimport -s -m /tmp/vgclus.map /dev/vgcluster

and that should do...
Pete Randall
Outstanding Contributor

Re: vgexport/vgimport

Yes, that makes sense even to this cluster unaware admin.


Pete

Pete
Patrick Wallek
Honored Contributor
Solution

Re: vgexport/vgimport

>>so on the secondary node i do.
>>vgexport /dev/vgcluster
>>vgimport -s -m /tmp/vgclus.map /dev/vgcluster
>>and that should do...


You need to verify whether the /dev/vgcluster directory exists after you do the vgexport. I believe a vgexport wipes out the directory under /dev.

If /dev/vgcluster does get removed by vgesport you would need to do:

# mkdir /dev/vgcluster
# mknod /dev/vgcluster/group c 64 0x0?0000
(where the 0x0?0000 is your appropriate minor number)

Then you can do your vgimport.

Once you do the vgexport, the rest of the procedure is not unlike importing a new VG to the server for the first time.
Siju Vadakkan
Trusted Contributor

Re: vgexport/vgimport

On the primary node :
-----------------------

1.#pvcreate

2.#vgextend vgname

3.export the map file in preview mode
#vgexport -v -p -s -m /tmp/vgname.map

4.copy the map file to the adoptive node


On the adoptive node.
--------------------
1.Note the minor number of the VG which ur goung to remove.
#ll /dev/vgname/group

2. remove the VG from the node.
#vgexport

3.create the VG directory and group file
#mkdir /dev/vgname
#mknod /dev/vgname/group c 64
eg:
# ll /dev/vg10/group
crw-r--r-- 1 root sys 64 0x090000 Mar 14 23:21 /dev/vg99/group

4.import the volume group.
#vgimport -v -s -m /tmp/vgname.map vgname

5. Activate the vgname in read only mode to verify and then deactivate it once is ie verified.

#vgchange -a r vgname

#vgdisplay -v vgname # u can see the new disk

#vgchange -a n vgname