1833777 Members
2240 Online
110063 Solutions
New Discussion

Import VG02 in to VG01

 
Joel Pavon
Advisor

Import VG02 in to VG01

Hello!

I Have a volume group VG02, and I was export this volume group, I need to increase the VG01 and recover a Logical volumes fron VG02.

Can I Import o Increase VG01 from the old structure of the volume group VG02 and recover the structure of the VG02 in to VG01?

This sound very crazy, but is it posible??

Tnks!
5 REPLIES 5
MANOJ SRIVASTAVA
Honored Contributor

Re: Import VG02 in to VG01

Hi Joel

In this case if you can be more elaborate in terms of no, of lvols on vg02 and disks being used there . Now there can be 2 possiblitoes

1. There are are more than 1 disk on vg02 which can be freed ie w/o touching your lvol which is in question Then you can reduce the disk and add it to the vg01 .

2, incase that cannot be done and you dont have space in vg02 in terms of PV then what you propose id definatively crazy .



All the best.

Manoj Srivastava
A. Clay Stephenson
Acclaimed Contributor

Re: Import VG02 in to VG01

No that won't work but as long as you have simply done a vgexport, you can re-import your vg02 (or import it as any other new volume group). You cannot directly merge physical volumes from another volume group into an existing volume group and retain the data.
If it ain't broke, I can fix that.
Helen French
Honored Contributor

Re: Import VG02 in to VG01

Hi,

Not sure what you are looking for, but here are some points:

1) If you want to export vg02 and import it back in to vg01 ( which is already exists ) it is not possible.

2) If vg01 is not exist on the system, then you can create vg01 ( use mknod ) and import the VG in the new name - vg01.

3) If both VGs are already exists, then the best way might be:
a) backup all filesystems in vg02
b) find out the LV and FS parameters ( size, mirror etc) of vg02
c) unmount all FS of vg02
d) remove all LVs from vg02
e) remove vg02
f) extend vg01 with the free disk
g) create new LVs and FS with the specification you have
h) mount and restore the data.

HTH,
Shiju
Life is a promise, fulfill it!
Sachin Patel
Honored Contributor

Re: Import VG02 in to VG01

Hi Joel,
I don't think that you can mearge two vgs. you can copy back-forth. increase/decrease vg. I have never seen it done before.

Sachin
Is photography a hobby or another way to spend $
Galen Scalone
Occasional Advisor

Re: Import VG02 in to VG01

Here is a way to do it, IF you have MirrorDisk, and a free disk.
Add the new disk to vg02, and mirror all of the lv's to the new disk in a certain order (it doesnt matter in what order, just remember which lv's in order, and their exact sizes). This will make a copy of the lv's on the new disk. Then just remove the mirror copies. When you remove the mirror copies, the only stuff actually removed is the header area, all of the data is still there on the newly added disk. vgreduce the pv out of the vg.
Do not pvcreate it again, just add it to vg01, and just create logical volumes exactly as they were laid down when you mirrored it.

So you need to know the order of the lv's on the mirror copy, and their exact sizes in extents or megs. Then DO NOT newfs the logical volumes either, just mount them.

Of course, test it out first, and remember you still have the original logical volumes in vg02. Once you have made absolutely sure that you have the data in vg01, just vgexport vg02.

You can test this out with only one logical volume, just to really see that it works, and It does.
Many thanks to David Totsch for that one.




pipin and greppin