Some questions about Dokan Fuse

669 views
Skip to first unread message

ArchStacker

unread,
Feb 21, 2016, 12:36:05 AM2/21/16
to Dokan
Hello everyone.I have tried to Mount different filesystems with the related codes in GRUB with the help do Dokany before.
Now I find that Dokany have implemented Dokan Fuse , which is compatible with FUSE api on Linux.I tried to compile grub-mount on Windows with Dokan Fuse and I'm success to do it.
My question is:
1.Have FUSE API been fullly ported? I think it's a big project to do it. What's the status of it now?
2.After I compiled fusexmp.c , how to use it on Windows? Why not add it on wiki?

ArchStacker

unread,
Feb 21, 2016, 12:40:13 AM2/21/16
to Dokan
3.Why not use MSYS2 to build Dokan Fuse?

Maxime C

unread,
Feb 21, 2016, 2:28:38 AM2/21/16
to do...@googlegroups.com
Hi,

Yes I remember your work which is interesting if it becomes a really maintained project btw :).

 1. Dokan FUSE is working for most use case but there is some unsupported features (acl, ...) and bugs (file rename) for now.
 2. That's specific to libfuse project sample that's why, after build you can start it with: fusexmp.exe m
This will mount and mirror the current path root directory to drive M.
 3. Normally you can :). For now we provide MSVC binary and since few days Cygwin binary. Nothing stop you to use MSYS2. As far as I know the build instruction should be similar to cygwin.

2016-02-21 6:40 GMT+01:00 ArchStacker <archs...@gmail.com>:
3.Why not use MSYS2 to build Dokan Fuse?

--
You received this message because you are subscribed to the Google Groups "Dokan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dokan+un...@googlegroups.com.
To post to this group, send email to do...@googlegroups.com.
Visit this group at https://groups.google.com/group/dokan.
For more options, visit https://groups.google.com/d/optout.

Adrien JUND

unread,
Mar 6, 2016, 2:24:51 PM3/6/16
to do...@googlegroups.com
Hi ArchStacker,

Changes has been made in the installer.
Next release will include msys2 & cygwin dokanfuse binaries with cygwin mirror sample.

ArchStacker

unread,
Mar 7, 2016, 8:55:56 AM3/7/16
to Dokan
Thank you very much.
Will 'libdokanfuse1.dll' be installed into '/lib' if msys2 or cygwin exist in the computer?
Or can we make a package of libdokanfuse on msys2 to make program be compiled on it can automatic find the lib?
And can we replace the argument '-lcygdokanfuse1' to '-lfuse' to make program being compiled don't need to change their compile script?

Adrien JUND

unread,
Mar 7, 2016, 3:11:00 PM3/7/16
to do...@googlegroups.com
libdokanfuse1.dll / cygdokanfuse1.dll  are directly going to be in C:/Program Files/Dokan/DokanLibrary-1.0.0/
We have also set a environment variables DokanLibraryLibEnvPath that directly target this folder.

To be able to do -lfuse, the dlls have to be renamed libfuse.dll and therefore would have to be split in different folders.
What do you think about it ?

ArchStacker

unread,
Mar 9, 2016, 7:06:52 AM3/9/16
to Dokan
I think we can create a PKGBUILD to help people compile dokan fuse and install it on their msys2, and we can rename dll in PKGBUILD

Adrien JUND

unread,
Mar 9, 2016, 12:12:59 PM3/9/16
to do...@googlegroups.com
That could also be a good possibility !

A pull request will be needed for it :)

ArchStacker

unread,
Apr 16, 2016, 10:13:26 AM4/16/16
to Dokan
What's the mean of 'Add FUSE Cygwin / Msys2 binaries in installer (optional)'? I can't find anything related to Msys2 when I installed dokany.
How to compile fusexmp.c on MinGW32 with dokany? It seems that there are some errors.
And the follow code can be compiled on Cygwin but can't on MinGW32:
#include<fuse/fuse.h>
int main (void)
{
   
struct stat st;
    st
.st_blksize=0;
   
return 0;
}




On Monday, March 7, 2016 at 3:24:51 AM UTC+8, Liryna wrote:

Adrien JUND

unread,
Apr 16, 2016, 1:22:00 PM4/16/16
to do...@googlegroups.com

Hi,

Normally you should find the dll in the github pre-release already.

Otherwise there is the appveyor script that show you the command line to build with msys.
(if I remember there is also in the dokan fuse wiki some informations )

Best regards,

USeebi

unread,
Sep 3, 2016, 9:20:08 AM9/3/16
to Dokan
Hi,

Installed DokanSetup 1.0.0.4000 on Win 10 Pro and tried the fusexmp samples on MSYS2 with

gcc fusexmp.c -I/home/useeb/dokany/dokan_fuse/include -D_FILE_OFFSET_BITS=64 -L/home/useeb/dokany/'Dokan Library-1.0.0' -llibdokanfuse1

where C:/Program Files/Dokan is mounted on ~/dokany

a.exe is complied without error but run failed with: error while loading shared libraries: libdokanfuse1.dll: cannot open shared object file: No such file or directory.

ldd a.exe showed
        ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ffc688a0000)
        KERNEL32.DLL => /c/Windows/system32/KERNEL32.DLL (0x7ffc66d20000)
        KERNELBASE.dll => /c/Windows/system32/KERNELBASE.dll (0x7ffc65080000)

Attempted to add C:/Program Files/Dokan/Dokan Library-1.0.0 to PATH no help and DokanLibraryLibEnvPath is not defined in the source dokany-1.0.0-RC4.

What did I miss?



On Tuesday, March 8, 2016 at 4:11:00 AM UTC+8, Liryna wrote:

Liryna

unread,
Sep 3, 2016, 10:03:55 AM9/3/16
to Dokan
Hi USeebi,

LD_PRELOAD=/home/useeb/dokany/'Dokan Library-1.0.0' should do the trick if libdokanfuse1.dll is present in the folder.
Also do not forget to have dokan1.dll in the current folder (it is opened by dlopen)

Only DokanLibraryLibx86EnvPath and DokanLibraryLibx64EnvPath exist, where have you find DokanLibraryLibEnvPath ?

Best regards,

USeebi

unread,
Sep 4, 2016, 4:52:04 AM9/4/16
to Dokan
Hello Liryna,

Tried the trick as well as the followings but no help,

LD_PRELOAD_PATH=/home/useeb/dokany/'Dokan Library-1.0.0'
LD_PRELOAD=/home/useeb/dokany/'Dokan Library-1.0.0'/libdokanfuse1.dll

so I added one more command

export LD_PRELOAD

then I got an error on compilation or fork any child process from bash commands with bash.exe.stackdump:       0 [main] bash 5928 C:\msys64\usr\bin\bash.exe: *** fatal error in forked process - error while loading shared libraries: /opt/dokany/Dokan Library-1.0.0: cannot open shared object file: Permission denied
Hangup

Worked to figure out where the "Permission denied" originated by

- mount C:\Program Files\Dokan ~/dokany -o noacl
- add Authenticated Users to C:\Program Files\Dokan from Security Properties of Windows
- move the mount point as well as the current folder under C:\msys64

but none of these changed the fatal error while there is no problem to copy/edit/delete file in C:\Program Files\Dokan from msys2 shell mount point.

Also copied dokan1.dll to the current folder and export DokanLibrary1_LibraryPath_x64=/home/useeb/dokany/'Dokan Library-1.0.0' with no success although no fatal error.

Do you think this is related to Interoperability of Libraries Created by Different Compiler Brands?  How did other MSYS projects link to dlls in Windows env by msys-gcc?

Thanks!

Liryna

unread,
Sep 4, 2016, 5:37:31 AM9/4/16
to Dokan
libdokanfuse1.dll has been build with last gcc from msys2 packages

Can you try to clone dokany directly https://github.com/dokan-dev/dokany
Run: cd dokany/dokan_fuse/ && cmake . -G 'MSYS Makefiles' && make

Try to build against this new dll and do not forget to copy the dokan1.dll in the same folder.

USeebi

unread,
Sep 17, 2016, 2:32:43 PM9/17/16
to Dokan

Hi Liryna,

I tried the latest build of libdokanfuse1.dll to compile s3fs-fuse-1.79 on msys2.  The patches I used are attached. While I could mount m drive with fusexmp the same trick didn't work for

s3fs useebi m -d -d
s3fs: unable to access MOUNTPOINT m: No such file or directory

so I tried s3fs useebi /mnt -d -d then I got

Dokan: debug mode on
Dokan: use stderr
AllocationUnitSize: 512 SectorSize: 512
device opened
CreateFile failed: /mnt (2)
send release to \Volume{d6cc17c5-1734-4085-bce7-964f1e9f5de9}
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Dokan Error: DokanMount Failed
Thread will be terminated
Thread will be terminated
Ioctl failed for wait with code 995.
send global release for /mnt
Thread will be terminated
Ioctl failed for wait with code 995.
DokanError: Ioctl failed with code 122
Thread will be terminated
Failed to unmount: /mnt
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Thread will be terminated
Thread will be terminated
Thread will be terminated
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Thread will be terminated
Thread will be terminated
###QueryVolumeInfo -001
GetVolumeInformation
Dokan Error: Ioctl failed with code 2
Dokan Error: CreateFile failed \\.\Volume{d6cc17c5-1734-4085-bce7-964f1e9f5de9}: 2

Are all fuse-based file system could be ported to Dokan on Windows?
dokany.patch
config_ac.patch

Liryna

unread,
Sep 17, 2016, 2:42:44 PM9/17/16
to Dokan
Hi USeebi,

s3fs useebi m -d -d <- this should be the good command.
But "s3fs: unable to access MOUNTPOINT m: No such file or directory" this seems to be an internal of s3fs check that make the mount fail.
M:\ does not exist since it is going to be created by dokan.

Can you try to find the check and remove it ?



>Are all fuse-based file system could be ported to Dokan on Windows?
Yes thats the goal :D or with some little changes (delete file has to be handle differently depending of the fuse usage)

USeebi

unread,
Sep 18, 2016, 11:32:52 AM9/18/16
to Dokan

Hello Liryna,

You're right.  Attached is the updated patch.  Everything seems working fine except that the umount DOS command dokanctl /u M is not working cleanly and right click on Eject doesn't work.

Thanks!
dokany.patch

Liryna

unread,
Sep 18, 2016, 12:12:37 PM9/18/16
to Dokan
That's a great news !

Do you think you can make a clean patch on s3fs that would give the ability to people to mount on windows using dokan as you did ?
I am sure some people would appreciat this contribution to s3fs !


> Everything seems working fine except that the umount DOS command dokanctl /u M is not working cleanly and right click on Eject doesn't work.
Eject is not supported so it is normal but what is the output of dokanctl /u M ?

USeebi

unread,
Sep 19, 2016, 9:42:37 AM9/19/16
to Dokan

Debug output of dokanctl /u M


Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Thread will be terminated
Thread will be terminated
Thread will be terminated
Ioctl failed for wait with code 995.
Thread will be terminated
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Thread will be terminated
Thread will be terminated
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Ioctl failed for wait with code 995.
Thread will be terminated
Thread will be terminated
Thread will be terminated
Ioctl failed for wait with code 995.
Thread will be terminated
Dokan Error: DokanKeepAlive CreateFile failed \\.\Volume{d6cc17c5-1734-4085-bce7-964f1e9f5de9}: 2
Unmount

unload
send global release for m:

DokanError: Ioctl failed with code 122
Failed to unmount: m:

Enclosed are the pacman package of the latest build of libdokanfuse1.dll that I made by hand after dokan_fuse compilation from git source and the zip file with all the s3fs-fuse patches as well as PKGBUILD for makepkg. 

The pacman package might be distributed through dokan_fuse while the PKGBUILD patch sources probably need to be maintained for every new release of s3fs-fuse or dokan_fuse upgrade.  I'm not sure if there is a better way to enable others to repeat what I've done.
dokan_fuse-1.0.0-4-x86_64.pkg.tar.xz
s3fs-fuse-dokan_fuse.zip

Liryna

unread,
Sep 19, 2016, 3:31:52 PM9/19/16
to Dokan
From the output, the device seems to have correctly dismounted the device.
(the "error" logs just show that the kernel stopped the device and the communication with the application because of the unmount request)
Does the device disappear correctly ?


Oh ! USeebi, if you can create a pull request for a pkg-config dokan fuse this would be very well appreciated !
See the issue on github https://github.com/dokan-dev/dokany/issues/338

USeebi

unread,
Sep 20, 2016, 11:05:46 AM9/20/16
to Dokan
Glad to know that the logs is normal.

Will do the pull request just need to figure out how the GitHub works.  How come a pull request became repository push?

Liryna

unread,
Sep 20, 2016, 12:43:38 PM9/20/16
to Dokan
You will need to fork dokany on github (little button at the top).

Make the changes on your repository and after create a pull request on dokany.
See https://help.github.com/articles/creating-a-pull-request/

If you have issue, you can also create a patch that I will add in the repository.
Reply all
Reply to author
Forward
0 new messages