Sapper/btrbk send receive snapshots to external storage

HI,
I’m new to OpenSuse, but coming from Arch linux.

Snapper and btrfs is new to me as well, I have search high and low to try and figure out how to send receive snapshots to an external drive and how to use it in a disaster recovery.

  • is there a way to use snapper to send/receive? I cannot find it in the man pages and there are little to non good tutorials online?

  • I found btrbk which says it can do i t, but i’m having problems understanding how to set it up?

I tried the “master” version of btrbk but there is now example under /etc/btrbk.conf /etc/btrbk/btrbk.conf
and it des not seem to be installed after doing this:

wget https://raw.githubusercontent.com/digint/btrbk/master/btrbk
chmod +x btrbk
sudo ./btrbk ls / 
  • Do I have to install it from the source.tarball?
  • Anyone mind educating a newbie on this?
  • How would you go about using it as a Disaster recovery? especially when using full disk encryption?

I know btrfs have send/receive but there is very little info about how to use it and how to automate it.

The best I’ve found is this link below, but it’s not very good or complete either.
https://forums.opensuse.org/t/backup-restore-btrfs-howto-restore-snapper-snapshots-after-disaster-recovery-btrfs-send-receive/110958

On infamous host erlangen backups of /home to an external SSD use the following:

erlangen:~ # cat /etc/btrbk/btrbk-Crucial.conf 
snapshot_dir               /Btrbk/btrbk_snapshots/Crucial
target                     /Crucial/btrbk_snapshots/
subvolume                  /home
erlangen:~ # 
erlangen:~ # systemctl cat btrbk-Crucial.service 
# /etc/systemd/system/btrbk-Crucial.service
[Unit]
Description=btrbk backup of /home to SSD
Documentation=man:btrbk(1)

[Service]
Type=oneshot
ExecStart=/usr/bin/btrbk --config=/etc/btrbk/btrbk-Crucial.conf run

# /etc/systemd/system/service.d/toplevel-override.conf
[Unit]
OnFailure=failure-notification@%n
erlangen:~ # 
erlangen:~ # grep -e /Btrbk -e /Crucial /etc/fstab
UUID=0e58bbe5-eff7-4884-bb5d-a0aac3d8a344  /Btrbk                  btrfs  subvolid=5,noauto             0  0
UUID=47e6d9ee-e910-4ea4-8c8f-7ac75f49a4d3  /Crucial                btrfs  subvolid=5,noauto             0  0
erlangen:~ # 
erlangen:~ # findmnt /Btrbk 
TARGET SOURCE    FSTYPE OPTIONS
/Btrbk systemd-1 autofs rw,relatime,fd=56,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=24783
erlangen:~ # 

erlangen:~ # findmnt /Crucial
TARGET   SOURCE    FSTYPE OPTIONS
/Crucial systemd-1 autofs rw,relatime,fd=57,pgrp=1,timeout=60,minproto=5,maxproto=5,direct,pipe_ino=24786
erlangen:~ # 
erlangen:~ # journalctl -b -u btrbk-Crucial.service 
Oct 11 06:50:07 erlangen systemd[1]: Starting btrbk backup of /home to SSD...
Oct 11 06:50:22 erlangen btrbk[14312]: --------------------------------------------------------------------------------
Oct 11 06:50:22 erlangen btrbk[14312]: Backup Summary (btrbk command line client, version 0.32.6)
Oct 11 06:50:22 erlangen btrbk[14312]:     Date:   Wed Oct 11 06:50:07 2023
Oct 11 06:50:22 erlangen btrbk[14312]:     Config: /etc/btrbk/btrbk-Crucial.conf
Oct 11 06:50:22 erlangen btrbk[14312]: Legend:
Oct 11 06:50:22 erlangen btrbk[14312]:     ===  up-to-date subvolume (source snapshot)
Oct 11 06:50:22 erlangen btrbk[14312]:     +++  created subvolume (source snapshot)
Oct 11 06:50:22 erlangen btrbk[14312]:     ---  deleted subvolume
Oct 11 06:50:22 erlangen btrbk[14312]:     ***  received subvolume (non-incremental)
Oct 11 06:50:22 erlangen btrbk[14312]:     >>>  received subvolume (incremental)
Oct 11 06:50:22 erlangen btrbk[14312]: --------------------------------------------------------------------------------
Oct 11 06:50:22 erlangen btrbk[14312]: /home
Oct 11 06:50:22 erlangen btrbk[14312]: +++ /Btrbk/btrbk_snapshots/Crucial/home.20231011T0650
Oct 11 06:50:22 erlangen btrbk[14312]: >>> /Crucial/btrbk_snapshots/home.20231011T0650
Oct 11 06:50:22 erlangen systemd[1]: btrbk-Crucial.service: Deactivated successfully.
Oct 11 06:50:22 erlangen systemd[1]: Finished btrbk backup of /home to SSD.
Oct 11 06:50:22 erlangen systemd[1]: btrbk-Crucial.service: Consumed 4.860s CPU time.
erlangen:~ # 
erlangen:~ # zypper if btrbk
Loading repository data...
Reading installed packages...


Information for package btrbk:
------------------------------
Repository     : Branch project for package btrbk (openSUSE_Tumbleweed)
Name           : btrbk
Version        : 0.32.6-5.10
Arch           : noarch
Vendor         : obs://build.opensuse.org/home:eyecreate
Installed Size : 403.8 KiB
Installed      : Yes
Status         : up-to-date
Source package : btrbk-0.32.6-5.10.src
Upstream URL   : https://github.com/digint/btrbk
Summary        : Backup Tool using snapshots of btrfs
Description    : 
    Backup Tool using snaphosts of btrfs with backup rotations and remote backups using ssh.

erlangen:~ #