winfsp / sshfs-win

SSHFS For Windows
https://winfsp.dev
Other
5.11k stars 257 forks source link

Python [WinError 1005] The volume does not contain a recognized file system #243

Closed minidron closed 3 years ago

minidron commented 4 years ago

If I mount through command line:

sshfs user@host:/ x:

In Python:

from nt import _getfinalpathname

_getfinalpathname('x:\\')

I get error:

OSError: [WinError 1005] The volume does not contain a recognized file system.

If I mount through net use command, Python works without error.

billziss-gh commented 4 years ago

I seem to recall that getfinalpathname requires the file system to be mounted using the mount manager. For sshfs this would mean (untested): sshfs user@host:/ '\\.\x:'

minidron commented 4 years ago

sshfs user@host:/ '\\.\x:'

SSHFS version 3.5.2 Cannot create WinFsp-FUSE file system: invalid mount point.

billziss-gh commented 4 years ago

BTW, the single quotes (') are required only when launching from a bash prompt. If launching from a command or powershell prompt, they should be removed. Another caveat is that you need to launch the file system as Administrator in order to use mount manager mountpoints.

Having said that sshfs has not been tested with mount manager mountpoints (because it was developed before they were added to WinFsp) and may not work with them.

minidron commented 4 years ago

Tried with and without quote. Tried launching from a cmd, powershell and cygwin bash. The result is always:

Cannot create WinFsp-FUSE file system: invalid mount point.

Apparently, the last version of sshfs does not support it. Are you going to add this feature?

Thanks!

billziss-gh commented 4 years ago

Apparently, the last version of sshfs does not support it. Are you going to add this feature?

I am really stretched thin at the moment. Would you consider sending a PR for this?

minidron commented 3 years ago

After doing some research (I've never worked with the c/c++ language before), I found two places that need to be updated so that sshfs can support mount manager mountpoints:

  1. sshfs-win Need add conditional for support \\.\x: pattern sshfs.c.

  2. winfsp. Need add conditional for support \\.\x: pattern dll/fuse/fuse.c.

After these changes, sshfs user@host:/ \\.\x: working and Python _getfinalpathname('x:') working without error. But need to launch the file system as Administrator.

Would you consider sending a PR for this?

I can try.

billziss-gh commented 3 years ago

@minidron great research especially for someone who has not worked with C before!

winfsp. Need add conditional for support \.\x: pattern dll/fuse/fuse.c.

Thanks for the pointer. I will look into this myself.

sshfs-win Need add conditional for support \.\x: pattern sshfs.c.

We can look into patching this in the upstream SSHFS, or we can add a simple patch in the patches directory that does the job. Let me know which is your preferred method.

minidron commented 3 years ago

Thank you! These updates solved the problem.

prodchia commented 3 years ago

I am still having similar problem. I am using sshfs-win3.5.20357 and winFSP 2021 Beta2 along with SSHFS-Win Manager 1.2.1

Bestfast commented 2 years ago

I still have the exact same issue

billziss-gh commented 2 years ago

Please make sure to mount the drives using the \\.\X: syntax notation. You will need to do this from an account that has Administrator privileges.

jkw commented 4 months ago

Please make sure to mount the drives using the \\.\X: syntax notation. You will need to do this from an account that has Administrator privileges.

From a end-user perspective, this is not helpful. I have the issue and have no idea what you talk about.

I've mounted my sshfs at N:\, I don't know much more thant that.