WIN10下使用RCLONE将ONEDRIVE映射到本地磁盘教程(开机自动挂载)

前言

onedrive云盘是微软推出的云储存空间服务,相比于百度云,没有会员限制,有着较快的下载上传速度。采用Rclone软件可将onedrive映射为电脑本地,成为电脑上的一个(云)磁盘空间,便于使用,且Rclone支持全平台,能够在不同操作系统上对onedrive进行挂载。

本文主要介绍win10下使用RcloneOneDrive映射到本地磁盘,并且实现了win10系统开机自动挂载,有效解决了电脑重启后onedrive挂载盘丢失需要重新手动挂载的问题。

最终得到的效果如图所示(5T onedrive磁盘)
od_01.png

下载RCLONEWINFSPGIT BASH

首先需要下载和安装挂载所需的软件和辅助工具。
一共有3个:
Rclone:https://github.com/rclone/rclone/releases
Winfsp:https://github.com/billziss-gh/winfsp/releases
Git bash:https://gitforwindows.org/

Rclone点击链接进入下载网址,可以看到有许多不同的版本,适用于Windows系统有rclone-v1.57.0-windows-amd64.ziprclone-v1.57.0-windows-386.zip,根据自己电脑是64位的还是32位的对应选择合适的压缩包下载。
od_02.png
我的电脑是64位的系统,所以下载红框圈出的压缩包,rclone-v1.57.0-windows-amd64.zip

下载完成之后,将压缩包解压到一个全英文的目录下,例如我解压到了C:\rclone
od_03.png

WinfspGit bash下载之后直接安装即可,无需修改安装位置,一路按默认的点下去就可。

配置RCLONE

安装好这几个软件后,开始配置Rclone

1、首先修改windows系统的环境变量,将rclone的路径添加到path中:

在桌面上右键点击此电脑标志,然后点击属性->高级系统设置->环境变量->系统变量->Path
od_04.png
添加rclone文件夹的路径到path中,我电脑上rclone放置的路径在C:\rclone
od_05.png

2、修改好环境变量之后,打开windows powershell,配置rclone.config。
按键盘上的win+x,然后按a键,即可调出windows powershell

输入rclone --version,可查看rclone是否成功安装。

Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
PS C:\Windows\system32> rclone --version
rclone v1.57.0
- os/version: Microsoft Windows 10 Enterprise LTSC 2019 1809 (64 bit)
- os/kernel: 10.0.17763.1457 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.17.2
- go/linking: dynamic
- go/tags: cmount
PS C:\Windows\system32>

查看成功安装rclone后,输入rclone config,配置要加载的onedrive信息,按照下面的步骤依次进行下去。

PS C:\Windows\system32> rclone config (步骤1. 输入rclone config)
2020/04/25 13:29:37 NOTICE: Config file "C:\\Users\\dell\\.config\\rclone\\rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n (步骤2. 输入n,表示新建配置)
name> onedrive (步骤3. 命名为"onedrive",也可取其他的名字,但要与下面所使用的名字保持一致)
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"
3 / Amazon Drive
\ "amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
\ "s3"
5 / Backblaze B2
\ "b2"
6 / Box
\ "box"
7 / Cache a remote
\ "cache"
8 / Citrix Sharefile
\ "sharefile"
9 / Dropbox
\ "dropbox"
10 / Encrypt/Decrypt a remote
\ "crypt"
11 / FTP Connection
\ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
\ "google cloud storage"
13 / Google Drive
\ "drive"
14 / Google Photos
\ "google photos"
15 / Hubic
\ "hubic"
16 / In memory object storage system.
\ "memory"
17 / JottaCloud
\ "jottacloud"
18 / Koofr
\ "koofr"
19 / Local Disk
\ "local"
20 / Mail.ru Cloud
\ "mailru"
21 / Mega
\ "mega"
22 / Microsoft Azure Blob Storage
\ "azureblob"
23 / Microsoft OneDrive
\ "onedrive"
24 / OpenDrive
\ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
\ "swift"
26 / Pcloud
\ "pcloud"
27 / Put.io
\ "putio"
28 / QingCloud Object Storage
\ "qingstor"
29 / SSH/SFTP Connection
\ "sftp"
30 / Sugarsync
\ "sugarsync"
31 / Transparently chunk/split large files
\ "chunker"
32 / Union merges the contents of several remotes
\ "union"
33 / Webdav
\ "webdav"
34 / Yandex Disk
\ "yandex"
35 / http Connection
\ "http"
36 / premiumize.me
Storage> 23 (步骤4. 输入数字23,因为Microsoft OneDrive对应的类型是23)
** See help for onedrive backend at: https://rclone.org/onedrive/ **
Microsoft App Client Id
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_id> (步骤5. 按enter键跳过)
Microsoft App Client Secret
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> (步骤6. 按enter键跳过)
Edit advanced config? (y/n)
y) Yes
n) No (default)
y/n> n (步骤7. 输入n,采用默认设置)
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes (default)
n) No
y/n> y (步骤8. 输入y,采用默认设置)
If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=lcvcDmCLf1ugmaCzlEtMSA
Log in and authorize rclone for access
Waiting for code...
----------------------------------
(步骤8执行后会跳转到Microsoft OneDrive账号登录界面和授权界面,登录后在授权请求界面点击“是”)
-----------------------------------
Got code
Choose a number from below, or type in an existing value
1 / OneDrive Personal or Business
\ "onedrive"
2 / Root Sharepoint site
\ "sharepoint"
3 / Type in driveID
\ "driveid"
4 / Type in SiteID
\ "siteid"
5 / Search a Sharepoint site
\ "search"
Your choice> 1 (步骤9. 输入1,数字1对应OneDrive Personal or Business)
Found 1 drives, please select the one you want to use:
0: (personal) id=cdffcd6a2a3dc176
Chose drive to use:> 0 (步骤10. 输入0,数字0对应OneDrive个人版)
Found drive 'root' of type 'personal', URL: https://onedrive.live.com/?cid=cdffcd6a2a3dc176
Is that okay?
y) Yes (default)
n) No
y/n> y 0 (步骤11. 输入y,采用默认设置)
--------------------
[onedrive]
type = onedrive
token = {"access_token":"(隐私信息省略)*************************************************************************************
drive_id = (隐私信息省略)***************
drive_type = personal
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y (步骤12. 输入y)
Current remotes:
Name Type
==== ====
onedrive onedrive
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 (步骤13. 输入q,退出)

完成rclone配置后,挂载onedrive磁盘。
Git Bash中输入如下命令并执行(注意,末尾的&很重要,不加&的话退出git则挂载就失效了):

rclone mount onedrive:/ E: --cache-dir D:\Onedrive --vfs-cache-mode writes &

执行后,不要点Git Bash窗口的X关闭窗口,而是执行 exit 退出窗口。
到这一步,就可以在电脑上看到多出一个onedrive(E)磁盘。
但还没有结束,还需要解决电脑重启后挂载失效的问题。

开机自动挂载 (疑似无效)

采用开机自动挂载的方式,可有效解决电脑重启后onedrive磁盘消息的问题,省去重新手动挂载的麻烦。

新建两个文件,分别为rclone.batrclone.vbs

rclone.bat中写入上述挂载命令:

rclone mount onedrive:/ E: --cache-dir D:\Onedrive --vfs-cache-mode writes &

rclone.vbs设置开机自动调用cmd运行rclone.bat文件并退出cmd,写入如下代码:

CreateObject("WScript.Shell").Run "cmd /c D:/rclone.bat",0

rclone.bat文件放到D盘(或其他的盘)目录下,我放在了D盘,所以在rclone.vbs中该文件的路径就是D:/rclone.bat

rclone.vbs文件放到windows系统启动项目录下,在文件夹的路径框中输入
%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup即可进入启动项目录

至此,onedrive磁盘的挂载完成,且电脑下次开机时onedrive磁盘也不会消失

 

 

转载:WIN10下使用RCLONE将ONEDRIVE映射到本地磁盘教程(开机自动挂载) - 80后'Blog (idcfq.com)

本文作者:很多无尾熊

本文链接:https://www.cnblogs.com/gnz48/p/16269143.html

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   很多无尾熊  阅读(3480)  评论(0编辑  收藏  举报
本站已运行[1100183023 ]
欢迎光临本站,您是第2位访问者!
玉户帘中卷不去,捣衣砧上拂还来。
点击右上角即可分享
微信分享提示
💬
评论
📌
收藏
💗
关注
👍
推荐
🚀
回顶
收起
🔑
  1. 1 所念皆星河 房东的猫
  2. 2 所念皆星河 CMJ
  3. 3 热河 南京市民
  4. 4 起风了2018夏 卖辣椒也用券
  5. 5 纸短情长2018夏 烟把儿乐队
  6. 6 关于郑州的记忆 南京市民
  7. 7 定西 南京市民
  8. 8 化作樱花树 SNH48
  9. 9 化青春的约定 SNH48
  10. 10 BINGO! SNH48
  11. 11 恋爱捉迷藏 (2016 Bravery·挑战B50特殊联合公演现场) GNZ48
  12. 12 365天的纸飞机 AKB48 Team SH
  13. 13 《瞬间的永恒》夜色钢琴曲 赵海洋
  14. 14 卡农 我的野蛮女友
  15. 15 爱有天意ost 未知
  16. 16 野蛮女友ost 未知
  17. 17 野蛮女友ost 未知
  18. 18 野蛮女友ost 未知
  19. 19 野蛮女友ost 未知
  20. 20 野蛮女友ost 未知
  21. 21 我想念你...自撸管的悲伤 未知
  22. 22 在人间 未知
  23. 23 野蛮女友ost 未知
  24. 24 野蛮女友ost 未知
  25. 25 風になる つじあやの
  26. 26 潮鳴り 折戸伸治
  27. 27 青石巷 魏琮霏
  28. 28 坐在巷口的那对男女 自然卷
  29. 29 优美的小调(钢琴曲) 张宇桦
  30. 30 天之痕(钢琴版) 群星
  31. 31 花がとぶ飛ぶ 邱有句,李德奎
  32. 32 挺你 IDOL SCHOOL
  33. 33 Eternity 李墨染
  34. 34 北京东路的日子 汪源,刘千楚,徐逸昊,鲁天舒,姜玮珉,胡梦原,张鎏依,梁竞元,游彧涵,金书援,许一璇,张夙西
  35. 35 初恋サイダー Buono!
  36. 36 花朝可期——A-SOUL原创应援曲 林小暗
  37. 37 花之祭 SNH48
  38. 38 ハートサングラス 26時のマスカレイド
  39. 39 47の素敵な街へ(チーム8) AKB48
  40. 40 优美的小调(钢琴曲) 张宇桦
  41. 41 风のように S.E.N.S.
  42. 42 秋~華恋~ α·Pav
  43. 43 同窗 同窗
  44. 44 远方 同窗
  45. 45 流着泪微笑 (合唱版) 鞠婧祎,徐晨辰
  46. 46 初恋蝴蝶 中泰
  47. 47 初恋蝴蝶 jxl
关于郑州的记忆 - 南京市民
00:00 / 00:00
An audio error has occurred, player will skip forward in 2 seconds.
西雅图
18:09发布
西雅图
18:09发布
5°
南风
3级
空气质量
相对湿度
91%
今天
雨夹雪
3°/7°
周一
小雨
1°/11°
周二
小雨
1°/11°