1835863 Members
4855 Online
110085 Solutions
New Discussion

Re: LVM Mirroring

 
P Arumugavel
Respected Contributor

LVM Mirroring

Hi Guru's, Let me have a clear cut idea on LVM mirroring as follows.
1. Whether Mirrored PE's can be placed on disks conncted to different controllers?
2. If the 1st point is possible then what is the concept of PVG introduced?
Give me good explanation on PVG.
18 REPLIES 18
James R. Ferguson
Acclaimed Contributor

Re: LVM Mirroring

Hi:

LVM mirroring is implemented at the *logical volume* level.

By default, mirrored extents are allocated on separate physical volumes. This is controlled by the 'strict' allocation setting for the logical volume (the default). To defeat this is to loose all high-availability since a physical disk failure could then mean the destruction of all mirrored copies of a particular extent.

With regard to question-1, yes, mirrored extents can reside on physical disks that are connected to different controllers.

The idea of Physical Volume Groups is that this is a way to limit allocation to specific physical volumes. The '/etc/lvmpvg' files is used for this purpose. This can be useful with mirrored logical volumes as it allows you to specify the physical volumes that should be used to extend a mirrored logical volume. Regardless, LVM always ensures that physical
extent allocation can satisfy the current allocation policy or policies. To use PVG, the allocation policy of the logical volume must be set as 'PVG-strict'.

With 'strict' allocation, mirrored extents of a logical volume cannot share
the same physical volume. With 'PVG-strict' allocation, mirrors of a logical extent cannot share the same physical volume group.

See the manpages for 'lvcreate(1M)', 'lvextend(1M)', 'lvchange(1M)' and 'lvmpvg(4)' for more information.

Regards!

...JRF...
Patrick Wallek
Honored Contributor

Re: LVM Mirroring

With regard to question 1 -- The answer is "yes" as JRF pointed out. Additionally this is ABSOLUTELY the recommended way to mirror. You WANT your primary and mirror disks to be on different controllers. That way if a controller breaks you still have data accessible (which is the point of mirroring).
P Arumugavel
Respected Contributor

Re: LVM Mirroring

hi JRF / PW,
If my 1st point is possibele, so i can map the logical extents to any of the disks, connected to different controller as i desired, in terms of HA of data. Then I think i dont need of PVG-strict, which does the same. Am i right?
Steven E. Protter
Exalted Contributor

Re: LVM Mirroring

Shalom,

You are right, but you must make sure you don't have both mirror copies of a logical volume on the same disk.

It is always best to lay out your mirrors yourself, not use sam or let the command decide which disk to use to make the mirror copy.

There are instances when strict PV rules get in the way and need to be turned off.

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
James R. Ferguson
Acclaimed Contributor

Re: LVM Mirroring

Hi (again):

> If my 1st point is possibele, so i can map the logical extents to any of the disks, connected to different controller as i desired, in terms of HA of data. Then I think i dont need of PVG-strict, which does the same. Am i right?

'PVG-strict' is a form of 'strict' allocation as we already noted. It is designed to help you manage mirroring and the expansion of mirrored logical volumes. The '/etc/lvmpvg' file can be created before or during volume group creation.

You could certainly manage placing mirrored extents on different physical volumes without PVG-strict allocation in force. When you perform a 'lvextend' you have the option of specifying either the physical volumes or the physical volume *group* in question.

Regards!

...JRF...
P Arumugavel
Respected Contributor

Re: LVM Mirroring

Hi JRF,
It seems like totally mixed up. Give me some points on below, whold help me to have keen note on this concept.
What are the main advantages of PVG? (Greatful if it would be compared with some examples) and how to differ this concept?
Torsten.
Acclaimed Contributor

Re: LVM Mirroring

>> What are the main advantages of PVG?

I try to keep this simple.
Let's say, you have 4 disks, 2 on each channel, HBA or whatever

A-B

C-D

You want to mirror A to C; B to D.

LVM itself makes sure you cannot mirror A to A (strict); but mirror A to B would be OK.

If you now create a group1 A and B; group2 C and D; you can create an LVOL in group1 and say "please mirror" - so the mirror is for sure on group2.



Now imagine more disks (e.g. 10) in each group. So you mirror group1 to group2, not within a group.

This concepts helps to keep this simple.




I hope this is clear, not more confusing ...

;-)

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
James R. Ferguson
Acclaimed Contributor

Re: LVM Mirroring

Hi (again):

This guide might help you understand. In particular, see page-51:

http://bizsupport1.austin.hp.com/bc/docs/support/SupportManual/c02023734/c02023734.pdf

Regards!

...JRF...
P Arumugavel
Respected Contributor

Re: LVM Mirroring

Hi Torsten...,
I am coming to the scenario you shown, Disk A&B connected to Adapter1 and Disk C&D connected to Adapter2.
>>LVM itself makes sure you cannot mirror A to A (strict); but mirror A to B would be OK.
Query since my first post is LVM itself, can I mirror A to C & A to D?
Torsten.
Acclaimed Contributor

Re: LVM Mirroring

>> Query since my first post is LVM itself, can I mirror A to C & A to D?

Yes, you can either mirror

A to C and A to D (double mirror)

or

A to C and B to D

with or without PVG.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
P Arumugavel
Respected Contributor

Re: LVM Mirroring

If yes, so i can either mirror

A to C and A to D (double mirror)
or
A to C and B to D
(with or without PVG).
Then what is the need of PVG-Strict? I can have one good copy of my data accessible in the event of hardware(Adapter) failure as above...



Torsten.
Acclaimed Contributor

Re: LVM Mirroring

Exactly.

If you have 2 sets of disks; each has an HBA, a disk enclosure and several disks, you can loose the HBA, some disks or even the complete enclosure and you have still access to your data.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
P Arumugavel
Respected Contributor

Re: LVM Mirroring

So is there any special benefit by using PVG-Script? (Except DAP)
Torsten.
Acclaimed Contributor

Re: LVM Mirroring

In the past in many configuration there were many external disks used. I have seen up to ~150 single disks connected to a single server.

Nowadays you have SAN based arrays.

But with so many disks you learn to love PVGs.


In addition, you can easily create extend based striped mirrors that way.


Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
sudheerch
Frequent Advisor

Re: LVM Mirroring

By default logical volume is created with strict allocation policy, with this policy we can mirror logical volume with in the physical volume, so with this policy there is no redundancy on disk level

So, on PVG Strict allocation policy, a group of physical volume within the volume group is a PVG we can create many no of PVG's on a volume group. here we can mirror the logical volume in two PVG's
Torsten.
Acclaimed Contributor

Re: LVM Mirroring

>> By default logical volume is created with strict allocation policy...

correct.


>> ... with this policy we can mirror logical volume with in the physical volume, so with this policy there is no redundancy on disk level ...

not correct.


Strict means

"...Mirrors of a logical extent cannot share the same physical volume. This is the default."

source: man lvcreate

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
sudheerch
Frequent Advisor

Re: LVM Mirroring

strict allocation policy is not enforced, both mirrors will be able to reside on the same physical volume
And PVG Strict allocation policy is also doing the same but here we are diving the PV's on the volume group

what is the main difference of PVG and Strict
Torsten.
Acclaimed Contributor

Re: LVM Mirroring

>> strict allocation policy is not enforced, both mirrors will be able to reside on the same physical volume


But only if you set strict to false.

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!