Preserving and restoring a snapshot via command line


My freedombox (pioneer with SSD, whole root fs was moved to the SSD using btfrs replace) is on and I can ssh to it but I cannot access the web interface and I cannot access any service. “snapper -c root list” says I have btrfs snapshots of May 1 and 29, June 1, 5, 9, 10, and hourly for June 11.

So I’d like to restore a snapshot from June 10, which is just before the tentative upgrade to bookworm when everything was still working. However, I have no clue how to do.

Reading the manual page of snapper, it looks like something such as “snapper rollback number” where number would be the number in the # column when doing “snapper list”. Is it ok to run that command while the system is running? Then what to do? Wait until it returns the prompt and then ask to reboot?

1 Like

This would really be helpful given the upgrade issues from Bullseye to Bookworm.

Try changing the firewall-setting mentioned here first.

Restore a snapshot using FreedomBox web interface:

  1. Goto System → Storage Snapshots → Manage Snapshots tab.
  2. Look the list of snapshots and choose the one that you think was in working shape. “timeline” shapshots are taken every hour, daily, weekly and monthly. “apt” snapshots are taken just before and after any package installation (this includes package upgrades and whole system upgrade such as from ).

Restore a snapshot from command line:

  1. Connect to FreedomBox terminal via SSH or Cockpit web interface. If your FreedomBox is connected to a monitor and keyboard, you can also login via terminal.
  2. Login as an user with ‘admin’ group and run sudo su - to get superuser privileges.
  3. Run snapper list to see the list of all snapshots to the root file system. The option -c root is implied in this case. You should see output something like this:
129  | single |       | Sun 11 Jun 2023 01:39:05 AM GMT | root | timeline | timeline    |         
134  | single |       | Mon 12 Jun 2023 02:36:21 AM GMT | root | timeline | timeline    |         
151  | pre    |       | Mon 12 Jun 2023 06:00:29 PM GMT | root | number   | apt         |         
152  | post   |   151 | Mon 12 Jun 2023 06:00:34 PM GMT | root | number   | apt         |         
157  | single |       | Tue 13 Jun 2023 12:00:00 AM GMT | root | timeline | timeline    |         

Each line is a snapshot. Notice the snapshot’s details and choose the snapshot you which to restore to. The number on the left most column is the snapshot’s identification number. Note that down.

  1. Run snapper --ambit classic rollback <snapshot_number>. Replace <snapshot_number> with the snapshot identification number you noted in the previous step.
1 Like

How can i scroll up with monitor and keyboard in command line to see older snapshots?

Now, after an attempt to restore from snapshot, my Pioneer freedombox is completely bricked…AGAIN. I guess the snapshots works as good as the automatic updates.

You may want to try following the commands discussed in this thread (see also comments below):

This solved the upgrade issues for me.