Operating System - HP-UX
1833875 Members
1917 Online
110063 Solutions
New Discussion

How to fix primary and secondary mirrrors extents residing on same disks?

 
SOLVED
Go to solution
Randy Hagedorn
Regular Advisor

How to fix primary and secondary mirrrors extents residing on same disks?

Hi all,

I have a logical volume (/dev/vg02/Group2) that appears to be mirroring across the same volumes. I am using strict allocation policy so none of the same extents are written to the same disks, but the disks seem to be switching back and forth for the primary and mirror extents.

In summary here is the logical extent info from lvdisplay, without all the actual extent information here is the layout.

Would this cause I/O performance problems?

I would like to get this fixed so that all PV1 is on one controller and all PV2 is on the other controller. How would that be done? Would I lvreduce -m 0 /dev/vg02/Group2 /dev/dsk/c4t4d0 /dev/dsk/c1t1d0 and then lvextend -m 1 /dev/vg02/Group2 /dev/dsk/c4t4d0 /dev/dsk/c1t1d0 ??

Does anyone know how this happens so it doesn't do it again?

PV1 PV2
c4t13d0 c1t12d0
c4t1d0 c1t1d0
c4t1d0 c4t4d0
c1t1d0 c4t4d0
c4t4d0 c1t4d0


I know it's alot of questions, but any information would be helpful.

Thanks,
Randy
8 REPLIES 8
Steven E. Protter
Exalted Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

It could cause performance AND reliability problems.

I recommend you use lvsplit on all the logical volumes, delete the copies and re-mirror.

lvextend -m 1 /vg00/lvol1 /dev/dsk/c1t1d0

If you specifiy the disk to mirror to and you plan the layout in advance, you won't end up with the problem you are experiencing now.

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
Helen French
Honored Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

If I understood your question correctly, you need to have PVGs allocated for the primary and the mirror volumes.

This is the normal practice: if your logical volume is small enough to be included in a single disk, create your LV their first and when you create mirror, specify the mirror disk name. Now, if your LV is large and spanned across multiple disks, create PVG (physical volume groups. man lvmpvg(4)). The first PVG (in /etc/lvmpvg) can include first set of primary disks, and then PVG #2 can include mirror set of disks. This way, the primary will be always in the first PVG. When you mirror, specify the PVG name instead of disk names.
Life is a promise, fulfill it!
RAC_1
Honored Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

What does lvdisplay /dev/vg01/group2 says??
By default strict policy is set. What that means is mirror extents can not be on same as of original extents.

Anil
There is no substitute to HARDWORK
Randy Hagedorn
Regular Advisor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

Anil,

Here is the lvdisplay. It looks like strict is being used.

[ROOT] /etc/lvmconf # lvdisplay /dev/vg02/Group2
--- Logical volumes ---
LV Name /dev/vg02/Group2
VG Name /dev/vg02
LV Permission read/write
LV Status available/syncd
Mirror copies 1
Consistency Recovery MWC
Schedule parallel
LV Size (Mbytes) 15000
Current LE 3750
Allocated PE 7500
Stripes 0
Stripe Size (Kbytes) 0
Bad block on
Allocation strict
IO Timeout (Seconds) default

Randy
Sundar_7
Honored Contributor
Solution

Re: How to fix primary and secondary mirrrors extents residing on same disks?

I am afraid without recreating the logical volume, you cannot have all the PEs in PVs attached to one controller.

Strict/PVG strict allocation is not going to help you improve IO performance (unless you use distributed allocation with PVG-strict). They are primarily used to avoid Single Point Of Failures.

PEs are allocated this way because, LVs seem to have the strict allocation policy. With strict allocation policy, LVM will only make sure it is not mirroring to the same PV.

Here is what you can do

1) Backup the LV
2) Remove the LV
3) Create PVG-group in the /etc/lvmpvg file
4) Create the LV with PVG-strict allocation policy set (lvcreate -s g option)
5) lvextend -m 1 and create mirror
6) Create filesystem
7) Restore from the backup

- Sundar
Learn What to do ,How to do and more importantly When to do ?
RAC_1
Honored Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

I doubt that somewhere (may be during lvolv extending) strict poolicy was set to no and then againto yes)

To take care of it, do a lvsync on lvol, break the mirror. Make sure that enough extends are available to mirror it on another PV. then do lvextend -m 1 /dev/vg01/group2 /dev/dsk/cxtxdx

Anil
There is no substitute to HARDWORK
Sanjay_6
Honored Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

Hi Randy,

If this is a SG OPS env, you could take a look at this link from itrc which suggests a probable cause for your problem.

http://www1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000072806658

The itrc doc id is CMTKBRC00008618.

Hope this helps.

Regds
Sundar_7
Honored Contributor

Re: How to fix primary and secondary mirrrors extents residing on same disks?

One more suggestion.

If you have the following PVG configuration

PVG1

/dev/dsk/c4t1d0
/dev/dsk/c4t13d0

PVG2
/dev/dsk/c1t12d0
/dev/dsk/c1t1d0

when you use lvcreate, you dont have to control over which PV the LV extends are allocated to. LVM will first try to allocate the extends from /dev/dsk/c4t1d0. Once it is done with c4t1d0, it will take the extends from c4t13d0.

If this is not desirable to you,

1) lvcreate a LV without mentioning any size
2) lvextend /dev/vg02/lvol2 /dev/dsk/c4t13d0

This way, you can have control over which PV is used by the LV even when more than one PV is available in the PVG or VG itself.
Learn What to do ,How to do and more importantly When to do ?