Skip to contentSkip to conversation

Where is the PE to LE mapping done?

linux-lvm 조완근 2 participants 2 messages Jun 8, 2006

lore
Share & tools
lore

조완근

author
#0 lore raw

Hello, This is my second e-mail.

 

Where does the mapping between PE and LE is done? And When happen?

When the new Logical Volume is created based on already built PV and VG, is  the mapping done?

 

In the source code, /lib/metadata/metadata.h, there are "lv_segment" & "pv_segment". does the "segment" equal the "extent"??

 

Each "physical_volume" struct and "logical_volume" struct has a segment list like "pv_segment" and "lv_segment". But there are also "pv_list" and "lv_list". How the mapping is done with these structures..??

 

One more thing is, "What code do I have to read in the sources to know how the mapping is done??"

 

Thank you ^^:

#1 lore raw
Quoted 1 line · 조완근

Hello, This is my second e-mail.

Sorry, if my first answer was not helpful to you.
Here is a good introduction into LVM internals
by Alasdair G Kergon:

http://people.redhat.com/agk/talks/LVM2-LinuxTag2006

You should also have a look into the meta data backup under /etc/lvm/backup/* This describes the content of the data structures you found in the sources. May be this helps to understand how a VG is organized.

But even if you are much faster in reading and understanding C source code (57251 lines) than reading the documentation (3166 lines), I still think, your problem can be solved by using the provided LVM-tools.

For example: you may modify/edit the meta data dump with a text editor and use "vgcfgrestore" to fill up the data structs you found. (but you can also destroy your LVM this way!).

Dieter.