1834736 Members
3056 Online
110070 Solutions
New Discussion

lvsplit

 
SOLVED
Go to solution
Shahul
Esteemed Contributor

lvsplit

Hi

I have a two way mirrored volume. I want to split this to three.. How will I proceed? Normally lvsplit will split in to two, After that it would not allow to split unless until U do lvmerge.

TIA
Shhaul
10 REPLIES 10
Helen French
Honored Contributor

Re: lvsplit

Hi Shahul:

Whatever you said is correct. You cannot use lvsplit to split the mirror in to three. It allows only splitting in to two.

Why do you want to use this option ? Normally this option is used for backing up the online data from the mirror. In this case, it does not matter if you split in to two or three !

If you want to free-up the space which is used by the *third LV space* , then use lvreduce -m 1

HTH,
Shiju
Life is a promise, fulfill it!
John Palmer
Honored Contributor
Solution

Re: lvsplit

This appears to work though:-

lvsplit
lvextend -l b
lvsplit -s
lvreduce -l b

The lvextend causes the lvsplit bitmask to be removed thus allowing another lvsplit.

Regards,
John
S.K. Chan
Honored Contributor

Re: lvsplit

You can't split a 2-way mirrored LV into 3 copies. Even if you got a 3-way mirrored LVs, example ..
# lvdisplay -v /dev/vgXX/lvolX
==> shows 3 columns of LVs

when you run lvsplit it'll split into 2-copies ..
first copy=the 2-way mirrored LVs
2nd copy=the single LV from the last column in "lvdisplay"
harry d brown jr
Honored Contributor

Re: lvsplit

Shhaul,

It can be done, but you need to CHEAT. The CHEATing comes from forcing the MIRROR BIT MAP to be DISCARDED. To DISCARD the MIRROR BIT map, you simply extend the logical volume.


Let's say you have a two way mirror (original lvol plus 2 mirrors) (and the lvols have 500 extents):

lvsplit -s one /dev/vg01/lvol1
fsck /dev/vg01/lvol1one
lvextend -l 501 /dev/vg01/lvol1one
lvsplit -s two /dev/vg01/lvol1


live free or die
harry
Live Free or Die
Helen French
Honored Contributor

Re: lvsplit

Hi Harry/John:

That's an interesting cheating ! In that case, what will happen if you want to 'merge' it back using 'lvmerge' ? Is it possible ?

just curious ..
Shiju
Life is a promise, fulfill it!
harry d brown jr
Honored Contributor

Re: lvsplit

YES, BUT it will have to MIRROR it again, because there is NO BIT MAP --> cons = takes time to remirror the volume that was extended (in this case lvol1one)!


# lvreduce -l 500 /dev/vg01/lvol1one
When a logical volume is reduced useful data might get lost;
do you really want the command to proceed (y/n) : y
Logical volume "/dev/vg01/lvol1one" has been successfully reduced.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf

# lvmerge /dev/vg01/lvol1two /dev/vg01/lvol1
Logical volume "/dev/vg01/lvol1two" has been successfully merged
with logical volume "/dev/vg01/lvol1".
Logical volume "/dev/vg01/lvol1two" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf
# lvmerge /dev/vg01/lvol1one /dev/vg01/lvol1
Logical volume "/dev/vg01/lvol1one" has been successfully merged
with logical volume "/dev/vg01/lvol1".
Logical volume "/dev/vg01/lvol1one" has been successfully removed.
Volume Group configuration for /dev/vg01 has been saved in /etc/lvmconf/vg01.conf




live free or die
harry
Live Free or Die
Helen French
Honored Contributor

Re: lvsplit

Hi Harry:

Thanks a lot for sharing the info. Learning new things everyday !

live free or die =))
Shiju
Life is a promise, fulfill it!
Uday_S_Ankolekar
Honored Contributor

Re: lvsplit

Now that's interesting...-)

Thanks Harry.

-USA..
Good Luck..
Shahul
Esteemed Contributor

Re: lvsplit

Hi All

Thanks to all... Special thanks to John palmer and Harry.

Shiju Don't worry.. I have done it.. Working fine...

Thanks
Shahul
Shahul
Esteemed Contributor

Re: lvsplit

Thanks to all