Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount to new drive's subdirectory #5015

Open
vdurante opened this issue Feb 10, 2021 · 6 comments
Open

Mount to new drive's subdirectory #5015

vdurante opened this issue Feb 10, 2021 · 6 comments

Comments

@vdurante
Copy link

What is your current rclone version (output from rclone version)?

1.55

What problem are you are trying to solve?

Run rclone mount to a non-existent drive's subdirectory

How do you think rclone should be changed to solve that?

At this point in time, if I attempt to mount to a new drive, such as: rclone mount my-bucket-a: Z: it works as expected. On windows, it creates a new drive letter Z: and mounts to it. But, I have so many drives I need to mount it would be nice to be able to run rclone mount my-bucket-a: Z:\my-bucket-a, rclone mount my-bucket-b: Z:\my-bucket-b, etc and all of the mounts being available in a single drive letter.

If I attempt to mount to a non-existing drive's subdirectory I get the following error message: 2021/02/10 15:13:19 Fatal error: failed to mount FUSE fs: parent of mountpoint directory does not exist: Z:\

@albertony
Copy link
Contributor

Its a good idea.

There workaround I've seen used is to create an actual disk partition, a small "dummy" drive just to be used for mounting directories into.

The WinFsp library rclone on Windows is based on uses Windows mechanisms DefineDosDevice for drive mounting and NTFS reparse points (of type directory junction) for mounting on a directory path, and don't know about any alternatives to "chase" in Windows API via WinFsp etc.. But could perhaps be possible to achieve this in rclone's own fs implementation on top, something like creating a "real" WinFsp drive mount as starting point, and then expose rclone remotes as subdirectories in that.

@ncw
Copy link
Member

ncw commented Feb 12, 2021

You could use rclone to create the dummy disk first with rclone mount C:\path\to\empty\dir E:

@albertony
Copy link
Contributor

You could use rclone to create the dummy disk first with rclone mount C:\path\to\empty\dir E:

What a (crazy) idea! :) Should it work, in existing rclone version? When I did a quick test just now it fails with:

"Cannot set WinFsp-FUSE file system mount point."

Did this:

rclone mount C:\Temp X:

rclone mount C:\Files X:\dummy\mnt (created a directory "dummy" as a workaround for the root folder mount bug in latest release).

@ncw
Copy link
Member

ncw commented Feb 12, 2021

You could use rclone to create the dummy disk first with rclone mount C:\path\to\empty\dir E:

What a (crazy) idea! :) Should it work, in existing rclone version? When I did a quick test just now it fails with:

"Cannot set WinFsp-FUSE file system mount point."

Ah... Yes. Rclone doesn't support submounts or maybe libfuse doesn't - I'm not quite sure - so that doesn't work. Well I know it doesn't work on linux and it probably won't work on Windows for the same reason.

I think there may be something rclone could do to make this work, but I'm not sure what exactly!

@ncw
Copy link
Member

ncw commented Feb 13, 2021

How about creating a small RAM disk first (syntax untested!)

ramdisk /add:Z /size:2m /fs:fat32

Then mounting on Z:\dir?

@albertony
Copy link
Contributor

albertony commented Feb 13, 2021

Yeah, that works!

One can use memfs, which is included as precompiled exe with WinFsp when you install it with the optional feature "Developer":

This is a working example, with rclone v1.54.0, mounting C:\Files and C:\Temp (dummy "remotes" for the test) into ram disk X:

"C:\Program Files (x86)\WinFsp\bin\memfs-x64.exe" -i -F NTFS -u \memfs\rclone -m X:
mkdir X:\remotes
rclone mount C:\Files X:\remotes\files
rclone mount C:\Temp X:\remotes\temp

When the issue in v1.54 preventing mount directly on root is released:

"C:\Program Files (x86)\WinFsp\bin\memfs-x64.exe" -i -F NTFS -u \memfs\rclone -m X:
rclone mount C:\Files X:\files
rclone mount C:\Temp X:\temp

(I think it should also be possible to use "net use \memfs64\share X:" instead of executing the memfs exe, but it did not work when I did a quick test)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants