digint / btrbk

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

all previous snapshots will not be list with "btrbk list" after linux recovery #490

Open XueqiangDong opened 2 years ago

XueqiangDong commented 2 years ago

Has linux on /mnt/linuxes/opensuse Has snapshots on /mnt/snapshots/opensuse/20220815T0000, 20220816T0000, 20220817T0000, 20220818T0000, 20220818T0100... Suppose met some problem of the current os and want to recovery to 20220817T0000:

Recovery form the backup snapshot sudo mv /mnt/linuxes/opensuse /mnt/linuxes/opensuse.bak sudo btrfs sub snapshot /mnt/snapshots/opensuse/20220817T0000 /mnt/linuxes/opensuse

And after reboot, after the cron job run of btrbk All the snapshots (/mnt/snapshots/opensuse/20220815T0000, 20220816T0000, 20220817T0000, 20220818T0000) will be deleted and btrbk will create the snapshot from the start of it's first run after recovery Fortunately the backup snapshots are still there and didn't be deleted

XueqiangDong commented 2 years ago

It's not "deleted", it's just that "btrbk list" command don't list the previous snapshots. If I use manual "ls /path/to/snapshots" canmand I can still find the snapshots. So I changed the title

digint commented 2 years ago

"btrbk list" shows you how the subvolumes according to the config. Still, if nothing changed in the config, i.e. no diff in /mnt/linuxes/opensuse /mnt/linuxes/opensuse{,.bak}/etc/btrbk/btrbk.conf btrbk should actually list the ones from /mnt/snapshots.

If you want to list your btrfs subvolumes, try "lsbtr -l" (as of btrbk-0.30.0 I think, I always recommend using latest version). gives useful listing especially for disaster-recovery ;-)

XueqiangDong commented 2 years ago

not sure what "lsbtr -l" is and in my opensuse it says command not found. But it's fine this strange not listing issuse happens only on openSUSE, and not found in other distros (Debian, Arch, Fedaro). I can still list the btrbk backup snapshots with "sudo btrfs sub list /xxxx" and just not list by "btrbk -c /xxx.conf list" command for openSUSE. Nothing serious there.