Rclone, mounting and samba

Hi There.

I’ve been doing some testing trying to mount cloud storage with rclone and in turn share that out via samba. I have managed to get this working, but I am finding an issue with changes flowing in both directions.

An example. I mounted a NextCloud webdav share with rclone, and shared that mount with samba. Changes made on the local file system or through samba share would be reflected immediately in the Nextcloud web console. But, changes made in the web console (like deleting a folder) would not be reflected in the local file system or the samba share.

As another test I tried doing the same thing but mounted the same webdav share with fuse davfs2 instead - everything worked perfectly! Changes made anywhere would be reflected everywhere immediately.

I tried mucking around with all of the different caching options. I’ve also tried the suggestions in here: Cache Mount Samba Share Issue?
I’ve also experimented with different backends, OD and OD4B and found similar behaviour.

Using latest stable version of rclone, v1.44, and found the same thing on Ubuntu 18.10 and Alpine 3.8.1

Does anyone have any suggestions? Happy to send configuration files, logs etc, but I’d have to set this up again. Thought I’d check beforehand in case it’s something simple I missed.

Thanks in advance


Nextcloud doens’t have a notification system for file changes (or if it does rclone isn’t using it). You’ll need to use this to control the time that the changes take to show in the mount

   --dir-cache-time duration            Time to cache directory entries for. (default 5m0s)

I suspect davfs2 is using a shorter directory cache time by default. Since the server is local you might as well set the --dir-cache-time quite small, say 5s.

Thanks for that, I set --dir-cache-time to 5s and it worked!

1 Like

I realise this is an old thread, but how did you get samba and rclone working? is it still working for you? could you perhaps share your .rclone.conf and smb.conf files with me perhaps? what does your rclone mount command look like?

I am having issues with samba aborting the connection when accessing the rclount mount with it.

Hi, sorry I’ve been away for a while.

I’ve lost the config I’m afraid, I just did this on a disposable VM. I can tell you I try to use as few configuration options in smb.conf as possible, something like this:

path = /path/to/share
writable = yes
valid users = username

That’s it - don’t set every possible variable the way everyone on the internet tell you to.

Try and do the following:

  • set permissions on the folder you mount on to what they need to be
  • mount your rclone provider/folder
  • do an ls -l on your mount point and see what the permissions look like now

If they have changed after the mount you can try one (or both :-\ ) of two things

  1. set the directory mask as an rclone argument (see rclone help for options and syntax)
  2. set the mask in smb.conf (see example below)

path = /path/to/share
writable = yes
valid users = username
force group = group
directory mask = 0770

Sorry I can’t remember what I did as it was a while ago, but see if that helps.

Thanks for the reply I will have a go with that, much appreciated!