Operating System - HP-UX
1835950 Members
3678 Online
110088 Solutions
New Discussion

Re: move mirrored logical volume to other disk

 
SOLVED
Go to solution
Tuan Nguyen
Regular Advisor

move mirrored logical volume to other disk

Hello,

I have a logical volume that has its data scattered on 3 different disks. It is also mirrored. I would like to move all data into 1 physical disk and mirror this consolidated logical volume onto another disk on different bus. Does anyone have any suggestion?

I can't afford any downtime right now. Is there a way to do this without interrupt production?

Please...

Thank you!

Tuan
9 REPLIES 9
James R. Ferguson
Acclaimed Contributor

Re: move mirrored logical volume to other disk

Hi Tuan:

See the manpages for 'pvmove'.

One caveat. When using 'pvmove' make sure that you do not interrupt the process. If you do, you may corrupt the logical volume.

Regards!

...JRF...
Tuan Nguyen
Regular Advisor

Re: move mirrored logical volume to other disk

James,

Thank you for your quick response. Do I need to un-mirror the lv first?

Thanks,

Tuan
Mel Burslan
Honored Contributor
Solution

Re: move mirrored logical volume to other disk

the command you are looking for is pvmove in the form similar to this

pvmove LVOL_name source_PhyVol destination_PhyVol


eg.

pvmove /dev/vg00/lvol7 /dev/dsk/c1t2d0 /dev/dsk/c7t5d0

for moving vg00/lvol7 from the physical disk located at /dev/dsk/c1t2d0 to the new physical disk /dev/dsk/c7t5d0.

you can repeat this 3 times with the same destination disk for your already data containing source disks.

Process should not be interrupted while moving data to prevent data corruption. So, proceed with caution at your own risk.
________________________________
UNIX because I majored in cryptology...
Mel Burslan
Honored Contributor

Re: move mirrored logical volume to other disk

Tuan,

since you will bemoving data from a physical volume, it is important that you move the data from whichever physical volume you want to be out of. Since main and mirror copies are on different physical volumes (assuming your vg policy is strict) there should not be a need to un-mirror your volume but if your mirrors are spread across the same physical volumes (which is a bad practice to start with) you are better off with unmirroring first, so that you do not move two copies of the same data.

Hope this helps
________________________________
UNIX because I majored in cryptology...
Tuan Nguyen
Regular Advisor

Re: move mirrored logical volume to other disk

Mel,

Thank you for your response. Here is the output from vginfo.

# ./vginfo -L /dev/vgfc10/lvol16
/dev/dsk/c7t0d0:2000:2000
/dev/dsk/c7t2d0:88:88
/dev/dsk/c11t5d0:1912:1912
/dev/dsk/c7t6d0:4000:4000
/dev/dsk/c11t7d0:4000:4000

# lvdisplay /dev/vgfc10/lvol16
--- Logical volumes ---
LV Name /dev/vgfc10/lvol16
VG Name /dev/vgfc10
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 6000
Current LE 750
Allocated PE 1500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

Yes, it is strict policy. All data is on separate disks. If I do pvmove without un-mirror first, how do I know which disks contain primary data and which disks contain mirrored data?

Thank you very much.

Tuan
A. Clay Stephenson
Acclaimed Contributor

Re: move mirrored logical volume to other disk

Your question really has no meaning. There is no "primary" and "mirror"; all versions of the data for a given LVOL are equally valid. It makes more sense to create another mirror using lvextend -m 2 and specify a destination PV and when that is completed do a lvreduce -m 1 and specify the pv_paths of the disks that you wish to remove the mirror from. This method will ensure that you always have at least valid mirror at all times.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: move mirrored logical volume to other disk

Hi (again) Tuan:

You don't need to unmirror. You can specify the source and destination volumes for the 'pvmove' action. See the 'pvmove' manpages. Mirrored data is data.

Regards!

...JRF...



Tuan Nguyen
Regular Advisor

Re: move mirrored logical volume to other disk

Gentlemen,

Thank you very much for all your responses. I really appreciate that. I guess I will have to back it up first and apply your suggestions. Again, thank you very much.

Tuan
Geoff Wild
Honored Contributor

Re: move mirrored logical volume to other disk

Seeing how you want to re-mirror - it is better to break it first..

Example:

lvreduce -m 0 /dev/vg00/lvol14

Then move it (use lvdisplay -v to see from disk - pvmove -n VG SOURCEDISK DESTDISK)

pvmove -n /dev/vg00/lvol14 /dev/dsk/c28t6d0 /dev/dsk/c0t6d0



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.