Mount Borg backups with ease

Oct 07, 2019

Borg is an excellent backup software. One of Borg’s features is mounting the backups and accessing all files in them. This is done by running borg mount with the path to the repository and the name of the archive you want to mount.

My workflow for mounting a Borg archive is typically like this:

It’s easy to see how repeatedly typing those commands can become tedious and frustrating, not to mention error prone.

So I wrote a simple Bash script to automate this task.

The solution

It works like this:

  1. It first lists all your archives.
  2. You select one by simply typing a number.
  3. The archive is mounted and your file manager pops up with it (if you are using a graphical interface).
  4. After you are done, you can just press enter and the archive will be umounted.

So from all that huge list of commands, we came to just type this:

$ borg-mount /repo/path
foobar # type the passphrase (if not exported)
8  # the archive number
  # umount when done

Cool, uh?

Downloading and running

You can find the script here. Near the top you’ll find a configuration section with the values to pass to borg mount command. You’ll probably want to change the file manager command and empty the other values before first running it.


Have comments? E-mail me.

This post was updated:

  • Nov 02, 2019: Describe new features added to the script.
  • Feb 19, 2022: Update instructions to run the script.
  • Jun 07, 2023: Add note about features in Borg.

All posts