System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Mirror larger size PV to smaller size PV's

Srinikalyan
Regular Advisor

Mirror larger size PV to smaller size PV's

Hi,
Can I LVM mirror larger size PV to the smaller size PV? Currently we have have PV size of 202.75GB and now we want to migrate to the 102GB lun size. Can I just use
lvextend -m 1 /dev/vg_test /dev/202gbpv /dev/102gbpv 102gbpv

vg details:
VG Name /dev/vg_test
VG Write Access read/write
VG Status available, exclusive
Max LV 255
Cur LV 11
Open LV 11
Max PV 255
Cur PV 93
Act PV 93
Max PE per PV 1016
VGDA 186
PE Size (Mbytes) 256
Total PE 75423
Alloc PE 75423
Free PE 0
Total PVG 0
Total Spare PVs 0
Total Spare PVs in use 0

--- Logical volumes ---
LV Name /dev/vg_test/appl
LV Status available/syncd
LV Size (Mbytes) 1894400
Current LE 7400
Allocated PE 7400
Used PV 15


--- Physical volumes ---
PV Name /dev/dsk/c47t2d3
PV Name /dev/dsk/c56t2d3 Alternate Link
PV Status available
Total PE 811
Free PE 0
Autoswitch On
Proactive Polling On

PV Name /dev/dsk/c53t0d2
PV Name /dev/dsk/c44t0d2 Alternate Link
PV Status available
Total PE 811
Free PE 0
Autoswitch On
Proactive Polling On


Thanks,
Srini
3 REPLIES
Kapil Jha
Honored Contributor

Re: Mirror larger size PV to smaller size PV's

Yes you can, just keep in mind that they are not in PVG and you specify the correct command where u want to mirror it.

One more thing I hope data is not fragmented so better you defragment it before mirroring.

After mirroring you can put it in PVG.

And Yes you can always go and restore from backup and remove old LV.

BR,
Kapil+
I am in this small bowl, I wane see the real world......
Wim Rombauts
Honored Contributor

Re: Mirror larger size PV to smaller size PV's

Yes and no.

First, you hazve to vgextend your current volumegroup with sufficient new LUN's (I presume 4 102GB LUN's).

Preferabbly, use the -g option to use physical volumegroups. Put your existing LUN's in, for instance "group1", while you put your new LUN's in "group2"

That makes mirroring from the current to the new disks a lot easier :

lvextend -m 1 /dev/vg_test/appl group2

Remember : You mirror Logical Volumes within a VG, not Volume Groups.
johnsonpk
Honored Contributor

Re: Mirror larger size PV to smaller size PV's

>>Max PV 255
Cur PV 93
Act PV 93

does all the pvs are of 202GB size ?
what is the size of LV you want mirror?

If the size is big and you need to mirror many LVs , I would go with Wim suggestion.