1837526 Members
3619 Online
110117 Solutions
New Discussion

Merge 2 vg into one

 

Merge 2 vg into one

Hello.
I have two servers, and every one has a vg. I have a new server, where I must to import the vgs from the olders.
I would like not to backup/restore, and I wonder if it would be possible to vgimport the discs merging the old vgs.
Does any one know if it is possible to vgimport 2 vgs into one?
Thanks in advance
4 REPLIES 4
Sanjay_6
Honored Contributor

Re: Merge 2 vg into one

Hi,

It is not possible to merge two vg's into one.

Hope this helps.

Regds

Re: Merge 2 vg into one

By the way: the discs are identical, the old vgs has the same definition; and are large enough to hold all the discs from the two vgs.

Thanks.
James R. Ferguson
Acclaimed Contributor

Re: Merge 2 vg into one

Hi:

No, it is not possible to combine two volume groups into one by 'vgimport'. 'pvmove' will not work in this case, either. To meet your goal, 'vgimport' one volume group from one of the old servers to the new one; add new logical volumes to it; and then copy data from the second server's logical volumes into the newly created logical volumes.

Regards!

...JRF...
Sridhar Bhaskarla
Honored Contributor

Re: Merge 2 vg into one

Hi Xavier,

It is possible to import both the volume groups into one system as two volume groups but not possible to import them to merge them into one volume group. You can follow these steps.

1. Do a vgchange -a n on the volume groups. You need to unmount the file systems to accomplish this.
2. Do a vgexport -v -s -m /tmp/vgxx.map vgxx
on both the systems. Copy the vgxx.map from both the old systems into the new system.
3. Do a vgexport -v vgxx on both the systems to take vg configuration out of /etc/lvmtab.
3. Disconnect the cables. Change the scsi ids/Lun Ids on the disks to make them unique if you are going to daisy chain the disks. If you are connecting them to different interfaces, then no need.
5. Run ioscan -f and do insf on the new system.
6. Create two directories under /dev and and make group device files.

mkdir /dev/vgxx1
mknod /dev/vgxx1/group c 64 0x0?0000

7. vgimport both the volume groups

vgimport -v -s -m vgxx1.map vgxx1

8. Enable both the volume groups
vgchange -a y vgxx1

To merge the volume groups, add new disks to either of the volume group, create new file systems and copy the data from the file systems of the other volume group.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try