[linux-lvm] LVM2 on-disk layout

Milan Broz mbroz at redhat.com
Mon Jan 5 20:14:34 UTC 2009


Tejas Sumant wrote:
> 3) Why the metadata inside MDA wraps around, instead of the offset
> pointing to the start of metadata?

Metadata updates run in two steps:

- write() saves the new metadata to new place (circular buffer)
but still keeping previous version active.
(Also operation can be safely reverted here, because there
are still old version of metadata prepared.)

- commit() switch the pointer to new offset and activate
new metadata. This operation is atomic (one synchronous sector write)
so it cannot corrupt active metadata copy.
(If the write fails, old metadata are still valid.)

(Imagine for example power failure during metadata write operation.)

There is serial number in metadata, lvm will update mda content to newest
metadata if any copies are older.


Milan
--
mbroz at redhat.com




More information about the linux-lvm mailing list