Rclone mount - Don't delete VFS cache

What is the problem you are having with rclone?

Rclone mount deletes previous vfs cache. How can I keep it?

The mount, drive, folder structure, everything is same

What is your rclone version (output from rclone version)

rclone v1.51.0
os/arch: linux/amd64
go version: go1.13.7

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

Google drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone mount td:/Data /home/pog/data --vfs-cache-mode full --vfs-cache-max-age 24h --read-only -vv

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

2020/04/12 16:23:58 DEBUG : rclone: Version "v1.47.0" starting with parameters ["rclone" "mount" "td:/Data" "/home/pog/data" "--vfs-cache-mode" "full" "--vfs-cache-max-age" "24h" "--read-only" "-vv" "--log-file=rclone.log"]
2020/04/12 16:23:58 DEBUG : Using config file from "/home/pog/.config/rclone/rclone.conf"
2020/04/12 16:23:59 DEBUG : Google drive root 'Data': Mounting on "/home/pog/data"
2020/04/12 16:23:59 DEBUG : vfs cache root is "/home/pog/.cache/rclone/vfs/td/Data"
2020/04/12 16:23:59 DEBUG : Adding path "vfs/forget" to remote control registry
2020/04/12 16:23:59 DEBUG : Adding path "vfs/refresh" to remote control registry
2020/04/12 16:23:59 DEBUG : Adding path "vfs/poll-interval" to remote control registry
2020/04/12 16:23:59 DEBUG : : Root:
2020/04/12 16:23:59 DEBUG : : >Root: node=/, err=
2020/04/12 16:23:59 DEBUG : Private/a.txt: updateTime: setting atime to 2020-02-21 13:45:13.527 +0200 EET
2020/04/12 16:23:59 INFO : Private/a.txt: Removed from cache
2020/04/12 16:23:59 DEBUG : Private: Removed empty directory
2020/04/12 16:23:59 DEBUG : : Removed empty directory
2020/04/12 16:23:59 INFO : Cleaned the cache: objects 0 (was 0), total size 476 (was 0)
2020/04/12 16:24:04 DEBUG : /: Attr:
2020/04/12 16:24:04 DEBUG : /: >Attr: attr=valid=1s ino=0 size=0 mode=drwxr-xr-x, err=

The vfs cache currently isn't persistent. After restart if you run a scan (via rc or an OS find command) it will be repopulated.

By repopulated, do you mean it'll get downloaded again?

I tried saving it in a different location and moving it back after mounting, but rclone immediately deletes anything moved into the vfs cache folder. Shouldn't the delete operations be limited by --vfs-cache-max-age 24h?

Vfs structure is stored in memory. It isn't stored currently in that directory. That directory is there to support vfs writes.

So if you rerun a find when you mount it, it'll recache the structure in memory again.

Sorry, I meant the folder at ~/.cache/rclone/vfs

Isn't that where the files are actually stored? I'm not talking about the structure, but rather the files themselves. They get deleted from the local storage and I can't find them anywhere.

That folder is used to support actions to make a file system work like a regular filesystem (reads and writes) it doesn't act like a file cache. For a file cache you need to look at the cache remote.

But --vfs-cache-mode full is supposed to completely download the files and that's where they get stored?

Yes but it's not persistent.

That is correct. To work this relies on setting access times on the files in the VFS cache and some file systems don't like access times so on restart rclone ends up deleting some or all of the cached files :frowning:

Which filesystem are you storing the vfs cache data on?

I'm reworking the vfs layer as we speak so --vfs-cache-mode full will work properly like this (and also cache partially downloaded files and serve files immediately before downloading them all).

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