Mount Command Fails When PC is Shutdown Un-gracefully

I filled out the fields below, but essentially I'm using an rclone mount command to create folders that show on my local C drive. The PC this is running on blue screens quite a bit (a totally different story). I have a process that will see that it has blue screened, kill power, and restart the PC. I have a batch file built that runs in Task Scheduler at System Startup (batch file pasted in the "enter your command" section). When this happens, rclone won't mount the directories that I expect because they are already there. I need to manually delete the folders that are there, then rerun the Task Scheduler task and all is good. I thought perhaps in my batch file I could add a command to delete the folders first, then mount, but I was afraid that would run and accidentally delete the actual cloud drive.

What is the problem you are having with rclone?

When my Windows 10 PC is not shutdown properly, when the PC starts, the rclone folders already exist. This means when my rclone batch file runs to mount the folders, it fails to 'replace' or overwrite the folders.

What is your rclone version (output from rclone version)

rclone v1.54.0

  • os/arch: windows/amd64
  • go version: go1.15.7

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64 bit

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)

start rclone mount --vfs-cache-mode writes --cache-db-path "C:\Drive Files\" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X - Cache:/" "C:\Drive Files\X"

The rclone config contents with secrets removed.

I have each team drive mounted as a type = drive, then another one to cache that drive locally.

remote> 3
--------------------
[DFS - X]
type = drive
client_id = removed
client_secret = removed
scope = drive
token = {"access_token":"<removed>","token_type":"Bearer","refresh_token":"<removed>","expiry":"2021-03-29T13:48:20.6388585-07:00"}
team_drive = removed
root_folder_id =
--------------------

remote> 4
--------------------
[DFS - X - Cache]
type = cache
remote = DFS - X:/
chunk_size = 100M
info_age = 1h0m0s
chunk_total_size = 50G

The cache remote is deprecated and you should change to the new vfs-cache-mode full.

Also with no debug log, we don't know what failed. If you have a log to share, that would be great.

hello and welcome to the forum,

the location of the mount cannot be the same as the --cache-db-path

so try this and then look for the X:, to see the files.
start rclone mount --vfs-cache-mode writes --cache-db-path "C:\Drive Files\X" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X - Cache:/" X:"

also, about that cache remote, not a good idea
https://rclone.org/cache/#status

better yet, try this without the cache remote
start rclone mount "DFS - X" X: --vfs-cache-mode full --cache-dir "D:\Rclone Cache"

My mistake, I edited my post. I had the --cache-db-path wrong in my post, but my config is not like that, the db is in the parent directory to where the mounts are made, and that directory is actually on the C:\ of the PC. I was trying to get around the "new user can only post two links" thinking that perhaps all the backslashes looked like links, so I manually edited too much.

I recall reading that the cache remote was not supported, but for some reason thought I needed it over the --vfs-cache-mode full. This is the software that I'm primarily using with these files: Constant access to the same file over and over again?. I can certainly change the mount command to skip the cache mount and see what happens.

Noted, I should have run the rclone command the last time the PC blue screened to get the output, but instead I deleted the leftover folders and reran my mount batch file to get the directories back first. I have my Task Scheduler logs off, so I don't think it outputs that data anywhere automatically.

kind of confusing to re-edit an old post.

so can you post the actual command in a new post

start rclone mount --vfs-cache-mode writes --cache-db-path "C:\Drive Files\" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X - Cache:/" "C:\Drive Files\X"

the mount folder "C:\Drive Files\X" cannot be a subfolder of --cache-db-path "C:\Drive Files"

did you try the command i shared?

Ah, ok. I didn't realize it couldn't be a subfolder either. I can certainly make that change and then go pull the plug on the PC to see if that works better when recovering from a blue screen. I'll do that and test it out right now.

I'm hesitant to move to the --vfs-cache-mode full simply because I recall reading quite a bit about the cache when I set this up a few months ago. I must have come to the conclusion I needed the cache filesystem for some reason, but if that conclusion is totally wrong, then I will adapt that as well. Thanks!

the problem has nothing to do with the BSOD.
really, whatever you do, do not pull the plug on a running system, that is a hard crash and can permanently corrupt the file system, which can lead to never ending BSOD over and over again.

so just run the command i shared on the command line, see the files in the X: drive, then kill the command, run it again and verify there are no errors.

Yes, that command works, as does the command that I have been using. The problem comes when I have to hard reset this PC. If the rclone process is stopped gracefully or by killing the task, it removes the C:\Drive Files\X folder/shortcut correctly. Then the next time I run the rclone mount command, everything is fine.

When the PC is hard reset, the C:\Drive Files\ looks like this on boot:

C:\Drive Files>dir
 Volume in drive C has no label.
 Volume Serial Number is 

 Directory of C:\Drive Files

03/29/2021  03:09 PM    <DIR>          .
03/29/2021  03:09 PM    <DIR>          ..
03/29/2021  03:08 PM               911 mount_dfs.bat
03/29/2021  03:08 PM    <JUNCTION>     X [\Device\Volume{UUID}\]
               8 File(s)    148,899,182 bytes
               6 Dir(s)  127,885,996,032 bytes free

C:\Drive Files>cd X
The system cannot find the path specified.

C:\Drive Files>

Then when I try to run the mount command with -vv, I get this:

C:\>rclone mount --vfs-cache-mode writes --cache-db-path "C:\rclone_db_path" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X - Cache:/" "C:\Drive Files\X" -vv
2021/03/29 15:19:50 DEBUG : rclone: Version "v1.54.0" starting with parameters ["rclone" "mount" "--vfs-cache-mode" "writes" "--cache-db-path" "C:\\rclone_db_path" "--cache-chunk-path" "D:\\Rclone Cache" "--cache-dir" "D:\\Rclone Cache" "DFS - X - Cache:/" "C:\\Drive Files\\X" "-vv"]
2021/03/29 15:19:50 DEBUG : Creating backend with remote "DFS - X - Cache:/"
2021/03/29 15:19:50 DEBUG : Using config file from "C:\\Users\\x\\.config\\rclone\\rclone.conf"
2021/03/29 15:19:50 DEBUG : Creating backend with remote "DFS - X:/"
2021/03/29 15:19:50 DEBUG : fs cache: renaming cache item "DFS - X:/" to be canonical "DFS - X:"
2021/03/29 15:19:50 DEBUG : DFS - X - Cache: wrapped DFS - X: at root
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Cache DB path: C:\ rclone_db_path\DFS - X - Cache.db
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Cache chunk path: D:\Rclone Cache\DFS - X - Cache
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Chunk Memory: true
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Chunk Size: 100M
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Chunk Total Size: 50G
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Chunk Clean Interval: 1m0s
2021/03/29 15:19:50 INFO  : DFS - X - Cache: Workers: 4
2021/03/29 15:19:50 INFO  : DFS - X - Cache: File Age: 1h0m0s
2021/03/29 15:19:50 DEBUG : Adding path "cache/expire" to remote control registry
2021/03/29 15:19:50 DEBUG : Adding path "cache/stats" to remote control registry
2021/03/29 15:19:50 DEBUG : Adding path "cache/fetch" to remote control registry
2021/03/29 15:19:50 DEBUG : fs cache: renaming cache item "DFS - X - Cache:/" to be canonical "DFS - X - Cache:"
2021/03/29 15:19:50 DEBUG : Cache remote DFS - X - Cache:: subscribing to ChangeNotify
2021/03/29 15:19:50 DEBUG : vfs cache: root is "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X - Cache"
2021/03/29 15:19:50 DEBUG : vfs cache: metadata root is "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X - Cache"
2021/03/29 15:19:50 DEBUG : Creating backend with remote "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X - Cache"
2021/03/29 15:19:50 DEBUG : fs cache: renaming cache item "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X - Cache" to be canonical "//?/D:/Rclone Cache/vfs/DFS - X - Cache"
2021/03/29 15:19:50 DEBUG : fs cache: switching user supplied name "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X - Cache" for canonical name "//?/D:/Rclone Cache/vfs/DFS - X - Cache"
2021/03/29 15:19:50 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/03/29 15:19:50 DEBUG : Network mode mounting is disabled
2021/03/29 15:19:50 DEBUG : Mounting on "C:\\Drive Files\\X" ("DFS - X - Cache")
2021/03/29 15:19:50 DEBUG : Cache remote DFS - X - Cache:: Mounting with options: ["-o" "attr_timeout=1" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=DFS - X - Cache"]
Cannot create WinFsp-FUSE file system: mount point in use.
2021/03/29 15:19:51 ERROR : Cache remote DFS - X - Cache:: Mount failed
2021/03/29 15:19:51 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed

i think we are going around in circles now.

Is your point that I should use a straight drive, instead of a path (X: vs C:\Drive Files\X)?

If that solves my issue, then that's great - I simply wasn't understanding that from your posts. I would rather have it be within the C: path because I have roughly 10 team drives to mount on this PC and using descriptive folder names is easier to keep track of vs the letter mechanism that Windows uses for drives, but I can deal with that.

you can use a path, as that is what i always do. but use the correct path.

  • if you still plan to use the buggy, depreciated, never left beta cache remote, then make sure the mount path is not a sub folder of the cache folders
  • using the c: drive for a rclone mount can get very confusing and lead to all sorts of mistakes.

here is what i do, i have a very small partition, less then 1GB is size, the B: drive.
and i mount to that like so

image

b:\mount\rclone>dir
 Volume in drive B is mount
 Volume Serial Number is D205-4EE0

 Directory of b:\mount\rclone

03/29/2021  07:11 PM    <DIR>          .
03/29/2021  07:11 PM    <DIR>          ..
03/29/2021  07:11 PM    <JUNCTION>     seedboxiosftp_internet [\Device\Volume{6022377f-90be-11eb-ba96-482ae32ef6d1}\]
03/29/2021  07:08 PM    <JUNCTION>     wasabi01 [\Device\Volume{60223762-90be-11eb-ba96-482ae32ef6d1}\]
03/29/2021  07:09 PM    <JUNCTION>     wasabicrypten07data [\Device\Volume{60223777-90be-11eb-ba96-482ae32ef6d1}\]
               0 File(s)              0 bytes
               5 Dir(s)   1,057,259,520 bytes free

I added a new partition that's 1GB in size, and created a directory in that partition named rclone. That partition is now mounted as R:\. My mount command is now this:

rclone mount --vfs-cache-mode writes --cache-db-path "C:\Drive Files" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X - Cache:/" "R:\rclone\X" -vvvv --log-file "C:\Drive Files\log.txt"

I ran the command, see the files in R:\rclone\x, all good. To test if this would help in the event of an ungraceful shut down, I powered off the PC by killing the power. I then started it back up but I'm in the same place (the log file is practically identical to what I posted before).

Maybe I'm not going to find a solution to this, but I imagine anyone would have this problem if the power cuts out. When a PC comes back alive, how do I make sure that the rclone mounts work without my intervention? Thanks!

i shared a command, that does not use the buggy, beta, cache remote, which will work in all situations.
what was wrong with that?

It does the same thing when the power is cut and the PC returns. Here is my current command that I just tested (without using the Cache mount):

rclone mount --vfs-cache-mode full --cache-db-path "C:\rclone_db_path" --cache-chunk-path "D:\Rclone Cache" --cache-dir "D:\Rclone Cache" "DFS - X:/" "R:\rclone\x" -vvvv --log-file "C:\Drive Files\log.txt"

The log, after a power restore looks the same:

2021/03/30 06:18:02 DEBUG : rclone: Version "v1.54.0" starting with parameters ["rclone" "mount" "--vfs-cache-mode" "full" "--cache-db-path" "C:\\rclone_db_path" "--cache-chunk-path" "D:\\Rclone Cache" "--cache-dir" "D:\\Rclone Cache" "DFS - X:/" "R:\\rclone\\x" "-vvvv" "--log-file" "C:\\Drive Files\\log.txt"]
2021/03/30 06:18:02 DEBUG : Creating backend with remote "DFS - X:/"
2021/03/30 06:18:02 DEBUG : Using config file from "C:\\Users\\x\\.config\\rclone\\rclone.conf"
2021/03/30 06:18:02 DEBUG : fs cache: renaming cache item "DFS - X:/" to be canonical "DFS - X:"
2021/03/30 06:18:02 DEBUG : DFS - X: Loaded invalid token from config file - ignoring
2021/03/30 06:18:02 DEBUG : Keeping previous permissions for config file: -rw-rw-rw-
2021/03/30 06:18:02 DEBUG : DFS - X: Saved new token in config file
2021/03/30 06:18:02 DEBUG : vfs cache: root is "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X"
2021/03/30 06:18:02 DEBUG : vfs cache: metadata root is "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X"
2021/03/30 06:18:02 DEBUG : Creating backend with remote "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X"
2021/03/30 06:18:02 DEBUG : fs cache: renaming cache item "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X" to be canonical "//?/D:/Rclone Cache/vfs/DFS - X"
2021/03/30 06:18:02 DEBUG : fs cache: switching user supplied name "\\\\?\\D:\\Rclone Cache\\vfs\\DFS - X" for canonical name "//?/D:/Rclone Cache/vfs/DFS - X"
2021/03/30 06:18:02 INFO  : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2021/03/30 06:18:02 DEBUG : Network mode mounting is disabled
2021/03/30 06:18:02 DEBUG : Mounting on "R:\\rclone\\x" ("DFS - X")
2021/03/30 06:18:02 DEBUG : Google drive root '': Mounting with options: ["-o" "attr_timeout=1" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=DFS - X"]
2021/03/30 06:18:02 ERROR : Google drive root '': Mount failed
2021/03/30 06:18:02 Fatal error: failed to mount FUSE fs: mount stopped before calling Init: mount failed

not sure this is a good use of time.

you keep pulling the plug on an already damaged operating system and continue to increase the damage.
and then expect software to work reliably.

I'm pulling the plug to test it. But the same exact scenario would occur in the event of an unplanned power failure. My problem is that if the PC is not gracefully shut down, the rclone mount won't come back until I manually delete the prior created folder. I want a system that will recover correctly from an ungraceful shut down (whether it's a BSOD, me pulling the plug, or a rolling brown-out).

perhaps create a virtual machine and simulate a power outage.
in that way, you can test without permanently damaging the operating system that you depend on for testing.

  1. create a snapshot before simulating the power outage.
  2. after reboot, if the problem persists, then revert to the snapshot, tweak the mount command.
  3. repeat as needed.

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