Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request : BTRBK + grub-btrfs - Restore the snapshot currently booted - like Timeshift #580

Open
matleborgne opened this issue Jan 14, 2024 · 0 comments

Comments

@matleborgne
Copy link

matleborgne commented Jan 14, 2024

Usecase description

When using grub-btrfs in addition to BTRBK, it is possible to boot on a selected snapshot in grub.

To restore a snapshot, it is then mandatory :

  • either to manually select it by name or entry,
  • or to select the last one by ID or with btrbk ls / command.

It is not possible to "automatically" select the current snapshot mounted on "/" to restore it.

Current workaround

My workaround is the following :

  • when creating the snapshot : doing first a btrbk dryrun to get the snapshot name and logging it in /etc/btrbk/last_snapshot.log ; then doing the btrbk run to actually create the snapshot with his own name "embedded" in it,
  • when restoring the snapshot : reading the value from /etc/btrbk/last_snapshot.log as the entry.

This works as intended, because the /etc/btrbk/last_snapshot.log in the snapshot is the one just before the snapshot was actually made (overwritten with each snapshot).

However, this is not a "clean way" to do it, as I have to set "timestamp_format short" to avoid logging a wrong name, and not lauching the full command near to midnight as it could as well logging a wrong name.

Precision : Neither blkid, lsblk, mount or findmnt -like commands seems to be able to know we booted on a btrfs snapshot, which seems strange (but I'm not a btrfs expert). This is why I let down the idea of getting the current booted snapshot name during the restoring phase.

EDIT : I found another workaround using dmesg boot logs, which has to be done from the snapshot itself.

dmesg | grep "Command line"
@matleborgne matleborgne changed the title Feature request : BTRBK + grub-btrfs - Restore the current snapshot - like Timeshift Feature request : BTRBK + grub-btrfs - Restore the snapshot currently booted - like Timeshift Jan 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant