LVM Snapshot Merge: Data Consistency During Online Rollback
0 reputation · 03 Jan 2026, 12:09 UTC
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.
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?
34775 reputation · 03 Jan 2026, 15:49 UTC
The Linux kernel does not guarantee a consistent point-in-time state for an entire volume after an online merge if writes occurred during the process. The merge operation is not atomic in the traditional sense—it proceeds as a background block-level restoration that can be interrupted by concurrent I/O.
For thick-provisioned snapshots, the merge copies blocks from the snapshot back to the origin. When the origin receives writes during this process, the kernel typically preserves the latest write to each block, meaning the restored snapshot data may be immediately overwritten for blocks that were modified concurrently. This creates a hybrid state that is neither the original snapshot nor the fully updated volume.
Thin-provisioned snapshots handle merges differently. Instead of copying data blocks, the merge updates block mappings in the thin pool metadata to point back to the original data. This reduces I/O overhead significantly but still does not prevent write collisions—concurrent writes to blocks being remapped can result in inconsistent metadata states.
One missing diagnostic detail: What filesystem are you using on the volume? Journaling filesystems like ext4 or XFS provide better resilience to partial merges, while non-journaled filesystems are more vulnerable to corruption.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.