lvreduce a mirror from 2 disks

 
velasco
Occasional Contributor

lvreduce a mirror from 2 disks

Hi
i work with 2 EVA Storage and an HPUX 11 server. I want to move an logical volume from the first bay to the second. This logical volume have PE on two disk( vdisk) on the first EVA !!!
i want to make an mirror between the LV and PV locate on the Second bay.
#lvextend -1 /dev/vg02/lvolA /dev/dsk/cXtYdZ

and after remove all data from the first bay.
#lvreduce –0 /dev/vg02/lvolA /dev/dsk/cxtydz /dev/dsk/cxtydw
Can i reduce an mirror by this way ? from two disk at the same time?
thank for you help
bye
8 REPLIES 8
Sundar_7
Honored Contributor

Re: lvreduce a mirror from 2 disks

Yes, that will work just fine.

You will need to use the -m option with lvextend and lvreduce

# lvextend -m 1 /dev/vg02/lvolA /dev/dsk/newdisk

# lvreduce -m 0 /dev/vg02/lvolA /dev/dsk/olddisk1 /dev/dsk/olddisk2

Learn What to do ,How to do and more importantly When to do ?
Court Campbell
Honored Contributor

Re: lvreduce a mirror from 2 disks

I am sort of confused as to what you are wanting to achieve. But You could add another vdisk to the volume group and then use the pvmove command to move all the extents associated with that lvol to the other disk.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Court Campbell
Honored Contributor

Re: lvreduce a mirror from 2 disks

pvmove -n
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Steven E. Protter
Exalted Contributor

Re: lvreduce a mirror from 2 disks

Shalom,

I believe lvsplit may also work.

Best approach in my opinion is to completely break the mirror on the whole logical volume and then rebuild it after.

This is more time consuming but it lets you do it the way you want.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Piotr Kirklewski
Super Advisor

Re: lvreduce a mirror from 2 disks

Try to use sam to perform this operation.
Jesus is the King
Domenico_5
Respected Contributor

Re: lvreduce a mirror from 2 disks

wrong #lvextend -1 /dev/vg02/lvolA /dev/dsk/cXtYdZ

correct #lvextend -m 1 /dev/vg02/lvolA /dev/dsk/cXtYdZ

wrong #lvreduce 0 /dev/vg02/lvolA /dev/dsk/cxtydz /dev/dsk/cxtydw

correct #lvreduce -m 0 /dev/vg02/lvolA /dev/dsk/cxtydz /dev/dsk/cxtydw

yes you can do,
velasco
Occasional Contributor

Re: lvreduce a mirror from 2 disks

Hi
thank for all !!
an my apologize for cut/paste mistazer in the commande lines.
All is ok SO.
my goal is to move data from on bay to the other and between "pvmove" and "mirror lv" i had an doubts but all is ok now.
thank
Jollyjet
Valued Contributor

Re: lvreduce a mirror from 2 disks

HI Shalom steven is right you break the mirror and recreate it will save your time.