Mount the repo locally

You need to have a Host spica setup in ~/.ssh/config for this to work. No need for root access, but the key must be added just like adding a key for a client machine

  • First, we need the repo key and passphrase:
    • The passphrase and the key should already stand in the client in /root/borg-stuff/${REPO}.passphrase and $REPO.key. If the passphrase is not there, we have bigger problems: backups might not actually happen, as it needs the passphrase to run. To export the key:
      • skwotfarm:~ # borg key export spica:skwotfarm-rootfs /root/borg-stuff/skwotfarm-rootfs-key
  • Then we must download it localy (use scp or rsync).
  • Then we must import it in our local borg config:
    • local-computer:~ $ SRV='skwotfarm'
    • local-computer:~ $ REPO='skwotfarm-rootfs'
    • local-computer:~ $ borg key import spica:/home/borgy/repos/${SRV}/${REPO} borgbackup-${REPO}.key
  • We need to access the files with root privileges (as backed up files have their own perms), so we must tell fuse to allow that:
    • in /etc/fuse.conf, uncomment user_allow_other
  • Mount the backup:
    • $ mkdir /tmp/borg-mountpoint
    • $ BORG_PASSCOMMAND="cat /path/to/${REPO}.passphrase" borg mount -o allow_root spica:/home/borgy/repos/${SRV}/${REPO} /tmp/borg-mountpoint
      • Mounting the whole repository is resource intensive, using '--last 1' makes it much lighter. There are other filtering options, see man borg-mount

Browse mounted repo

To use a graphical tool to browse files, one can do:

  • $ xhost si:localuser:root
  • $ sudo nautilus # or whatever software you wanna use
  • $ xhost -si:localuser:root

Unmount the repo

  • $ borg umount /tmp/borg-mountpoint