Mounting multiple s3 drives/remotes to windows

First I will start off with version.

PS C:\rclone> .\rclone --version
rclone v1.60.0

  • os/version: Microsoft Windows 11 Pro 22H2 (64 bit)
  • os/kernel: 10.0.22621.755 (x86_64)
  • os/type: windows
  • os/arch: amd64
  • go/version: go1.19.2
  • go/linking: static
  • go/tags: cmount

I am trying to mount multiple drives on Windows within a single batch script. I have 2 remotes in my config for AWS S3. And when I create my batch script I have 2 lines, which are as follows:

C:\rclone\rclone.exe mount remote01:bucket01 * --vfs-cache-mode full
C:\rclone\rclone.exe mount remote02:bucket02 * --vfs-cache-mode full

I'm only using full cache mode for testing right now. Still learning the ins and outs of rClone seeing how it all works. Trying to streamline a better process than using cloudberry as we are wanting to pass through cli creds instead of keys, which thankfully rClone does.

Anyways, when I run the above bat script, it only maps the top line and doesn't run the second one at all. Any ideas why? Am I missing something?

hi,
to access the mount, rclone mount has to continue to run.
so with your script, the first command never exits and thus the second line is never run

there are a lot of ways to work around that.
tho this might be easiest way
--no-console add that to the mount command(s)

I did add that to the mount commands but all it did was minimized it and still didn't continue running the second line so only the first one was mounted.

hmm, when you first posted, there was a template of questions to be answered?
can you post that info and the script that you ran.

did a quick test, seems to be working for me.

rclone mount --no-console wasabi01:zork b:\rclone\mount\zork01
rclone mount --no-console wasabi01:zork b:\rclone\mount\zork02

and i got this from task manager

and this from double commander file manager

sorry to jump in, but if you use --no-console, how do you unmount the remote? Do you have to kill the rclone process in task manager (and if so, how do you know which rclone process is for which remote? and will ending the task allow rclone to do any last minute cleanup like cache flushing and so on?)

you can kill it with task manager.
take a look at my screen snippet from task manager, you can see the name of the apps and optionally see the command line.

as far as i know, if you kill the rclone.exe, there is no cache cleanup and so on.
the next time rclone mount is run, rclone will cleanup cache, upload files, etc..

Here is the log: (paths changed of course) it kept registering links inside it so newbs can only post 2 links which I am not trying to post any. So had to fix that. But hope this helps.

C:\Users%USERNAME%\Desktop>C:\rclone\rclone.exe mount --no-console remote01:bucket01/ * --vfs-cache-mode full -vv
2022/10/31 14:26:10 DEBUG : rclone: Version "v1.60.0" starting with parameters ["C:\rclone\rclone.exe" "mount" "--no-console" "remote01:bucket01/" "*" "--vfs-cache-mode" "full" "-vv"]
2022/10/31 14:26:10 DEBUG : Creating backend with remote "remote01:bucket01/"
2022/10/31 14:26:10 DEBUG : Using config file from "C:\Users\%USERNAME%\.config\rclone\rclone.conf"
2022/10/31 14:26:10 DEBUG : fs cache: renaming cache item "remote01:bucket01/" to be canonical "remote01:bucket01"
2022/10/31 14:26:10 INFO : S3 bucket bucket01: poll-interval is not supported by this remote
2022/10/31 14:26:10 DEBUG : vfs cache: root is "C:\Users\%USERNAME%\AppData\Local\rclone"
2022/10/31 14:26:10 DEBUG : vfs cache: data root is "\\?\C:\Users\%USERNAME%\AppData\Local\rclone\vfs\remote01\bucket01"
2022/10/31 14:26:10 DEBUG : vfs cache: metadata root is "\\?\C:\Users\%USERNAME%\AppData\Local\rclone\vfsMeta\remote01\bucket01"
2022/10/31 14:26:10 DEBUG : Creating backend with remote "C:/Users/%USERNAME%/AppData/Local/rclone/vfs/remote01/bucket01"
2022/10/31 14:26:10 DEBUG : fs cache: renaming cache item "C:/Users/%USERNAME%/AppData/Local/rclone/vfs/remote01/bucket01" to be canonical "//?/C:/Users/%USERNAME%/AppData/Local/rclone/vfs/remote01/bucket01"
2022/10/31 14:26:10 DEBUG : Creating backend with remote "C:/Users/%USERNAME%/AppData/Local/rclone/vfsMeta/remote01/bucket01"
2022/10/31 14:26:10 DEBUG : fs cache: renaming cache item "C:/Users/%USERNAME%/AppData/Local/rclone/vfsMeta/remote01/bucket01" to be canonical "//?/C:/Users/%USERNAME%/AppData/Local/rclone/vfsMeta/remote01/bucket01"
2022/10/31 14:26:10 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)
2022/10/31 14:26:10 NOTICE: Assigning drive letter "Z:"
2022/10/31 14:26:10 DEBUG : Network mode mounting is disabled
2022/10/31 14:26:10 DEBUG : Mounting on "Z:" ("remote01 bucket01")
2022/10/31 14:26:10 DEBUG : S3 bucket bucket01: Mounting with options: ["-o" "attr_timeout=1" "-o" "uid=-1" "-o" "gid=-1" "--FileSystemName=rclone" "-o" "volname=remote01 bucket01"]
2022/10/31 14:26:10 DEBUG : S3 bucket bucket01: Init:
2022/10/31 14:26:10 DEBUG : S3 bucket bucket01: >Init:
2022/10/31 14:26:10 DEBUG : /: Statfs:
2022/10/31 14:26:10 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/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Readlink:
2022/10/31 14:26:10 DEBUG : /: >Readlink: linkPath="", errc=-40
2022/10/31 14:26:10 DEBUG : /: Getxattr: name="non-existant-a11ec902d22f4ec49003af15282d3b00"
2022/10/31 14:26:10 DEBUG : /: >Getxattr: errc=-40, value=""
The service rclone has been started.
2022/10/31 14:26:10 DEBUG : /: Statfs:
2022/10/31 14:26:10 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/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Opendir:
2022/10/31 14:26:10 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/31 14:26:10 DEBUG : /: >OpenFile: fd=/ (r), err=
2022/10/31 14:26:10 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Releasedir: fh=0x0
2022/10/31 14:26:10 DEBUG : /: >Releasedir: errc=0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Opendir:
2022/10/31 14:26:10 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/31 14:26:10 DEBUG : /: >OpenFile: fd=/ (r), err=
2022/10/31 14:26:10 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/31 14:26:10 DEBUG : /: Releasedir: fh=0x0
2022/10/31 14:26:10 DEBUG : /: >Releasedir: errc=0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Opendir:
2022/10/31 14:26:10 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/31 14:26:10 DEBUG : /: >OpenFile: fd=/ (r), err=
2022/10/31 14:26:10 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/31 14:26:10 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:10 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:10 DEBUG : /: Releasedir: fh=0x0
2022/10/31 14:26:10 DEBUG : /: >Releasedir: errc=0
2022/10/31 14:26:13 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/31 14:26:14 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/31 14:26:14 DEBUG : /autorun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /autorun.inf: >Getattr: errc=-2
2022/10/31 14:26:14 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:14 DEBUG : /: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /: >Getattr: errc=0
2022/10/31 14:26:14 DEBUG : /: Opendir:
2022/10/31 14:26:14 DEBUG : /: OpenFile: flags=O_RDONLY, perm=-rwxrwxrwx
2022/10/31 14:26:14 DEBUG : /: >OpenFile: fd=/ (r), err=
2022/10/31 14:26:14 DEBUG : /: >Opendir: errc=0, fh=0x0
2022/10/31 14:26:14 DEBUG : /: Releasedir: fh=0x0
2022/10/31 14:26:14 DEBUG : /: >Releasedir: errc=0
2022/10/31 14:26:14 DEBUG : /AutoRun.inf: Getattr: fh=0xFFFFFFFFFFFFFFFF
2022/10/31 14:26:14 DEBUG : /AutoRun.inf: >Getattr: errc=-2
2022/10/31 14:27:10 INFO : vfs cache: cleaned: objects 0 (was 0) in use 0, to upload 0, uploading 0, total size 0 (was 0)

The script I ran was posted in original post. But here it is:

C:\rclone\rclone.exe mount --no-console remote01:bucket01.com/ * --vfs-cache-mode full
C:\rclone\rclone.exe mount --no-console remote02:bucket02.com/ * --vfs-cache-mode full

that log file looks ok.

Yeah, it's just not running the second line. I am just trying to mount 2 separate buckets as 2 separate drives in Windows.

I just expand my console window. All the --no-console does in windows is just minimizes the console window. In my experience at least. So I just expand and close or right click and close if I am done.

not sure why but there are a bunch of other ways.

--- windows task scheduler.
--- nircmd exec hide from https://www.nirsoft.net/

how are you running the script?
command line, windows explorer, notepad++ or ?

I know there are other ways to hide it and I will work on those when I get to that. My main thing right now is trying to have map multiple drives/buckets to my file explorer.

I am running it as a .bat script currently. It works great for one drive. I just want to capitalize on it and map more than one in one script.

Maybe simply adding start "" in front of the commands will give you what you want:

start "" C:\rclone\rclone.exe mount --no-console remote01:bucket01.com/ * --vfs-cache-mode full
start "" C:\rclone\rclone.exe mount --no-console remote02:bucket02.com/ * --vfs-cache-mode full
1 Like

Adding the start "" at the beginning actually worked. Granted it opened 2 terminal windows but that's fine. Easy fix. Not sure how I didn't think of that. Thanks!

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