1753863 Members
7373 Online
108809 Solutions
New Discussion юеВ

LVM

 
SOLVED
Go to solution
shruti_1
Advisor

LVM

Hi

I have a question regarding LVM allocation policy. Wanted to know what is strict and distributed allocation policy. And which one is better and how to create each of them
5 REPLIES 5
Fabio Ettore
Honored Contributor

Re: LVM

Hi,

man lvcreate

and look for

-s strict

-D distributed

It explains fine how these policies work. Difficult to say what is better, it depends on what you want to get on distribution of extents, according to your configuration, etc.

Feel free to let us know if posts help you and if so assigning points.

Best regards,
Fabio
WISH? IMPROVEMENT!
Steven E. Protter
Exalted Contributor
Solution

Re: LVM

Shalom shruti,

Strict allocation means that a logical volume must be coniguous. This means it can not be broken into parts.

The root logical volume must be contiguous for example.

A contiguous policy does generally result in better performance, but there are exceptions.

Which policy to use depends on performance, disk space restraints and common sense.

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
Arunvijai_4
Honored Contributor

Re: LVM

Hi Shruti,

Do a # man lvcreate, you will get these details.

-s strict Define strict allocation policy. Mirror copies of
a logical extent can be allocated to share or not
share the same physical volume (or physical volume
group). This option only makes sense when the
physical volumes (of the volume group that owns

the logical volume to be changed) reside on
different physical disks. strict can have one of
the following values:

y (default) Set a strict allocation
policy; mirrors for a logical extent
cannot share the same physical volume.

n Do not set a strict allocation policy;
mirrors for a logical extent can share
the same physical volume.

g Set a PVG-strict allocation policy;
mirrors for a logical extend cannot
share the same physical volume group.
PVG-strict allocation policy cannot be
set on a logical volume in a volume
group that does not have any physical
volume group defined.

-C contiguous Defines the contiguous allocation policy. A
contiguous logical volume has three
characteristics:

o Physical extents are allocated in
ascending order,
o No gap is allowed between physical extents
within a mirror copy,
o Physical extents of any mirror copy all
reside in a single physical volume.

Use the strict ( -s) and contiguous ( -C) options
together to form various combined allocation
policies on a logical volume. For example, -s y
-C y means to create a logical volume such that
each mirror copy is contiguous, yet mirror copies
of a logical extent cannot share the same physical
volume.

y Set a contiguous allocation policy.

n (default) Do not set a contiguous
allocation policy.

"A ship in the harbor is safe, but that is not what ships are built for"
Torsten.
Acclaimed Contributor

Re: LVM

Have a look into the manpage "man lvcreate".

"...Set the strict allocation policy.
Mirror copies of a logical extent can be
allocated to share or not share the same
physical volume or physical volume
group..."

For example, you can allow to have a mirror copy on the same disk, but you *should never* do this.

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!   
Ninad_1
Honored Contributor

Re: LVM

Hi Shruti,

In simple words
Strict allocation policy - This is in conjunction with mirroring.
If set to yes which is default means you cannot have mirror copy of a volume on a physical disk to be on the same physical disk.
If set to no - you can have the mirror copy of a volume on the same physical disk [ But this would defeat the whole purpose of having mirrored copies so that if you lose the disk both the copies are not available and are affected]
So in my opinion strict policy should be set to y (which is default)

Distributed allocation policy - This is in conjunction with extent based striping.
When this is not set whenever you create a volume the free space from the 1st physical volume is first used till its fully used, then free space from next disk and so on - this is the default behaviour.
When you set to y - means when you create a volume the first extent (depends on your extent size you have defined or the default if you havent specified one - for the volume group - see vgdisplay for that VG and refer to PE size)will be allocated from the 1st physical disk, the 2nd from the next physical disk and so on and again from 1st in a round-robin fashion. This is nothing but striping.

Hope this clarifies,
Ninad