之前折腾了学人家折腾onedrive,听说可以挂载到电脑上当磁盘,所以百度了一番,了解到了一个工具Rclone(是一款的命令行工具,支持在不同对象存储、网盘间同步、上传、下载数据)这个工具可以挂载好多,比如阿里云oss/腾讯云cos/FTP/SSH SFTP/webdav/onedrive/Google Drive/Google Photos等等好多都可以挂载到电脑当本地磁盘。

下载必备工具

1.Rclone 在这里下载https://rclone.org/downloads/
2.WinFsp 在这里下载http://www.secfs.net/winfsp/rel/

安装和设置工具

1.一路向西系列WinFsp:下载后直接一直下一步安装到完成就好,不需要做什么选择。
2.需手动撸系列Rclone:下载后解压,接下来就是要动手的地方了!抽根烟压压惊!!
boxmoe.com

NOTE:下面步骤很关键,最好用8倍镜查看

1.将Rclone添加到系统环境变量中
1.右键 计算机-选择 属性-选择 高级系统配置-点击 高级 这个界面在下方就有一个【环境变量】,点击进入接下面步骤
2.在 系统变量 里 找到变量名为 Path 双击或者点击编辑,添加Rclone解压后的路径,比如我(C:\rclone)
到此完成基本设定!

开始运行工具配置挂载

可以使用 powershell 或者cmd 执行配置挂载
开始执行命令

#输入命令 rclone config
using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>n  //n是创建一个挂载
name> Txcos //自己命名标识等下要用到

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"
........
Storage> 4 //这里是挂载阿里云OSS或者腾讯云COS 都是输入4

Choose your S3 provider.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Amazon Web Services (AWS) S3
   \ "AWS"
........
provider> 11 //挂载腾讯云COS输入11 挂载阿里云OSS输入2
Get AWS credentials from runtime (environment variables or EC2/ECS meta data if
no env vars).
Only applies if access_key_id and secret_access_key is blank.
Enter a boolean value (true or false). Press Enter for the default ("false").
Choose a number from below, or type in your own value
 1 / Enter AWS credentials in the next step
   \ "false"
 2 / Get AWS credentials from the environment (env vars or IAM)
   \ "true"
env_auth> 1  //输入1
AWS Access Key ID.
Leave blank for anonymous access or runtime credentials.
Enter a string value. Press Enter for the default ("").
access_key_id> ******  //输入腾讯云或者阿里云的access_key_id,自己控制面板获取
AWS Secret Access Key (password)
Leave blank for anonymous access or runtime credentials.
Enter a string value. Press Enter for the default ("").
secret_access_key> ******  //输入腾讯云或者阿里云的secret_access_key,自己控制面板获取
Endpoint for Tencent COS API.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Beijing Region.
   \ "cos.ap-beijing.myqcloud.com"
........
endpoint> 4 //选择你的存储节点,如果 北京 广州...等等看拼音或者对链接选择对应数字
........
Note that this ACL is applied when server-side copying objects as S3
doesn't copy the ACL from the source but rather writes a fresh one.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Owner gets Full_CONTROL. No one else has access rights (default).
   \ "default"
........
acl> 2 //选择存储桶的全新, 1是私有读写 2是私写公读 3是全开放
The storage class to use when storing new objects in Tencent COS.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
 1 / Default
   \ ""
 2 / Standard storage class
   \ "STANDARD"
 3 / Archive storage mode.
   \ "ARCHIVE"
 4 / Infrequent access storage mode.
   \ "STANDARD_IA"
storage_class>
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n //输入n
Remote config
--------------------
[Txcos]
type = s3
provider = TencentCOS
env_auth = false
access_key_id = 我是马赛克
secret_access_key = 我是马赛克
endpoint = cos.ap-guangzhou.myqcloud.com
acl = public-read
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y //输入y
Current remotes:

Name                 Type
====                 ====
Txcos                 s3

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 //输入q退出

OK到这里就结束了挂载第一步,总结下输入命令哪些
1.启用工具 rclone config
2.创建挂载 n
3.输入标识盘符 (第二步要用到)
4.选择挂载类型 4
5.选择挂载产品 挂载腾讯云COS输入11 挂载阿里云OSS输入2
6.输入 1
7.输入access_key_id
8.输入secret_access_key
9.选择节点
10.选择读写权限
11.输入 1
12.输入 n
13.输入 y
14.输入 1

开始挂载上存储盘到本地,继续输入

rclone mount Txcos:/ F: --cache-dir D:\boxmoe_Cache --vfs-cache-mode writes
//Txcos 是第一步第三输入rclone标识盘符
//F:是挂载的本地磁盘盘符A-Z自己输个没占用的 
//D:\boxmoe_Cache 是缓存的位置

这种是临时挂载,如果把cmd 或者 powershell关了也就消失!如果要长期可用自动挂载则可以用以下操作(来源网络https://blog.rhilip.info/archives/874/)

在你之前解压的rclone目录下新建一个文本文件,填入以下内容,请注意修改倒数第二行的WS.Run中相关命令为你上步成功执行的命令,然后将该文件名改为rclone.vbs (后缀名为.vbs即可)

Dim WMIService, Process, Processes, Flag, WS
Set WMIService = GetObject("winmgmts:{impersonationlevel=impersonate}!\\.\root\cimv2")
Set Processes = WMIService.ExecQuery("select * from win32_process")
Flag = true
for each Process in Processes
    if strcomp(Process.name, "rclone.exe") = 0 then
        Flag = false
        exit for
    end if
next
Set WMIService = nothing
if Flag then
    Set WS = Wscript.CreateObject("Wscript.Shell")
    WS.Run "rclone mount Txcos:/ F: --cache-dir D:\boxmoe_Cache --vfs-cache-mode writes", 0
end if

完成后双击运行,你会看到X盘挂载成功

到此就全都完成结束了,当然你还可以用Rclone挂载 FTP 之类的,重复上面的操作按提示操作就可以
boxmoe.com