Hi guys!
I'm trying to facilitate this workflow:
- browse mounted network drive to find some project
- drag a local copy of it to my SSD
- edit local copy
- drag local copy back to network drive (overwriting original)
To move files between local / network drives I'll simply drag and drop using file explorer. No syncing or remote editing required. I'm a simple man.
Problem
Browsing the mounted network drive is slow, sometimes making my system unresponsive.
I learned from @thestigma in this answer that I can pre-cache the directory tree after mounting to speed things up. However, in my implementation (below) I'm not sure anything is actually being cached as browsing remains slow and --cache-dir
is always empty.
Network
60 Mbps download / 18 Mbps upload.
Version
rclone v1.59.1
- os/version: Microsoft Windows 10 Home 21H2 (64 bit)
- os/kernel: 10.0.19044.2130 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.18.5
- go/linking: static
- go/tags: cmount
winfsp-1.11.22176
Cloud Provider
Wasabi
Config
[wasabi]
type = s3
provider = Wasabi
env_auth = false
access_key_id = XXXXXX...
secret_access_key = XXXXXX...
region = eu-west-1
endpoint = s3.eu-west-1.wasabisys.com
location_constraint =
acl = private
Startup Script (.bat)
I'm trying to mount the network drive and then pre-cache the directory tree.
@echo off
:: Set variables.
set driveletter=W
set remotename=wasabi
set port=5572
title %remotename%-boot
cd D:\Prizi\Downloads\media\applications\rclone-v1.59.1-windows-amd64
:: Mount network drive.
echo Mounting %driveletter%:
start /min "%remotename%" rclone mount %remotename%: %driveletter%: ^
-vv ^
--rc ^
--rc-addr localhost:%port% ^
--rc-user test ^
--rc-pass test ^
--cache-dir "%cd%\vfs-cache" ^
--vfs-cache-mode writes ^
--vfs-cache-max-age 8760h ^
--vfs-cache-max-size 1024G ^
--attr-timeout 8700h ^
--dir-cache-time 8760h ^
--multi-thread-streams 0
:: Check if mount successful.
echo Checking if %driveletter%: is ready.
:LOOP1
vol %driveletter%: >nul 2>nul
if errorlevel 1 (
echo " "| set /p dummyName=.
timeout /t 1 > nul
goto LOOP1
) else (
echo %driveletter%: is ready to use!
)
:: Pre-cache the full directory tree.
echo Refreshing cache. This may take a few minutes.
rclone rc vfs/refresh -vv recursive=true --rc-addr localhost:%port% --rc-user test --rc-pass test > nul
:: If exit code is non-zero (error) pause for diagnosis.
if not %ERRORLEVEL% equ 0 (
echo Pre-cache failed. Is the mount still running? press any key to continue.
pause
) else (
echo Pre-cache for %driveletter%: OK!
)
:: Keep the window open.
cmd /k
Output Log (Window 01)
Mounting W:
Checking if W: is ready.
.W: is ready to use!
Refreshing cache. This may take a few minutes.
2022/10/30 17:14:58 DEBUG : rclone: Version "v1.59.1" starting with parameters ["rclone" "rc" "vfs/refresh" "-vv" "recursive=true" "--rc-addr" "localhost:5572" "--rc-user" "test" "--rc-pass" "test"]
2022/10/30 17:15:00 DEBUG : 4 go routines active
Precache for W: OK!
D:\Prizi\Downloads\media\applications\rclone-v1.59.1-windows-amd64>
Output Log (Window 02)
2022/10/30 17:14:57 DEBUG : rclone: Version "v1.59.1" starting with parameters ["rclone" "mount" "wasabi:" "W:" "-vv" "--rc" "--rc-addr" "localhost:5572" "--rc-user" "test" "--rc-pass" "test" "--cache-dir" "D:\\Prizi\\Downloads\\media\\applications\\rclone-v1.59.1-windows-amd64\\vfs-cache" "--vfs-cache-mode" "writes" "--vfs-cache-max-age" "8760h" "--vfs-cache-max-size" "1024G" "--attr-timeout" "8700h" "--dir-cache-time" "8760h" "--multi-thread-streams" "0"]
2022/10/30 17:14:57 INFO : Using --user test --pass XXXX as authenticated user
2022/10/30 17:14:57 NOTICE: Serving remote control on http://localhost:5572/
2022/10/30 17:14:57 DEBUG : Creating backend with remote "wasabi:"
2022/10/30 17:14:57 DEBUG : Using config file from "C:\\Users\\Prizi\\AppData\\Roaming\\rclone\\rclone.conf"
2022/10/30 17:14:57 INFO : S3 root: poll-interval is not supported by this remote
2022/10/30 17:14:57 DEBUG : vfs cache: root is "D:\\Prizi\\Downloads\\media\\applications\\rclone-v1.59.1-windows-amd64\\vfs-cache"
2022/10/30 17:14:57 DEBUG : vfs cache: data root is "\\\\?\\D:\\Prizi\\Downloads\\media\\applications\\rclone-v1.59.1-windows-amd64\\vfs-cache\\vfs\\wasabi"
2022/10/30 17:14:57 DEBUG : vfs cache: metadata root is "\\\\?\\D:\\Prizi\\Downloads\\media\\applications\\rclone-v1.59.1-windows-amd64\\vfs-cache\\vfsMeta\\wasabi"
2022/10/30 17:14:57 DEBUG : Creating backend with remote "D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfs/wasabi/"
2022/10/30 17:14:57 DEBUG : fs cache: renaming cache item "D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfs/wasabi/" to be canonical "//?/D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfs/wasabi/"
2022/10/30 17:14:57 DEBUG : Creating backend with remote "D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfsMeta/wasabi/"
2022/10/30 17:14:57 DEBUG : fs cache: renaming cache item "D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfsMeta/wasabi/" to be canonical "//?/D:/Prizi/Downloads/media/applications/rclone-v1.59.1-windows-amd64/vfs-cache/vfsMeta/wasabi/"
2022/10/30 17:14:57 DEBUG : Network mode mounting is disabled
2022/10/30 17:14:57 DEBUG : Mounting on "W:" ("wasabi")
2022/10/30 17:14:57 DEBUG : S3 root: Mounting with options: ["-o" "attr_timeout=3.132e+07" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=wasabi"]
2022/10/30 17:14:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:14:57 DEBUG : S3 root: Init:
2022/10/30 17:14:57 DEBUG : S3 root: >Init:
2022/10/30 17:14:57 DEBUG : /: Statfs:
2022/10/30 17:14:57 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Readlink:
2022/10/30 17:14:57 DEBUG : /: >Readlink: linkPath="", errc=-40
2022/10/30 17:14:57 DEBUG : /: Getxattr: name="non-existant-a11ec902d22f4ec49003af15282d3b00"
2022/10/30 17:14:57 DEBUG : /: >Getxattr: errc=-40, value=""
The service rclone has been started.
2022/10/30 17:14:57 DEBUG : /: Statfs:
2022/10/30 17:14:57 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Opendir:
2022/10/30 17:14:57 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:14:57 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:14:57 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:14:57 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Opendir:
2022/10/30 17:14:57 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:14:57 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:14:57 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:14:57 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:14:57 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:57 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:57 DEBUG : /: Opendir:
2022/10/30 17:14:57 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:14:57 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:14:57 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:14:57 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:14:57 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:14:58 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:58 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:58 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:14:58 DEBUG : /: >Getattr: errc=0
2022/10/30 17:14:58 DEBUG : /: Opendir:
2022/10/30 17:14:58 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:14:58 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:14:58 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:14:58 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:14:58 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:14:58 DEBUG : rc: "vfs/refresh": with parameters map[recursive:true]
2022/10/30 17:14:58 DEBUG : : Reading directory tree
2022/10/30 17:15:00 DEBUG : : Reading directory tree done in 2.076883s
2022/10/30 17:15:00 DEBUG : rc: "vfs/refresh": reply map[result:map[:OK]]: <nil>
2022/10/30 17:15:00 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/30 17:15:00 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/30 17:15:00 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Opendir:
2022/10/30 17:15:00 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:15:00 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:15:00 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:15:00 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:15:00 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:15:00 DEBUG : /AutoRun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /AutoRun.inf: >Getattr: errc=-2
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Opendir:
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:15:00 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:15:00 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:15:00 DEBUG : /: Opendir:
2022/10/30 17:15:00 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:15:00 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:15:00 DEBUG : /: >Opendir: errc=0, fh=0x1
2022/10/30 17:15:00 DEBUG : /: Statfs:
2022/10/30 17:15:00 DEBUG : /: Releasedir: fh=0x1
2022/10/30 17:15:00 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:15:00 DEBUG : /: >Statfs: stat={Bsize:4096 Frsize:4096 Blocks:274877906944 Bfree:274877906944 Bavail:274877906944 Files:1000000000 Ffree:1000000000 Favail:0 Fsid:0 Flag:0 Namemax:255}, errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Releasedir: fh=0x0
2022/10/30 17:15:00 DEBUG : /: >Releasedir: errc=0
2022/10/30 17:15:00 DEBUG : /: Opendir:
2022/10/30 17:15:00 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:15:00 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:15:00 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/30 17:15:00 DEBUG : /: >Getattr: errc=0
2022/10/30 17:15:00 DEBUG : /: Opendir:
2022/10/30 17:15:00 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/30 17:15:00 DEBUG : /: >OpenFile: fd=/ (r), err=<nil>
2022/10/30 17:15:00 DEBUG : /: >Opendir: errc=0, fh=0x1
2022/10/30 17:15:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:16:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:17:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:18:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:19:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:20:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:21:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:22:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:23:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:24:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:25:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:26:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:27:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:28:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:29:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/30 17:30:57 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)