what is writed on raw disk,
VolGroup00 {
id = "QCNEJh-9bbG-x6AV-uZEz-Dhsi-1LL7-fYSWbL"
seqno = 4
status = ["RESIZEABLE", "READ", "WRITE"]
extent_size = 65536
max_lv = 0
max_pv = 0
physical_volumes {
pv0 {
id = "p6HuAe-QgIZ-DQPE-MpMg-3CbJ-9Dv8-EtrI6Y"
device = "/dev/sda2"
status = ["ALLOCATABLE"]
dev_size = 16563015
pe_start = 384
pe_count = 252
}
pv1 {
id = "u3chxH-Poxl-39Sg-joPi-1qAa-vN3J-JvaWmB"
device = "/dev/sdc"
status = ["ALLOCATABLE"]
dev_size = 4096000
pe_start = 384
pe_count = 62
}
} logical_volumes {
LogVol00 {
id = "yMgaVf-hfk5-kjVz-3wSe-cyw6-O8j3-75P0b4"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {
start_extent = 0
extent_count = 202
type = "striped"
stripe_count = 1 # linear
stripes = ["pv0", 0]
}
}
LogVol01 {
id = "QZ9Plz-pW7Y-691z-XtdI-S5SI-V7Kc-Lrzis1"
status = ["READ", "WRITE", "VISIBLE"]
segment_count = 1
segment1 {
start_extent = 0
extent_count = 50
type = "striped"
stripe_count = 1 # linear
stripes = ["pv0", 202]
}
}
}//logical_volumes
}
------------------------------------
how many this kind of struct is writed on raw disk,and its value???what is different?? how a group is parsed?
Dne 10.9.2010 17:00, yue napsal(a):
Quoted 4 lines
VolGroup00 {
id = "QCNEJh-9bbG-x6AV-uZEz-Dhsi-1LL7-fYSWbL"
seqno = 4
status = ["RESIZEABLE", "READ", "WRITE"]
...
Quoted 6 lines
}
}//logical_volumes
}
------------------------------------
how many this kind of struct is writed on raw disk,and its value???what is different?? how a group is parsed?
There is always at least one back-up copy, to be able to do commit - first write new metadata - and when they are fully written mark them as valid. So in case of any write problem there is always previous last valid version available - see pvcreate --metadatasize --metadatasize and some other options in manpage)
Major part of parser is located in lib/config/config.c.
As for your previous question about some detailed LVM architecture document - well mostly only the source code itself...
It would probably be better to specify what are you trying to achieve to get help with that ?
Zdenek
i want to know lvm2 on source-code level.
and kernel device-mapper??
just analysis source code is hard, can you give me some function-call stream. and whole blueprint.
----------------------------------------------------------------------------------------------
Quoted 29 lines · At 2010-09-10 23:47:01,"Zdenek Kabelac" <[email protected]> wrote:
Dne 10.9.2010 17:00, yue napsal(a):
Quoted 4 lines
VolGroup00 {
id = "QCNEJh-9bbG-x6AV-uZEz-Dhsi-1LL7-fYSWbL"
seqno = 4
status = ["RESIZEABLE", "READ", "WRITE"]...
Quoted 6 lines
}
}//logical_volumes
}
------------------------------------
how many this kind of struct is writed on raw disk,and its value???what is different?? how a group is parsed?There is always at least one back-up copy, to be able to do commit - first write new metadata - and when they are fully written mark them as valid. So in case of any write problem there is always previous last valid version available - see pvcreate --metadatasize --metadatasize and some other options in manpage)
Major part of parser is located in
lib/config/config.c.As for your previous question about some detailed LVM architecture document - well mostly only the source code itself...
It would probably be better to specify what are you trying to achieve to get help with that ?
Zdenek
Dne 10.9.2010 17:53, yue napsal(a):
Quoted 4 lines
i want to know lvm2 on source-code level.
and kernel device-mapper??
just analysis source code is hard, can you give me some function-call stream. and whole blueprint.
If you really want to know 'in-depth' detail - I may suggest to use tools like kcachegrind to get flow-control.
It's in fact not so easy to describe lvm2 functionality in few lines and it's also 'moving' target as some call flow changes over the time.
Very slight overview might look like this:
- read config
- scan available block devices according config (changes quite a lot with udev integration and cache usage)
- create internal structures and do some action according to given command
- some of commands are changing dm table - so internal dm tree structure is generated - this abstraction is hidden in libdm
- activation/deactivation is executed - note - as lvm2 supports clusters - this is somewhat more complex and unless you plan to have a very deep look inside you probably don't want to know all the magic behind - lots of limits apply - very tight memory rules needs to be preserved to avoid deadlocks...
If you plan to add new 'target' - you may look into lib/striped subdir - there is very some simple example.
Some sort of 'virtual' methods calls are used - unfortunately this call flow is far from complete so target usually needs few quirks here and there over the whole code base for now and usually knows a long depth knowledge of this process - far from perfect, but that's current status...
Zdenek