borg
borg copied to clipboard
borgfs mount via /etc/fstab - how to give the passphrase?
(from IRC, iirc)
Not a direct solution for the issue, but I had the same problem and found a workaround that works for me:
I created a systemd mount unit in /etc/systemd/system/
. The filename must match the mount path, best generate it with systemd-escape --suffix mount --path <full path>
.
[Mount]
Type=fuse.borgfs
What=<user>@<host>:<path to backup>
Where=<local mount path>
Options=noauto,user,uid=<my uid>,gid=<my gid>,allow_other
Environment=BORG_PASSCOMMAND='cat <path to secret>' BORG_RSH='ssh -i <path to ssh key>'
With that, I was able to mount the backup without giving the passphrase: sudo systemctl start <mount unit>
. This still requires a sudo password. But by adding a systemd automount unit, I just need to access the mountpoint!
Use the same base name in /etc/systemd/system/
, but with .automount
extension.
[Automount]
Where=<local mount path>
TimeoutIdleSec=120
Needs to be activated with systemctl daemon-reload
, systemd start <automount unit>
.