Operating System - HP-UX
1834532 Members
2961 Online
110069 Solutions
New Discussion

allocated PE's vs alloc LE's in a lvol

 
SOLVED
Go to solution
Mark Henry_1
Frequent Advisor

allocated PE's vs alloc LE's in a lvol

Hi All,

When PE's are assigned to a lvol in a VG, how do LE's then relate to the PE's? Aren't they all used up straight away?

Does the lvol know about the filesystem and whether it's using all the LE's?

Thx,

Mark
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: allocated PE's vs alloc LE's in a lvol

Hi Mark:

Logical Extents (LE) map to Physical Extents (PE). Consider the case where the physical extents are distributed between two physical disk (see the man pages for 'lvcreate' for more information). In this case, the physical extents are allocated alternately between the two disks. The *logical* extents, and hence the order in which a steam of data would be written, are purely ascending. Thus, LE number 1 would be on disk-1; LE #2 on disk-2; LE #3 (back again) on disk-1, etc.

LVM keeps track of this relationship. You can "see" it by creating a distributed logical volume and then viewing the PE/LE relationship with 'lvdisplay -v /dev/vgXY/lvolZ'.

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: allocated PE's vs alloc LE's in a lvol

Just to clarify a point, the lvol knows or cares nothing about the filesystem. Typically, when the filesystem is creeated or extended it uses all the extents in the lvol but that is not a requirement. Remember, you can have an lvol that is simply that. It might be swap, it might be a raw volume (device); or it might be (and usually is) a block device which contains a filesystem.

Clay
If it ain't broke, I can fix that.
Mark Henry_1
Frequent Advisor

Re: allocated PE's vs alloc LE's in a lvol

Guys,

Thanks for the info:

James, consider the following article:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,11866,0x93cacf38d6bdd5118ff10090279cd0f9,00.html

How can a logical volume have less Current LE's than Allocated PE's? Is this an indication of usage on the disk? Regarding your description of the mapping of extents across different disks, the overall allocated PE's (from all disks) would still equal the LE's though?

Thanks,

Mark

p.s. thanks for the heads up - just took too much time taking care of it.
James R. Ferguson
Acclaimed Contributor
Solution

Re: allocated PE's vs alloc LE's in a lvol

Hi (again) Mark:

I'm not exactly sure what you are asking. If you look at a simple mirrored logical volume (with 'lvdisplay -v /dev/vgXY/lvolZ') you see this (abbreviated):

--- Logical volumes ---
LV Name /dev/vg00/lvol1
VG Name /dev/vg00
...
Mirror copies 1
...
Current LE 12
Allocated PE 24
...
--- Distribution of logical volume ---
PV Name LE on PV PE on PV
/dev/dsk/c0t6d0 12 12
/dev/dsk/c2t0d2 12 12

--- Logical extents ---
LE PV1 PE1 Status 1 PV2 PE2 Status 2
0000 /dev/dsk/c0t6d0 0000 current /dev/dsk/c2t0d2 0000 current
0001 /dev/dsk/c0t6d0 0001 current /dev/dsk/c2t0d2 0001 current
...

The "Current LE (logical extents)" equal 12 but the "Allocated PE (physical extents)" total exactly TWICE or 24. This is because the logical volume is mirrored. You can see the logical/physical mapping with the (v)erbose option of the 'lvdisplay' shown here. The "current" notation next to the PE indicates that the data on each mirror is the same (synchronized) as opposed to "stale" which would indicate a mirror being built or a bad disk.

Does this help?

...JRF...
Mark Henry_1
Frequent Advisor

Re: allocated PE's vs alloc LE's in a lvol

James,

Indeed it does - thanks!

My problem was I didn't see it was a mirrored disk and so the idea that there were more physical extents than logical ones assigned in the lvol didn't make sense. Also the fact that there were 2x PE's didn't click..

Thanks,

Mark