How to Mount a Storage System with Rclone and Systemd

1. Create a Systemd Mount Unit

sudo nvim /etc/systemd/system/mnt-rclone-r2crypt.mount`
[Unit]
Description=Mount for rclone r2-crypt

[Mount]
Type=rclone
What=r2-crypt:
Where=/mnt/rclone/r2crypt
Options=rw,_netdev,allow_other,args2env,vfs-cache-mode=writes,config=/home/connor/.config/rclone/rclone.conf,cache-dir=/var/rclone

[Install]
WantedBy=local-fs.target

2 Enable and Start the Service

Reload systemctl, then enable and start the configured mount unit.

sudo systemctl daemon-reload

sudo systemctl enable mnt-rclone-r2crypt.mount

sudo systemctl start mnt-rclone-r2crypt.mount

Resources