Traditional FUSE drivers like davfs2 suffer from significant performance bottlenecks: synchronous single-threaded I/O, heavy file explorer UI freezes, and latency when traversing directory trees.

Using Rclone configured with full VFS caching and managed as a Systemd template user service provides native-like speed, asynchronous directory caching, and allows mounting multiple remotes seamlessly without duplicating configurations.


1. Install Rclone

On RPM-based distributions (Fedora, RHEL):

sudo dnf install rclone -y

On Debian/Ubuntu:

sudo apt update && sudo apt install rclone -y

2. Configure WebDAV Remotes

Generate the obscured password string required by Rclone:

rclone obscure "YOUR_PASSWORD_HERE"

Create or edit ~/.config/rclone/rclone.conf with your remotes:

[service1]
type = webdav
url = https://cloud1.example.com/remote.php/dav/files/username/
vendor = nextcloud
user = username
pass = YOUR_OBSCURED_PASSWORD_STRING

[service2]
type = webdav
url = https://cloud2.example.com/remote.php/dav/files/username/
vendor = other
user = username
pass = YOUR_OBSCURED_PASSWORD_STRING

3. FUSE Configuration

To allow sandboxed applications (like Flatpak browsers) to access the mount, FUSE must permit it globally.

Add the user_allow_other directive to /etc/fuse.conf and ensure proper permissions:

sudo bash -c 'echo "user_allow_other" >> /etc/fuse.conf'
sudo chmod 644 /etc/fuse.conf

4. Prepare Mount Directories

Create the target mount paths in your home directory matching the remote names:

mkdir -p ~/service1 ~/service2

5. Create the Systemd Template Service

Using a template unit (@) prevents race conditions and manages multiple mounts dynamically.

Create the user service directory:

mkdir -p ~/.config/systemd/user/

Create ~/.config/systemd/user/rclone-mount@.service:

[Unit]
Description=Rclone Mount for %I
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount %I: %h/%I \
    --allow-other \
    --vfs-cache-mode full \
    --vfs-cache-max-age 24h \
    --vfs-cache-max-size 200G \
    --vfs-read-chunk-size 32M \
    --vfs-read-chunk-size-limit 2G \
    --buffer-size 64M \
    --dir-cache-time 72h \
    --attr-timeout 10m \
    --transfers 8 \
    --checkers 16 \
    --allow-non-empty
Restart=on-failure
RestartSec=10

[Install]
WantedBy=default.target

Key Flags Breakdown:

  • --allow-other: Grants access to the FUSE mount to processes outside the user namespace (e.g., Flatpak apps).
  • --vfs-cache-mode full: Enables full POSIX read/write compatibility for local applications.
  • --vfs-cache-max-size 200G: Limits the local disk space used for asynchronous background uploads and reads.
  • %I and %h/%I: Dynamically maps the remote name and local home directory mount path based on the instance name.
  • ExecStop is omitted to prevent race conditions with Rclone’s internal FUSE unmount routine.

6. Enable and Start the Instances

Reload the user systemd daemon, then enable and start each instance by passing the remote name after the @:

systemctl --user daemon-reload

systemctl --user enable --now rclone-mount@service1.service
systemctl --user enable --now rclone-mount@service2.service

Verify service status and file access:

systemctl --user status "rclone-mount@*"
ls -la ~/service1 ~/service2