What happens if a BTRFS snapshot is taken while dnf is updating the system?

I am making a small script and a systemd timer associated to it in order to run snapper once per day instead of hourly. However, it got to me that if dnf is running, wouldn’t taking a snapshot leave that snapshot in an inconsistent (somewhat broken) state?

1 Like

It will be a snapshot of the filesystem at that point in time. So if the system is inconsistent at that time, the snapshot will be too.

With snapper, you might as well let it run hourly and then use snapper’s cleanup to retain only one per day. There is very little downside to multiple snapshots when the snapshots a recent.

I find it annoying to take a snapshot every hour, my sub-volume list was overflowing with hourly snapshots.

I think then it would be better to avoid taking a snapshot while dnf is running to avoid a snapshot with broken package managment.

1 Like