Dokany as file system for MS SQL server databases?

68 views
Skip to first unread message

Hristo Stoyanov

unread,
Jan 28, 2020, 12:26:22 PM1/28/20
to Dokan
Has anyone successfully deployed Dokany-based virtual drive/mount point to back by MS SQL server database location?

I tried to use cryptomator encrypted local driver as a test (dokany-nio-driver), but MS SQL does not recognize the dokany-based virtual drive/mount point and refuses to store data files there.
I wonder if dokany is truly a filesystem, or MS SQL uses some obscure tests to figure out if the database filesystem is genuine/native or not?

Thanks.
Hristo

Adrien JUND

unread,
Jan 28, 2020, 12:34:05 PM1/28/20
to do...@googlegroups.com
Hi!

Could you try to mount the mirror sample installed in the dokan folder and enable the mount manager option?
It can make the difference with applications not seeing the filesystem by default. 

Best regards 
Adrien JUND 

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/dokan/bd9b5337-a543-498c-a9ef-afa86488c58f%40googlegroups.com.

Hristo Stoyanov

unread,
Jan 28, 2020, 11:10:22 PM1/28/20
to Dokan
Adrien,
Thanks for the hint! ...So, I mounted a mirror drive Z:  onto my c:\hristo_test\mirror folder, with the /o option, as you suggested:

Unmount the drive with CTRL + C in the console or alternatively via "dokanctl /u MountPoint".
PS C:\Program Files\Dokan\DokanLibrary-1.3.0> .\mirror.exe /r c:\hristo_test\mirror /o /l Z:

Next, I created a Z:\DATA folder with no issues, but when I tried to create a MS SQL database in Z:\DATA with SQL Server Management Studio by executing this script:

USE master;
GO
drop database Solutions
GO
CREATE DATABASE Solutions
ON
( NAME = Solutions_dat, 
    FILENAME = 'z:\data\Solutionsdat.mdf',
    SIZE = 10MB,
    MAXSIZE = 50MB,
    FILEGROWTH = 5MB ) 
LOG ON
( NAME = Solutions_log, 
    FILENAME = 'z:data\Solutionslog.ldf',
    SIZE = 5MB,
    MAXSIZE = 25MB,
    FILEGROWTH = 5MB );
GO


I get the below error. I tried to set permissions, etc., but could not get rid of  this error:

Msg 3701, Level 11, State 1, Line 3
Cannot drop the database 'Solutions', because it does not exist or you do not have permission.
Msg 5123, Level 16, State 1, Line 5
CREATE FILE encountered operating system error 1307(This security ID may not be assigned as the owner of this object.) while attempting to open or create the physical file 'z:\data\Solutionsdat.mdf'.
Msg 1802, Level 16, State 4, Line 5
CREATE DATABASE failed. Some file names listed could not be created. Check related errors.


Please advise.

Note that this happens only with the Dokany drive Z: - any of the normal hard disk drives on my machine worked fine with the above steps.

This can be easily reproduced if you download SQL Server Express (FREE from Microsoft) and repeat my steps.

I used Windows 2012 server for th etests.





On Tuesday, January 28, 2020 at 5:34:05 PM UTC, Liryna wrote:
Hi!

Could you try to mount the mirror sample installed in the dokan folder and enable the mount manager option?
It can make the difference with applications not seeing the filesystem by default. 

Best regards 
Adrien JUND 

Le mar. 28 janv. 2020 à 18:26, Hristo Stoyanov <hr.st...@gmail.com> a écrit :
Has anyone successfully deployed Dokany-based virtual drive/mount point to back by MS SQL server database location?

I tried to use cryptomator encrypted local driver as a test (dokany-nio-driver), but MS SQL does not recognize the dokany-based virtual drive/mount point and refuses to store data files there.
I wonder if dokany is truly a filesystem, or MS SQL uses some obscure tests to figure out if the database filesystem is genuine/native or not?

Thanks.
Hristo

--
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 do...@googlegroups.com.

Hristo Stoyanov

unread,
Jan 28, 2020, 11:26:37 PM1/28/20
to Dokan
If this helps, here is the captured output when MIRROR.EXE is run with /d /s options:

CreateFile status = c0000034
###Create 0264
CreateFile : c:\hristo_test\mirror\data\Solutionsdat.mdf
  AccountName: MSSQL$SQLEXPRESS, DomainName: NT SERVICE
        ShareMode = 0x3
        FILE_SHARE_READ
        FILE_SHARE_WRITE
        DesiredAccess = 0x100080
        FILE_READ_ATTRIBUTES
        SYNCHRONIZE
        FlagsAndAttributes = 0x200080
        FILE_ATTRIBUTE_NORMAL
        FILE_FLAG_OPEN_REPARSE_POINT
        OPEN_EXISTING
        error code = 2


CreateFile status = c0000034
###Create 0265
CreateFile : c:\hristo_test\mirror\DATA
  AccountName: MSSQL$SQLEXPRESS, DomainName: NT SERVICE
        ShareMode = 0x3
        FILE_SHARE_READ
        FILE_SHARE_WRITE
        DesiredAccess = 0x100080
        FILE_READ_ATTRIBUTES
        SYNCHRONIZE
        Cannot open a dir as a file
CreateFile status = c00000ba
###Create 0266
CreateFile : c:\hristo_test\mirror\DATA
  AccountName: MSSQL$SQLEXPRESS, DomainName: NT SERVICE
        ShareMode = 0x3
        FILE_SHARE_READ
        FILE_SHARE_WRITE
        DesiredAccess = 0x100080
        FILE_READ_ATTRIBUTES
        SYNCHRONIZE
        FlagsAndAttributes = 0x200080
        FILE_ATTRIBUTE_NORMAL
        FILE_FLAG_OPEN_REPARSE_POINT
        OPEN_EXISTING

CreateFile status = 0
###Cleanup 0266
Cleanup: c:\hristo_test\mirror\DATA

Hristo Stoyanov

unread,
Jan 31, 2020, 2:24:48 AM1/31/20
to Dokan
Adrien, did you have a chance to look into this?

Adrien JUND

unread,
Jan 31, 2020, 2:44:46 AM1/31/20
to do...@googlegroups.com
Hi Hristo, 

Yes, the logs do not include the error we are looking for. Could you provide a full log? 

Thank you 

Le ven. 31 janv. 2020 à 08:24, Hristo Stoyanov <hr.st...@gmail.com> a écrit :
Adrien, did you have a chance to look into this?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/dokan/82eb0508-0f16-415f-9b74-e4115c6072dc%40googlegroups.com.

Hristo Stoyanov

unread,
Feb 1, 2020, 2:14:57 AM2/1/20
to Dokan
Hi Adrien,
As requested, find attached the error log generated with:

C:\Program Files\Dokan\DokanLibrary-1.3.0> .\mirror.exe /r c:\hristo_test\mirror /o /d /s  /l Z: 2>c:\log.txt

Btw, if I start MIRROR.EXE with /p option, MSSQL server is fine -I was able to create a databases, tables, data on the virtual drive! Need to do more testing though, before I say it is 100% legit

C:\Program Files\Dokan\DokanLibrary-1.3.0> .\mirror.exe /r c:\hristo_test\mirror /o /p

So, why the /p option seems to solve the problem?


On Friday, January 31, 2020 at 7:44:46 AM UTC, Liryna wrote:
Hi Hristo, 

Yes, the logs do not include the error we are looking for. Could you provide a full log? 

Thank you 

Le ven. 31 janv. 2020 à 08:24, Hristo Stoyanov <hr.st...@gmail.com> a écrit :
Adrien, did you have a chance to look into this?

--
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 do...@googlegroups.com.
log.txt

Adrien JUND

unread,
Feb 1, 2020, 9:12:11 AM2/1/20
to do...@googlegroups.com
Hi, 

It make sense regarding the error you had and that it work with the p option. The option is for impersonate caller that do affect the security descriptor used on all request.
Please see the mirror source code for more details.

For information, this is not a dokan issue but how security work on Windows. The filesystem need to handle it, at least how the mirror do with the p option. 

Best regards 
Liryna 

Le sam. 1 févr. 2020 à 08:14, Hristo Stoyanov <hr.st...@gmail.com> a écrit :
Hi Adrien,
As requested, find attached the error log generated with:
To unsubscribe from this group and stop receiving emails from it, send an email to dokan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dokan/9b25407b-1927-4afd-8b2e-0ca2a8414bdf%40googlegroups.com.

Hristo Stoyanov

unread,
Feb 1, 2020, 11:38:55 PM2/1/20
to Dokan
Adrien,
I have a question about how MIRROR.EXE works:
I mirrored a pretty large volume (>250gb) with lots of files, and it showed instantaneously  in the mirror drive. I was hoping that MIRROR.EXE implements "true mirroring" , and files will be replicated from the source, in which case it would take some time to replicate 250GB. But this does not appear to be the case?
Liryna 

Adrien JUND

unread,
Feb 2, 2020, 4:59:49 AM2/2/20
to do...@googlegroups.com
Mirror is just a IO local redirector. Dokan library ask him some information and he use the win32 io api on local folder that you give as parameter to respond.
A true mirroring as back up or hardware is not the goal here. 

I hope this makes it clearer. 

To unsubscribe from this group and stop receiving emails from it, send an email to dokan+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dokan/f6ee0b18-fee9-4a85-9bbd-7f55895792f4%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages