Operating System - Linux
1752782 Members
6317 Online
108789 Solutions
New Discussion юеВ

Splitting a mirror with LVM

 
Jonathan Caplette_1
Super Advisor

Splitting a mirror with LVM

Hi guys,

I'm running Red Hat Enterprise Linux
ES release 4 (Nahant Update 6).

I've created a mirror of a Logical Volume with this command:

# lvconvert -m1 --corelog /dev/datavg/data /dev/dm-16

Now I've this:

# lvs -a -o name,copy_percent,devices
LV Copy% Devices
data 100.00 data_mimage_0(0),data_mimage_1(0)
[data_mimage_0] /dev/dm-11(0)
[data_mimage_0] /dev/dm-10(0)
[data_mimage_0] /dev/dm-14(0)
[data_mimage_1] /dev/dm-16(0)
ctrlmlv /dev/sda2(800)
homelv /dev/sda2(608)
slashlv /dev/sda2(0)
swaplv /dev/sda2(960)
tmplv /dev/sda2(832)


What I want to do is to remove the copy of that LV from my PV dm-11, dm-10 and dm-14.

I tried this:

# lvconvert -m0 /dev/datavg/data /dev/dm-10 /dev/dm-11 /dev/dm-14
No free extents on physical volume "/dev/dm-10"
No free extents on physical volume "/dev/dm-11"
No mirror images found using specified PVs.

What did I do wrong? My goal was to remove devices dm-10, dm-11 and dm-14 from my VG, so I decided to extend the VG with dm-16 and mirror my data LV to that device, then split that mirror from the other devices. The FS is mounted and need to stay online...

Thanks
Jonathan
2 REPLIES 2
Steven E. Protter
Exalted Contributor

Re: Splitting a mirror with LVM

Shalom Jonathan,

Please take a look at:

lvdisplay -v

The first step to solving the problem is figuring out where the mirror copies are.

Doing a mirror to multipath drive can be problematic as these drives represent multiple paths to possibly the same physical drive. Your mirror may have both mirror copies on the same drive, which makes them have no value to avoid data loss.

Also, if you could specify the server maker and hardware model, there may already be hardware mirroring in play or available.

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
Jonathan Caplette_1
Super Advisor

Re: Splitting a mirror with LVM

Here the lvdisplay result

# lvdisplay -v /dev/datavg/data
Using logical volume(s) on command line
--- Logical volume ---
LV Name /dev/datavg/data
VG Name datavg
LV UUID kqAdQf-9FNq-eq2r-MUmk-0X8P-db0h-yPBKaK
LV Write Access read/write
LV Status available
# open 1
LV Size 200.00 GB
Current LE 51200
Segments 1
Allocation inherit
Read ahead sectors 0
Block device 253:15


In fact, I know exactly were my mirror is spread, since I did it manually.

Primary devices Mirrored to:
dm-10 dm-16
dm-11 dm-16
dm-14 dm-16