Increasing the number of images that you can rollback to (possible + desirable?)

Hello everyone,
A thought occurred to me.
Would it be possible to increase the amount of images that rpm-ostree creates and that I could rollback to in case something goes wrong?
If so, would this be desirable?

From ostree admin pin --help

“ostree admin pin [OPTION…] INDEX”

1 Like

I’m sorry, I don’t understand :sweat_smile:

Rpm-ostree only “remembers” the two commits, the current one you are booted into and the previous one. This is due to being base on ostree which was designed that way. So to get more than one commit to hang around you need to pin it with ostree (as sudo of course). The default commit (the one you are booted into) is index number 0 and the previous commit is index number 1. So lets say your current commit is working great and you are reluctant to lose it, you can pin it and it will be there on your system until you unpin it. If it is the current commit you want to pin (the default so 0) the command would be sudo ostree admin pin 0.

2 Likes

See Rolling back Silverblue to older release (without saved deployment)? - #3 by bkhl for the commands to re-deploy an older version of Silverblue

1 Like

Can you only pin one at a time? Will the pinned commit be one of the two remembered commits? Or will it be a third remembered one?

Multiple deployments pinned. Like:

sudo ostree admin pin 0
sudo ostree admin pin 1
sudo ostree admin pin 2

2 Likes

You can pin as many deployments as you wish.

I’m not sure about whether rpm-ostree is going to purge your latest (unpinned) rollback upon pinning a single older commit, but you can always just pin that together with your current deployment and manually un/pin anew every now and then to make sure you’re always on the safe side of things.

You can unpin deployments using --unpin like so:
sudo ostree admin pin --unpin INDEX

1 Like

This is so cool, can work towards an extremely stable system with this.

Am thinking: Don’t update for a week, and if you don’t crash or anything, pin a deployment.

Update.

Don’t update for two weeks. If you don’t crash or anything. Replace first pin with second.

Don’t update for a month. If you don’t crash or anything. Replace with new pin.

And eventually you’ll have an image that has been tested for a really long time that you can easily revert to any time.

Sure,
You could also look at btrfs snapshot and snapshot your system periodically.

1 Like