Operating System - HP-UX
1825793 Members
2188 Online
109687 Solutions
New Discussion

Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

 
louisji2008
Regular Advisor

Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Dear Experts,

 

I'm planning migrate the old EVA to a new storage using LVM mirror. I have three questions about this solution, please give me help:

 

Q1: How to split LV mirrored and let LV use the New PV, the another mirror copy LVb use the old PV?

 

Q2: How to remove LVb and the old PV but keep the data ?

 

Q3: If I want to use the old PV, I just need import the VG and activate the VG using -q n option, right?


How time flies~~~
10 REPLIES 10
Bill Hassell
Honored Contributor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

There is no need to split the mirror at. HP-UX LVM allows 2 mirrors for a total of 3 LUNs with the same data. Just present the new storage to your system, run ioscan and insf to create the new device files, then pvcreate the LUN from the new storage and vgextend it into the VG. Now you can mirror the two existing disk LUNs to the 3rd disk LUN with lvextend -m 2.

 

Repeat the procedure for each LUN. The vgdisplay -v VG_name command will show each lvol as triple mirrored. You can now remove the two original disk LUNs from the old storage. These steps can be done on a running system. Be sure that when you use the lvreduce command, that you add the optional target PV as in: lvreduce -m 1 /dev/vg01/lvol1 /dev/dsk/c12t2d3

 

When you reduce the first old LUN, you can then present another LUN from the new storage to be used as the new storage mirror. In thhis way, the data is always mirrored during the migration. LVM mirroring isn't the fastest method but it is the easiest to understand and doesn't require special software in the storage arrays.



Bill Hassell, sysadmin
louisji2008
Regular Advisor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Dear Bill:

 

Thanks for your very detailed reply. But my question is after mirrored LV with the Old PV and New PV, how to deconfigure the old PV from the system and remain the LVM infromation and data on the PV. By doing this, I can use the old PVs on the old storage to prevent accident.


How time flies~~~
Bill Hassell
Honored Contributor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Once you have finished with the migration, you would use vgreduce to remove the old PVs from the VG. Now they are unused device files. You can use rmsf -a /dev/rdsk/<whatever>, then remove the presentation of the device(s) to the system.



Bill Hassell, sysadmin
louisji2008
Regular Advisor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Dear Bill,

 

As I know, we cannot do vgreduce to remove PV while it is used. Am I right?

 


How time flies~~~
Bill Hassell
Honored Contributor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

>> vgreduce ...

 

Correct. You must remove all extents from the PV before removing. In a mirrored situation, you simply reduce the mirror count using lvreduce -m # /dev/vg_name/lvol_name /dev/disk/disk_num where -m 1 reduces the mirror count from 2 mirrors to 1 mirror. Always specify the optional PV name so the correct mirror will be removed. When pvdisplay (or vgdisplay -v) shows no extents in use on the PV, you can vgreduce the PV.



Bill Hassell, sysadmin
Torsten.
Acclaimed Contributor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

With vgreduce the old EVA LUNs you also remove the data from them.

 

But consider to mirror the LUNs, unpresent the EVA from server and use vgreduce -f ... to remove the information about the old LUNs from the server. So you keep the data on the EVA.

 

Or maybe better: create a clone of the LUN inside the EVA and keep this copy.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
louisji2008
Regular Advisor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Hi Bill,

 

I couldnot follow this solution because I want to keep the date on the PV which will be reduced.


How time flies~~~
louisji2008
Regular Advisor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

Hi Torsten,

 

This is a good method. But the LV mirrored will have a problem: half of the PE on the removed PV will be "stale".

 

How do I solve this problem?


How time flies~~~
louisji2008
Regular Advisor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

 

If I run this command:  lvreduce -m 0 /dev/vg_name/lvol_name /dev/disk/disk1, will the LVs on the /dev/disk/disk1 remain? So the LVs and the VG can be restored?

Or the data on the disk 1 will be lost after lvreduce ?

 

Thank you!


How time flies~~~
Torsten.
Acclaimed Contributor

Re: Data migration questions -Q1: How to split LV mirrored ; Q2: How to remove LVb but keep data

>> will the LVs on the /dev/disk/disk1 remain?

 

No.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!