此方法来源于用户不想在网络路径下显示smb分区,而想类似物理硬盘分区那样在Windows的设备和驱动器位置进行显示。

我在之前写了个Windows挂载SMB分区作为物理硬盘的教程


这个的优点就是速度快,可以将软件安装进去,缺点就是不能动态减小使用的分区容量,因此,在这里我使用rclone来实现类似的功能。

环境

安装软件

本系统为Windows 64位系统。
需要下载安装Windows版RcloneWinFsp、SSHFS-Win(x64)、NFS-Win(x86)、golang

配置环境变量

你可以用完整路径来输入命令,我这里是测试。
因此我将rclone的二进制文件直接放入文件夹C:\Windows\system32中可以直接执行命令。
当然也可以在编辑系统变量 - 编辑Path环境变量,新增Rclone的路径,这样可以直接在cmd内执行命令。
不能用管理员权限执行,请用普通用户权限的cmd来执行。

C:\Users\ZETTAKIT>rclone --version
rclone v1.57.0
- os/version: Microsoft Windows 10 Enterprise 2009 (64 bit)
- os/kernel: 10.0.19043.1237 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.2
- go/linking: dynamic
- go/tags: cmount

连接smb

按照正常的方式进行连接smb即可。
这里是\\192.168.99.150\zOceanNAS

映射

配置

按照常规的rclone的方式进行配置

C:\Users\ZETTAKIT>rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> alias
Option Storage.
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value.
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
..............
45 / seafile
   \ "seafile"
Storage> 2
Option remote.
Remote or path to alias.
Can be "myremote:path/to/dir", "myremote:bucket", "myremote:" or "/local/path".
Enter a string value. Press Enter for the default ("").
remote> \\192.168.99.150\zOceanNAS\
--------------------
[alias]
type = alias
remote = \\192.168.99.150\zOceanNAS\
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y
Current remotes:

Name                 Type
====                 ====
alias                alias

e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
e/n/d/r/c/s/q> q

测试

C:\Users\ZETTAKIT>rclone lsf alias:
share/

可以正常显示即可

挂载

具体参数可以查官方文档,我在这里关掉--vfs-cache-mode是因为我smb速度比我本地硬盘速度快,不需要缓存。

rclone mount alias:/ * --cache-dir C:\smb  --vfs-cache-mode off

效果如下所示:
挂载smb连接为本地硬盘


参考:
Windows平台下使用 Rclone 挂载 OneDrive 为本地硬盘
使用rclone在Windows下挂载Google个人/团队云盘
WINFSP
golang
Configure SMB share permanently in rclone.conf
rclone mount
Alias

最后修改:2022 年 02 月 23 日
如果觉得我的文章对你有用,请随意赞赏