Skip to main content

Rclone and Mergerfs mount

Please Note This guide is written by a community member, support for this will solely be via our discord community

For users asking for a way to add Dropbox via systemd --user and MergerFS here is a howto.

First you need to have a dropbox.service file. You can use this one that is up to date with Dropbox

The below service file needs to be placed here : /home/USER/.config/systemd/user

Read more on how to start a systemd service here : https://docs.hostingby.design/application-hosting/guides/systemd

Remember to change stuff to your needs. Like : Environment ExecStart --cache-dir ExecStop ExecStartPre <-- Not at 'must have'

[Unit]
Description=RClone VFS Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/home/USER/.config/rclone/rclone.conf
KillMode=none
RestartSec=5
ExecStart=/usr/bin/rclone mount dropbox-crypt:drive1/ /home/USER/media/shared-drives/drive-01 \
# This is for allowing users other than the user running rclone access to the mount
--allow-other \
# Log level Use: DEBUG
--log-level INFO \
# log file
--log-file /home/USER/.config/rclone/rclone-dropbox-shared-data-01.log \
# This is setting the file permission on the mount to user and group have the same access and other can read
--umask 002 \
# User
--uid 1378 \
--gid 1378 \
# The local disk used for caching
--cache-dir=/home/USER/.cache/dropbox-01 \
# This is used for caching files to local disk for streaming OLD - full
--vfs-cache-mode writes \
# TPS LIMIT
--tpslimit 10 \
--bwlimit 80M:80M \
# VFS
--vfs-refresh
#MOUNTS
ExecStop=/bin/fusermount3 -uz /home/USER/media/shared-drives/drive-01
ExecStartPre=/bin/sleep 5
Restart=on-failure

[Install]
WantedBy=default.target

Next you need a MergerFS service file: The below service file needs to be placed here : /home/USER/.config/systemd/user

Remember to change stuff to your needs.

You can use this :

[Unit]
Description = MergerFS Mount
After=rclone.service
RequiresMountsFor=/home/USER/media/shared-drives/drive-01

[Service]
Type=forking

ExecStart=/usr/bin/mergerfs /home/USER/media/local:/home/USER/media/shared-drives/drive-01 /home/USER/media/merged -o rw,use_ino,allow_other,func.getattr=newest,category.action=all,category.create=ff,cache.files=auto-full
ExecStop=/bin/fusermount3 -uz /home/USER/media/merged
Restart=on-failure

[Install]
WantedBy=default.target