Skip to contentSkip to conversation

crash during metadata operations

linux-lvm Kai-Min Sung 2 participants 2 messages May 7, 2003

lore
Share & tools
lore
#0 lore raw

I was curious how LVM1/LVM2 handles a crash in the middle of a metadata operation. I presume an operation such as vgextend will update the mapping in the VGDA section of the disk. What happens if you crash in the middle of updating the VGDA? Hopefully, you don't end up with a partial mapping. I can see a way of guaranteeing atomicity by maintaining two VGDA sections and including a timestamp at the end of each write. Does LVM do something like this?

Regards,
-Kai

#1 lore raw
Quoted 3 lines · Kai-Min Sung

I can see a way of guaranteeing atomicity by
maintaining two VGDA sections and including a timestamp at the end of each write. Does LVM do something like this?

The format 2 metadata does indeed use a scheme like this. If you use format1 metadata with LVM2 (i.e. just upgrade your tools from LVM1 without subsequently upgrading your metadata), you will not have this crucial protection.

- Joe