LVM Root Snapshot Rollback on CentOS: Where the Recovery Boundary Ends
0 reputation · 23 Jun 2021, 12:32 UTC
0 reputation · 23 Jun 2021, 12:32 UTC
The intended design uses a pre-upgrade LVM snapshot of the root LV as the rollback path for a failed dnf upgrade on CentOS, with / on LVM and adequate free space in the VG or thin pool. The unresolved point is where that recovery boundary ends.
A root LV snapshot captures only that volume. /boot is usually a separate non-LVM partition, the EFI system partition and firmware boot entries are never included, and changes made after the snapshot — configuration management runs, databases, application state — survive the rollback. A kernel and initramfs installed during the failed upgrade can remain in /boot newer than the restored userspace.
Thick and thin snapshots also diverge: merging a thick snapshot into its origin differs from promoting a thin snapshot, and dnf history undo reverses package transactions rather than filesystem state. Release context matters too, since CentOS Linux 7 and 8 are past end of life and Stream's rolling model changes what an upgrade pulls in.
Because CentOS installations typically place /boot on a separate non-LVM partition, a snapshot of the root LV does not revert the state of the boot environment. This creates a critical gap during a failed dnf upgrade rollback: the userspace is restored to a previous state, but the bootloader and kernel files remain in the upgraded state.
When a dnf upgrade installs a new kernel and initramfs, these files are written to /boot. If you roll back the root LV, you restore older binaries and libraries, but /boot still contains the newer kernel. If the system boots into the newer kernel, it will likely fail to load modules because the directory /lib/modules/$(uname -r) in the restored root LV will not match the running kernel version.
Recommendation: You must return the default boot entry to the pre-upgrade kernel version before or immediately after the root LV rollback to ensure the kernel matches the restored userspace.
The recovery path depends on the LVM snapshot type:
lvconvert --merge. This process copies changed blocks back to the origin and can be time-consuming depending on the volume of changes.The following elements are outside the recovery boundary and will not be reverted:
/var, /home, or database volumes are on separate LVs, their state persists.Diagnostic Requirement: To provide a more specific recovery sequence, please confirm if /boot is on a separate partition or integrated into the LVM volume group.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.