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

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

Closed
minidron opened this issue Oct 22, 2020 · 12 comments
Closed

Comments

@minidron
Copy link
Contributor

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
Copy link
Collaborator

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
Copy link
Contributor Author

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

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

@billziss-gh
Copy link
Collaborator

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
Copy link
Contributor Author

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
Copy link
Collaborator

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
Copy link
Contributor Author

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
Copy link
Collaborator

@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
Copy link
Contributor Author

Thank you! These updates solved the problem.

@prodchia
Copy link

prodchia commented Jul 18, 2021

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
Copy link

I still have the exact same issue

@billziss-gh
Copy link
Collaborator

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
Copy link

jkw commented Jun 7, 2024

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.

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

No branches or pull requests

5 participants