Rclone mount exported over nfs (bug?)

What is the problem you are having with rclone?

I am exporting two directories over NFS on a linux server: a regular one on the filesystem (/mnt/B) , the second (/mnt/A) mounted from a Google drive (see rclone config below):

/mnt/folder1 *(rw,sync,no_subtree_check,fsid=4,insecure) [this is the google drive rclone mount]
/mnt/folder2 *(rw,sync,no_subtree_check,fsid=6,insecure) [regular directory on filesystem]

Problem:

  • When i create/copy/any file modification on the rclone mounted directory on the nfs server (server A), the file doesn't appear on the exported mount (on a different remote server with access to the nfs share, lets call it server B) when running ls -l DIRECTORY, unless I "touch" the directory where the file was created on server A. Touching the directory on server B also resolves the issue.

  • The same approach (creating/copying a file on server A and reading it on server B) for a non-rclone mounted directory is not a problem.

-Creating/copying a file on server B on the exported NFS mount of the rclone mount is also not a problem; files appear immediately.

Now, the strange part: Although the file doesn't appear when running a ls -l on the directory, the file is visible when running a ls -l FILENAME from server B!

I found this old post related to a old NovelL fs (NFS: client does not see new files created on server (caching?) - Server Fault), and I am wondering if rclone mount doesnt "mess" with the ctime/mtime parameters of the directory, and the nfs client gets confused.

Thanks for your help

Run the command 'rclone version' and share the full output of the command.

rclone v1.61.1

  • os/version: debian 11.6 (64 bit)
  • os/kernel: 5.15.64-1-pve (x86_64)

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The rclone config contents with secrets removed.

rclone mount --drive-impersonate admin@xxx --config=/root/.config/rclone/rclone_VFS.conf GdriveBackups: /var/lib/vz/GDriveBackup --allow-other --allow-non-empty --vfs-cache-mode writes --cache-dir /mnt/storage1tb/rclone_cache --drive-use-trash=false

[GdriveBackups]
type = drive
scope = drive
service_account_file = /root/gdrivejson.json
team_drive =

see rclone-nfs-server for a working setup

supervisor.conf for rclone mount
Dockerfile for /etc/exports

Thanks @footlooseboss This setup is the same as mine/has nothing special; the issue is not with the nfs server..

ah ok thought it might be fsid=0

please update thread if you solve it :love_you_gesture:t2:

Rclone doesn't change the mtime of the directory when its contents are changed. Not many of the backends would support setting the time on a directory anyway, but rclone could update a pretend time of the directory. This might confuse things as when the directory fell out the directory cache, it would revert back to whatever time it had before.

I know that people have had success exporting rclone mounts with NFS before so I wonder if there is some NFS setting you can use to overcome this?

Thanks Nick, I think this clarifies it. NFS exports of rclone mounts is working, no major concerns here.
It is just that unless I patch the NFS client side, I think I'll have to resort to touch rclone mounted directories on the server side when downloading/copying files on them, in orde for files to appear on the NFS client side.
It is is workable, as when working on the client side, no issues when downloading/copying/modifying files.

It would be a relatively simple patch to update the mtime of the directory when it is modified which would probably fix your problem.

However as I said above, I can't easily propagate this to the backing store so it may cause different problems when the directory drops out of the cache and is reloaded with a different mtime.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.