How to rollback F35 with BTRBK?

I have F35 running with BTRBK snapshots. I followed the guidance on: Fedora Workstation 35 with automatic btrfs snapshots and backups using BTRBK | Willi Mutschler when configuring BTRBK.
I only have snapshots. I don’t have backups on an external disk.
running sudo btrbk ls -L / will yield an output like:

How can I rollback the system to the snapshot above root.20220404T1137?

1 Like

Have to follow the guide here GitHub - digint/btrbk: Tool for creating snapshots and remote backups of btrfs subvolumes

I use BTRBK and it helped me recover for the early Beta F36 upgrade from F35. It was very fast and easy to restore. I just had problems deleting the problematic snapshot.

I was aware of this guidance, but it is a bit unclear to me. Will you be able to explain how I can rollback given my output in the question?

What I can understand is I need to run the following commands:

sudo btrbk send /btrfs_pool/_btrbk_snap/root.20220404T1137 | btrfs receive /btrfs_pool/root
Then sudo mv /btrfs_pool/root /btrfs_pool/root.broken
Then sudo btrfs subvolume snapshot /btrfs_pool/_btrbk_snap/root.20220404T1137 /btrfs_pool/root
Then sudo btrfs subvolume delete /btrfs_pool/root.broken

Is that correct?

1 Like

It always gives me a chill doing those things…

You actually have to copy the snapshot from the backup to the pool of subvolumes:
sudo btrfs --verbose send /btrfs_pool/_btrbk_snap/root.20220404T1137 | btrfs receive /btrfs_pool/
not sudo btrbk send /btrfs_pool/_btrbk_snap/root.20220404T1137 | btrfs receive /btrfs_pool/root

It will give you four items inside /btrfs_pool/: _btrbk_snap, home, root and a root.20220404T1137.

Then to rename the broken subvolume:
sudo mv --verbose /btrfs_pool/root /btrfs_pool/root.broken

Then restore the snapshot as the “new” root:
sudo btrfs --verbose subvolume snapshot /btrfs_pool/root.20220404T1137 /btrfs_pool/root

Finally try, now or at a later time, to delete the broken/not wanted one:
sudo btrfs --verbose subvolume delete /mnt/btr_pool/root.broken

Thank you for the detailed explanation.
The first command returns the output of:
ERROR: cannot open destination directory /btrfs_pool: Operation not permitted
At subvol /btrfs_pool/_btrbk_snap/root.20220404T1137

Any idea how to fix this?

Seems privilege related. Are sure you used sudo to elevate your privileges?

Is probably because of the lack of a second here:

sudo btrfs --verbose send /btrfs_pool/_btrbk_snap/root.20220404T1137 | sudo btrfs receive /btrfs_pool/