1834330 Members
2226 Online
110066 Solutions
New Discussion

Lvsplit

 
SOLVED
Go to solution
Mike_305
Super Advisor

Lvsplit

Hi,

I need to split primary copy of mirror and leave secondry.

Thanks in advance.

Mike
If there is problem then don't think as problem, think as opportunity.
13 REPLIES 13
Animesh Chakraborty
Honored Contributor

Re: Lvsplit

Hi,
If you want to split the logical volume
#lvsplit /dev/vg00/lvolx
# fsck /dev/vg00/lvolxb
#mount /dev/vg00/lvolxb /xyz.backup

Remove mirror copies of logical extents of a logical volume from the
physical volume /dev/dsk/c1t0d0:

#lvreduce -m 0 /dev/vg01/lvol4 /dev/dsk/c1t0d0

best of luck
Animesh

Did you take a backup?
Scott Van Kalken
Esteemed Contributor

Re: Lvsplit

lvsplit /dev/vg00/lvol4
Logical volume "/dev/vg00/lvol4b" has been successfully created with
character device "/dev/vg00/rlvol4b".
Logical volume "/dev/vg00/lvol4" has been successfully split.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.con
f

that's for /tmp

I could now mount the lvol4b

To remerge them:

lvmerge /dev/vg00/lvol4b /dev/vg00/lvol4
Logical volume "/dev/vg00/lvol4b" has been successfully merged
with logical volume "/dev/vg00/lvol4".
Logical volume "/dev/vg00/lvol4b" has been successfully removed.
Volume Group configuration for /dev/vg00 has been saved in /etc/lvmconf/vg00.con
f

...and straight from the man page:
Split an online logical volume which is currently mounted on /usr so
that a backup can take place:

lvsplit /dev/vg00/lvol1
fsck /dev/vg00/lvol1b
mount /dev/vg00/lvol1b /usr.backup

Perform a backup operation, then:

umount /usr.backup
lvmerge /dev/vg00/lvol1b /dev/vg00/lvol1


Scott.

It's lots of fun to do, but not fun when you're fresh faced and everything is shiny new and you realise you've installed a system and mirrored something other than lvol1 first.

Mike_305
Super Advisor

Re: Lvsplit

Hi Animesh,

I am trying to split PE1 and make my PE2 as primary copy. The way you are saying that will not help because the minute I split copy my secondary goes away and primary stays.
I want keep PE2 as online copy.

Thanks in advance

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Scott Van Kalken
Esteemed Contributor

Re: Lvsplit

Mike,

Just out of interest, why?



Scott.
Mike_305
Super Advisor

Re: Lvsplit

Hi Scott,

Because on this one logical volume group(disk) my PE1 status is "stale". What I am trying to do is split the primary mirror copy, then do lvreduce on that disk and lvextend back with the same disk. I am also trying to avoid downtime. My database will be running on a mirror copy. I have looked at all the options and I can't get the right answer. Hopefully someone has the answer.

Thanks for your quick reply.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.
Scott Van Kalken
Esteemed Contributor

Re: Lvsplit

Technically a split and merge should fix this.

Animesh Chakraborty
Honored Contributor

Re: Lvsplit

Hi Mike,
What are you spliting? the mirror or lv ?

In case of of lvsplit ,you can use the /xyz.backup file system and rename the mount point as required and umount the original one.
Still not sure why you want that way !!



Did you take a backup?
Animesh Chakraborty
Honored Contributor

Re: Lvsplit

Now it is clear.

Try
#lvchange -a y /dev/vgxx/lvolx
Did you take a backup?
Animesh Chakraborty
Honored Contributor

Re: Lvsplit

Hi Mike,
Did you try lvsync ?
#lvsync /dev/vgxx/lvolx

Sorry for my splitted replies :)
Animesh
Did you take a backup?
James R. Ferguson
Acclaimed Contributor
Solution

Re: Lvsplit

Hi MIke:

Under normal conditions, that is all extents in all physical volumes of a mirrored logical volume are current, then 'lvsplit' is used to create an unmirrored copy which can be used for backup purposes, for instance.

Under normal conditions, if you simply want to eliminate a mirrored logical volume, one uses 'lvreduce -m 0 /dev/vgXX/lvolN /dev/dsk/cXtYdZ'. This specifies the physical volume on which you no longer want the mirror.

In the case you report, you have "stale" extents. This may mean a faulty disk. It may also indicate a temporary situation following a power-failed disk event. Thus, 'lvsync' or 'vgsync' is approriate.

Regards!

...JRF...


James R. Ferguson
Acclaimed Contributor

Re: Lvsplit

Hi Mike:

In the event that an 'lvsync' or 'vgsync' does not return your stale extents to "current", have a lool at Technical Knowledge Base document #KBRC00002271 for further help troubleshooting stale mirrors (attached).

Regards!

...JRF...
Mike_305
Super Advisor

Re: Lvsplit

Hi James,

James has hit the jackpot. I got my answer and works like fine. I wanted to split first copy of mirror and I was able to do that using his recommendation.

Lvdisplay ???v ???k /dev/vg00/lvolx (to find out mirror PV number) then do

Lvreduce ???m 0 /dev/vgXX/lvolN /devdsk/cXtYdZ

Thanks to all of you for your quick reply and help.

Thanks,

Mike
If there is problem then don't think as problem, think as opportunity.