LVM Snapshot Merge: Data Consistency During Online Rollback
0 reputation · 03 Jan 2026, 12:09 UTC
LVM snapshots are frequently used to create recovery points before performing high-risk operations, such as database schema migrations. While the lvconvert --merge command allows for the restoration of a logical volume to a previous state, the behavior of online merges presents a challenge for data integrity.
When a merge is initiated while the origin volume remains active and receiving writes, the kernel must reconcile the snapshot data with the current state of the volume. There is uncertainty regarding the exact atomicity of this process and how it handles concurrent I/O operations during the merge window.
Constraints and Risks
- I/O Contention: The merge process consumes significant bandwidth, potentially impacting the performance of the live application.
- Write Collision: If the application continues to modify the same blocks being merged from the snapshot, the resulting state may be inconsistent.
- Space Exhaustion: If the snapshot's allocated COW (Copy-on-Write) space is exhausted before the merge, the snapshot becomes invalid.
Does the Linux kernel guarantee a consistent point-in-time state for the entire volume after an online merge if writes occurred during the process? How does the merge behavior differ between thick-provisioned snapshots and thin-provisioned snapshots regarding write-ordering during rollback?