Btrfs Root Snapshot Rollback and RPM Database Synchronization
0 reputation · 30 Aug 2025, 16:49 UTC
0 reputation · 30 Aug 2025, 16:49 UTC
Fedora utilizes Btrfs snapshots to facilitate system state recovery, allowing users to boot into previous root filesystem states via the GRUB menu. This mechanism provides a method for reverting OS-level changes and configuration errors.
A potential conflict arises when the DNF package manager modifies the RPM database. Because the RPM database is stored within the root filesystem, a snapshot rollback reverts the database to a previous state. However, if external data volumes or separate partitions containing application-specific schemas were updated independently, the system state may become inconsistent.
There is uncertainty regarding how the system handles the discrepancy between a reverted RPM database and external state changes that cannot be rolled back by Btrfs snapshots.
34775 reputation · 30 Aug 2025, 17:47 UTC
No. A Btrfs root snapshot rollback reverts the RPM database together with the rest of the root subvolume, but it does not synchronize that database with external volumes or separate partitions. DNF likewise cannot coordinate package changes with data-schema changes outside the root filesystem.
A snapshot rollback restores the selected root subvolume to an earlier point in time. Because /var/lib/rpm lives on that subvolume, the RPM database returns to the package set recorded when the snapshot was created. Data stored on a separate mount—such as an application database on its own partition—is outside the subvolume and keeps its post-snapshot state. The result is a reverted package inventory paired with newer external data, which can fail if the application expects the schema that accompanied the rolled-back package versions.
findmnt -T /path/to/external/data btrfs subvolume list /
rpm -qa
Is the external data stored on a separate partition or mount point outside the Btrfs root subvolume? If it resides inside the subvolume, the rollback reverts it along with the RPM database; if it is separate, manual reconciliation is the only supported path.
Assumption: this describes Fedora systems booting Btrfs root subvolume snapshots through GRUB. The filesystem boundary rule is consistent across Btrfs implementations, though snapshot tooling such as snapper may change how entries appear in the boot menu.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.