dokan

最後更新: 2021-08-13

 


Dokan

 

https://dokan-dev.github.io/

 

Installation

 1. 安裝 build Dokan 時相同版本的 "redistribuables Visual C++"

由於 SeaDrive 1.0.12 依賴 dokan 1.2.2.1000, 所以我們人手重裝它

  2. 放好 File

System File

  • %WINDIR%\system32\dokan2.dll                # Dokan user mode library
  • %WINDIR%\system32\dokannp2.dll            # Dokan Network Provider
  • %WINDIR%\system32\drivers\dokan2.sys  # Dokan File System Driver

Program Files (x86 / x64)

  • ProgramFilesFolder\Dokan\DokanLibrary\dokanctl.exe     # Dokan control program
  • ProgramFilesFolder\Dokan\DokanLibrary\dokan2.lib         # Dokan import library
  • ProgramFilesFolder\Dokan\DokanLibrary\dokanfuse2.lib   # Dokan Fuse static library

 3. Install

# To install Dokan driver with "dokanctl.exe /i d"

C:\Program Files\Dokan\Dokan Library-1.2.2.1000>dokanctl.exe /i d

Driver path: 'C:\WINDOWS\system32\drivers\dokan1.sys'
Installing driver...
DokanServiceInstall: Service (Dokan1) installed
DokanServiceControl: Service (Dokan1) started
DokanServiceInstall: Service (Dokan1) started
Driver installation succeeded!

# If you want to mount network drive. Install Dokan network provider with "dokanctl.exe /i n"

C:\Program Files\Dokan\Dokan Library-1.2.2.1000>dokanctl.exe /i n

Driver path: 'C:\WINDOWS\system32\drivers\dokan1.sys'
network provider install ok

 


yasfw

 

mounting an arbitrary remote directory as root directory.

https://github.com/DDoSolitary/yasfw

* v0.1.2 require Dokan v1.5 on Win10

Basic

cd C:\tools\yasfw

# 會 mount remote 的 "/"

yasfw.exe --mount-point A --server x.x.x.x --removable --user user

# umount

Ctrl+C

i.e.

yasfw.exe --mount-point A --removable --server 192.168.123.11 --user tim

Adv.

chroot

-C, --chroot <DIR>                 Use the specified directory as root directory.

yasfw.exe --mount-point A --removable --server 192.168.123.11 ^
          --user tim ^
          --chroot /home/vhosts/datahunter

認證

-P, --use-pageant    Try to authenticate using putty's pageant.
-k, --key <KEY_FILE>...            Private key file.

yasfw.exe --mount-point A --removable --server 192.168.123.11 ^
               --user tim --key C:\Users\tim\keys\tools.txt ^
               --chroot /home/vhosts/datahunter

Other Opts

-p, --port <PORT>          # Server port. [default: 22]

-c, --compress                # Enable compression.

Speedtest

 ~ 2.8 MB/s

用 "--compress" 時只有 2.2 MB/s

mount.bat

@echo off & cls

set server=192.168.123.11
set chroot=/home/vhosts/datahunter
set user=tim
set key=C:\Users\tim\keys\tools.txt
set yasfw=C:\tools\yasfw\yasfw.exe

%yasfw% --mount-point A --removable ^
        --server %server% --user %user% ^
        --chroot %chroot% --key %key%