Rclone mount as external storage for Nextcloud?

I’m trying to mount my Box.com account as storage for an instance of Nextcloud I’m running on a VPS. So far I’m having trouble.

I’ve created a mount and a cache for Box, mounted the cache and then added the mount as an “external storage” in Nextcloud. I can’t make files or directories from within Nextcloud in this current config. Here are what my settings look like:

rclone v1.42:

root@cloud:~# cat .config/rclone/rclone.conf
type = box
client_id =
client_secret =
token = {"access_token":""}

type = cache
remote = box:data
plex_url =
plex_username =
plex_password =
chunk_size = 10M
info_age =
chunk_total_size = 10G

Mount Command (UID/GID 33 and umask 0770 for Nextcloud):

/usr/bin/rclone mount \
    --allow-non-empty \
    --allow-other \
    --log-level DEBUG \
    --max-read-ahead 14G \
    --checkers 16 \
    --stats 1m \
    --uid 33 \
    --gid 33 \
    --umask 007 \
    --syslog \
    $RCLONEREMOTE /media/data &

I have /media/data added as external storage using the “local” type in Nextcloud. I can’t add files or directories from within Nextcloud. I’m not seeing any relevant errors in the logs.

Is anyone else doing this? Does anyone have some suggestions for settings?

try vfs-cache feature not cache-feature.
I go direkt through the mount.

mount command looks good so far.
In my opinion checkers and max-read-ahead is not necessary. Why you try this options?

Thank you for following up. Turns out this was an app armor issue and wasn’t related to the mount.

I am still using the cache though I did also test this with VFS cache. They both worked. VFS cache may have been faster. I’m curious why you prefer vfs-cache feature over cache-feature?

I removed max-read-ahead and checkers. These were simply carried over from my Plex mount command.

VFS cache works faster in my case (Nextcloud / Emby)

Thanks, I’ve switched to --vfs-cache-mode full and I agree that it’s faster.

I notice that changes from the mount are reflected immediately in the remote, but changes from the remote are not reflected immediately in the mount. What setting could I change to fix this? I would prefer if changes on the remote were reflected on the mount within 5 minutes.

use “write” Mode. Otherwise rclone copy files to read locally first.
You got little read-speedup with big files.

Even with --vfs-cache-mode writes, I’m still not seeing changes reflected on the mount.

For example, if I make a change on Box.com (add a folder or file) that change is not reflected on the mount. I can see those files using lsd but not on the mount.

The box.com backend doesn’t implment changes (maybe it could I’m not sure) so you’ll have to wait for the --dir-cache-time to expire to see new entries.

1 Like

Thank you! This was the relevant setting. For some reason I assumed this had a default of 5 minutes and never considered adding it to my mount command. It’s working now.

1 Like

@ncw I’m curious if you would suggest using --vfs-cache-mode or rclone cache for this purpose?

I’d probably try it without the cache first and see what the performance was like.

No cache at all or vfs cache first? Without the cache, how would Nextcloud write files to Box?

Sorry I wasn’t quite clear.

If nextcloud works without --vfs-cache-mode writes then try that. It may not in which case you’ll need --vfs-cache-mode writes.

I’d try that setup first before seeing whether you need the cache backend. If you needed --vfs-cache-mode writes in the first step, then you’ll need it with the cache backend too.