Operating System - HP-UX
1835226 Members
2392 Online
110078 Solutions
New Discussion

Move lvol from one vg to another?

 
SOLVED
Go to solution
Alan Casey
Trusted Contributor

Move lvol from one vg to another?

Hi,

We are going a vg export on one of our vg's.
We wist to add a lvol from another vg into this vgexport.

Has anyone ever done this?
We are looking at the possability of editing the map file to achieve this?

13 REPLIES 13
harry d brown jr
Honored Contributor

Re: Move lvol from one vg to another?

Alan, your problem is that your LV belongs to another VG. The safest way to "move" it is to back up your LV (filesystem)to tape (or to the new location), then on your "new" vg create an LV and restore that LV (filesystem). You can also perform a disk to disk copy by using cp -rp / /

live free or die
harry
Live Free or Die
Sridhar Bhaskarla
Honored Contributor

Re: Move lvol from one vg to another?

Hi Alan,

vgexport is limited to only the volume group that is being exported. You cannot manipulate the graph files to achieve this.

One way is to create a file system in this volume group, copy the data from the other file system and then export.

If your volume group to be exported is vg01 and the file system lvolx is in vg02 mounted as /fs
then you can do like this

#lvcreate -n lvolx -L some_size vg01
#newfs -F vxfs /dev/vg01/lvolx
#mount /dev/vg01/lvolx /fs.new
Copy the data. It is suggested to stop the processes that are accessing /fs before doing a copy
#cp -Rp /fs/* /fs.new

Now unmount all the logical volumes in vg01
#vgchange -a n vg01
#vgexport -v -s -m /tmp/vg01.map vg01

When you vgimport vg01, it will have this new logical volume that has the data of vg02's lvolx.

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

Re: Move lvol from one vg to another?


Editing the map will only create the LV device file on a vgimport . But what about the LV space itself?? That won't work. So, the way to go is , as pointed by others,
create lv, copy stuff and vgexport it.

HTH
raj
Take it easy.
Deshpande Prashant
Honored Contributor

Re: Move lvol from one vg to another?

HI
You will not be able to get rid of one vg and one lv from another VG in single command.
Export the vg with vgexport and remove the other lv with lvremove command.

Prashant.
Take it as it comes.
Sanjay_6
Honored Contributor

Re: Move lvol from one vg to another?

Hi Alan,

you cannot add a lv from another VG to the vgexport of a particular VG. to move an lv from another Vg to this VG, you have to back up the data on the other Vg, remove that LV and copy the data to the new LV on this VG.

Hope this helps.

Regds
Santosh Nair_1
Honored Contributor

Re: Move lvol from one vg to another?

Unfortunately, you can't move LVs between VGs with HP's LVM implementation. I believe its possible under AIX and under Veritas, but HP's LVM doesn't allow this. You'd have to create a new LV in destination VG and copy over all the data from the source LV.

-Santosh
Life is what's happening while you're busy making other plans
Alan Casey
Trusted Contributor

Re: Move lvol from one vg to another?

Thaks for all the info.

the lvol's in question contain raw data, so there are no filesystems.

What we plan on doing, is to create a new lvol in the desired cg with the same name, and copy the data using "dd"

Then do the vgexport.
Darrell Allen
Honored Contributor
Solution

Re: Move lvol from one vg to another?

Hi Alan,

It seems you have your answer but I'm curious. What are you trying to accomplish with vgexport?

Thanks,
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Alan Casey
Trusted Contributor

Re: Move lvol from one vg to another?

Thanks Darrel,

We are upgrading our Hardware, so need to move our EMC array to a new server.


Alan
Darrell Allen
Honored Contributor

Re: Move lvol from one vg to another?

Thanks Alan. Perfectly logical.

Good luck,
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Darrell Allen
Honored Contributor

Re: Move lvol from one vg to another?

Hi Alan,

I appreciate the points but actually, the other guys answered your question. I expected N/A points assigned to my comments :-))

Hopefully you'll assign points to the other answers so that later readers will see what really applied to your question.

Thanks,
Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Sridhar Bhaskarla
Honored Contributor

Re: Move lvol from one vg to another?

Alan,

What's your idea being "rude" to the people who spent sometime for you?

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

Re: Move lvol from one vg to another?

Sridhar,

How dare you call me rude!
I'd thank you to mind your own business in the future and please keep your nasty comments to yourself!

Alan