1837921 Members
5475 Online
110124 Solutions
New Discussion

modify volume group

 
Geeta Singh
Occasional Contributor

modify volume group

we are having 3 volume groups and each having 1 physical disk and logical volumes.
Can we move physical disk from one volume group to another volume group and merge the moved disk with existing disk to create new volume group. Does doing this will destroy data and logical volumes in the disk.
Thanks
5 REPLIES 5
John Poff
Honored Contributor

Re: modify volume group

Hello,

I can't think of any way to do it. You'll probably have to backup all three volume groups to tape, delete them, create a new volume group made up of the three disks, create new logical volumes and filesystems, and then restore the data from tape. You might get by with just backing up and deleting two of the volume groups, vgextend'ing the two disks from the deleted vg's into the first vg, createing the LVs and FSs that were nuked, and then restoring them from tape.

I'm just curious, but why do you need to merge them into one volume group?

Here is a link to a similar question here on the forum:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x8fd035067c18d6118ff40090279cd0f9,00.html

JP
S.K. Chan
Honored Contributor

Re: modify volume group

It is not possible to merge the volume group. The closest you get to moving extents are within the same VG, whereby you can move extents from one PV to another using pvmove. But of course this is not possible and not what you want. If you have another unused spare disk, what you can do is vgextend one of your VG (say vg01), then create the exact logical volumes as you see in vg02 (say you want to move everything in vg02 to vg01). Then cpio the data from vg02's LVs to vg01's LVs. That will free up the disk in vg02. After deleting vg02, you can vgextend vg01 again with that disk and do the same (ie the LVs creation and cpio) for the next VG (assuming vg03).If you don't have a spare disk to play with, then you would need to backup the data (either to tape or to another temporary NFS mounted FS).
MANOJ SRIVASTAVA
Honored Contributor

Re: modify volume group

Hi Geeta

Well the issue is to move one disk from one volume group and merge it to other w/o destroying the data , this is not possible bcoz the same will be done using pvcreate which will erase the header informations , however we had a set of disks which were accidently put inot to a new volume group using pvcreate -f , the old data never shoed up but when we restored the disks back to the orignal volume group we saw the old data .
The answer is no.


Manoj Srivastava
Anil Sedha
Advisor

Re: modify volume group

Hi Geeta,

You can transfer your data from one volume group to the other using PVMOVE.

pvmove /opt /dev/dsk/c0t0d0

Then you may delete the volume group that you don't need. This will make the disk free (the one from where you moved the data over to the other disk).

Add the new disk into the new volume group.

But you would need space in the first volume group that you would be moving data into from another volume group.

Don't forget to assign points if the answers suit you. !!!!
Live, love and let live
Martin Johnson
Honored Contributor

Re: modify volume group

pvmove can only be used on physical volumes in the same volume group. If you want to combine volume groups, you will have to back them up to tape and create a new volume group with the old physical volumes.

You may try doing a export with a mapfile on each volume group and merge the mapfiles and try to import all the physical disks into one new volume group. I don't think this will work because the volume group information is stored on the physical disks. You may also need to recreate /etc/lvmtab. It's worth a try.

HTH
Marty