digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.58k stars 116 forks source link

how to Rollback "/home" and "/" snapshots #553

Open Oxygenxx opened 10 months ago

Oxygenxx commented 10 months ago

I wanted to take a moment to express my deep appreciation for the remarkable tool you've created - Btrbk. It has undoubtedly revolutionized the way to manage system snapshots and backups it made my life incredibly easier...

However recently i encountered a slight hiccup related to rollback form snapshots (not backup).. I successfully created snapshots of my system with this config.

/etc/btrbk/btrbk.conf

timestamp_format        long

volume /
  snapshot_dir /btrbk_snapshots
  subvolume /
    snapshot_preserve_min   12h
    snapshot_preserve       24h
  subvolume /home
    snapshot_preserve_min   48h
    snapshot_preserve       7d

and created this directory /btrbk_snapshots

and i used this command to take snapshot sudo btrbk snapshot

now i have two snapshot present as expected /btrbk_snapshots/ROOT.20230824T0307 /btrbk_snapshots/home.20230824T0307

and output of sudo btrfs subvolume list / is

ID 256 gen 42 top level 5 path @
ID 257 gen 40 top level 5 path @home
ID 258 gen 16 top level 5 path @srv
ID 259 gen 40 top level 5 path @tmp
ID 260 gen 11 top level 5 path @.snapshots
ID 261 gen 40 top level 5 path @var_log
ID 262 gen 36 top level 5 path @var_pkg
ID 263 gen 29 top level 256 path btrbk_snapshots/ROOT.20230824T0307
ID 264 gen 30 top level 256 path btrbk_snapshots/home.20230824T0307

The main question is : How to rollback "/home" and "/" snapshot

I found myself a bit perplexed. and I've diligently reviewed the documentation, yet I'm still struggling to grasp the precise steps for performing a snapshot rollback

I'll really appreciate your willingness to help to provide me exact command or script in this situation to preform snapshot rollback

I tried my best to provide you all little information and if any left please let me know

Once again. Thank-you for this remarkable project 🙆‍♂️

TheBearodactyl commented 9 months ago

if you use the grub bootloader, you can install grub-btrfs and reload your grub config. any snapshots listed by sudo btrfs subvolume list / will be added to a new submenu as a boot option :D