Operating System - HP-UX
1833875 Members
2021 Online
110063 Solutions
New Discussion

Possible to Non-Distructively Migrate an LVOL from one VG to Another?

 
Alzhy
Honored Contributor

Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Can't recall if I asked this question before but with VxVM (Veritas), I can non-distructively move LVOLS(volume) and their PV's (dm disks) to another VG (diskgroup).

Is this possible under LVM ?
Hakuna Matata.
10 REPLIES 10
Alzhy
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Also, when I lvreduce an LVOL and vgreduce a PV from a VG, does the PV actually get blanked/nulled out? In VxVM - it does not so one can migrate volumes (LVOLs) from one Diskgroup (VG) to another.. as long as a vxmake file (from vxprint) is done..
Hakuna Matata.
RAC_1
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Not possible with LVM.

Create a new volume under the VG you want.
copy/mv/backup-restore data on new lvol.

Anil
There is no substitute to HARDWORK
Geoff Wild
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

nope - not with lvm - you will have to create a new vg/lvol, then copy data - say with vxdump:

vxdump -0 -f - -s 1000000 -b 16 /oldmount | (cd /newmount ; vxrestore rf -)


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Alzhy
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Take note... I am sure how my LVOLS are structured on the PV's.

The plan is with LVM Mirrors, we can split mirrors and move the component PV's of those mirror/split LVOLs out of the VG and create a new VG on its own -- possibly on a different host as the PV's (Luns) are multi-hosted (visible on other hosts).
Hakuna Matata.
Pete Randall
Outstanding Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

There is the pvmove command but that's not really what you're looking for - it's only within a VG.


Pete

Pete
Ashwani Kashyap
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

No not possible to in LVM . In LVM you cannot move LV's acroos VG's .

Only way to do is make another VG/LV and copy the data across .

YOu can only move the LV onto a different disk/lun in the same VG .

Alzhy
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Apparently I asked this some time ago and Yes indeed it is possible:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=75321

As I have tested it on LVM on Linux as well...
Hakuna Matata.
Geoff Wild
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Before doing that - I would make sure I had a good backup.....just in case....

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Sridhar Bhaskarla
Honored Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

Nelson,

You have to remember couple of things.

1. You can *attempt* to move by moving the whole PV. Not a single LV or if the PV has multiple LVs on them.

2. If the extent size of the other VG is different from the original VG, it may not work.

3. If you lose any data and if you place a call with HP, then they will simply say they won't support it.

With all the above, you can generally and officially say 'it doesn't work'.

But you can still try with the background that it may not work always. I believe in trying.

-Sri


You may be disappointed if you fail, but you are doomed if you don't try
Scott Van Kalken
Esteemed Contributor

Re: Possible to Non-Distructively Migrate an LVOL from one VG to Another?

vxdump 0f - /usr | (cd /mnt; vxrestore xf -)

...straight from the restore man page.

I quite like this method.