Operating System - HP-UX
1826499 Members
1742 Online
109692 Solutions
New Discussion

Split Logical Volume Mirroring

 
Cliff Lim Kok Hwee
Regular Advisor

Split Logical Volume Mirroring

Gd Day Forum,

I am thinking of splitting the mirror on a particular LV /dev/vg00/lvol13 which is currently residing in the following harddisks.

LV Name /dev/vg00/lvol13
LV Status available/syncd
LV Size (Mbytes) 1024
Current LE 64
Allocated PE 128
Used PV 2

--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c1t2d0 64 64
/dev/dsk/c2t2d0 64 64

#lvreduce -m 0 /dev/vg00/lvol13

Queries:
1) How do I identify which is the mirrored copies? Is it the first row in the distribution will be the primary copy?

2) If I need to have the same mirroring format will the following command suffice:
#lvextend -m 1 /dev/vg00/lvol13 /dev/dsk/c2t2d0
Assuming /dev/dsk/c2t2d0 is the mirrored harddisk

Thanks and Regards/cliff
4 REPLIES 4
Bill Hassell
Honored Contributor

Re: Split Logical Volume Mirroring

lvdisplay -v (for each lvol) will show you the exact mirror layout. The first column is generally known as the primary set of extents and the second (and third if double mirrored) will be shown in columns. Each extent and it's mirror can be on different disks, even striped across several disks. You can move either the primary or the mirror (or both) extents to another disk using pvmove. But you can also lvreduce -m 0 and lvextend -m 1 to accomplish the same task. The time required is not that much different although pvmove would be the safest as the source and destination disk extents are carefully checked to ensure no data loss.


Bill Hassell, sysadmin
Thayanidhi
Honored Contributor

Re: Split Logical Volume Mirroring

Hi,
Once a LV is mirrored both copies are synchronized. There is no primary copy and secondary copy.
If you want remove the mirror copy from c2t2d0, then the command would be

lvreduce -m 0 /dev/vg00/lvol13 /dev/dsk/c2t2d0

For extending back your command is correct.

When you reduce or extend root,boot,swap
run lvlnboot. See man page of lvlnboot

Note: The term "split" is diffrent from "reduce". Reduce removes the mirror copy and split (see man page lvsplit) splits the LV online. The data would be available in both LV's(the splited LV is named as b
see also man page of lvmerge

Hope this helps

Regds
TT


Attitude (not aptitude) determines altitude.
Cliff Lim Kok Hwee
Regular Advisor

Re: Split Logical Volume Mirroring

Hi Forumers,

If I run the following commands,
lvsplit /dev/vg00/lvol13

Queries:

-The following lv /dev/vg00/lvol13b will be created automatically?
-In order to merge back the lv, the following command will be executed without the need to specify the harddisk?
-Can I said that the 2nd column from lvdisplay -v /dev/vg00/lvol13 should be corresponding to /dev/vg00/lvol13b?

lvmerge /dev/vg00/lvol13b /dev/vg00/lvol13

Thanks/cliff



Tony Scully_2
Valued Contributor

Re: Split Logical Volume Mirroring

Cliff,

In answer to you last questions:

The lvol13b is created automatically by the split command -- you can use the -s option on lvsplit if you want to call the split lvol something else, eg -s _bkup will create lvol13_bkup.

If you want the split lvol to be created using the data on a particular pv, then you need to create PVGs within the VG for the disks you want, then use the -g option on lvsplit to tell lvsplit to use that disk. Otherwise I don't think you can be certain which copy will be used -- but I'm willing to be corrected!

For the lvmerge, the syntax is correct, the first lvol you specify is the destination, the second the source, so if you wanted to sync so that the data on lvol13 is now mirrored, use the command you have specified.

Don't forget to fsck the split lvol (lvol13b) (assuming it contains a file system) before you use it for anything.

HTH
Tony
You CAN do that on HP