rclone使用二:将onedrive挂载到Linux系统的vps

优点:提升空间大小,onedrive也有比较便宜的(非个人版5T or 1T)
缺点:较为依赖网速,性能上肯定没物理的加硬盘好
当前环境:vps:Debain系统(Ubuntu命令相同),本地:Windows,vps上已安装rclone
没安装rclone的请看 rclone使用一:安装
1、由于在无桌面版Linux系统下,可能无法获取授权等内容,可以通过本地下载(windows环境)rclone获取access_token解决
下载windows版(下载地址:https://rclone.org/downloads/),解压到D盘(其他也可以,只是要修改路径)。
当前目录为

D:\rclone

以管理员模式打开cmd(win+R可能会出现权限问题),输入

cd /d d:\rclone
rclone authorize "onedrive"

2、输入上述命令后,会弹出浏览器访问,到登录账号后,绑定,cmd窗口会出现access_token内容,如:

{"access_token":xxxxxxxxxxx}

保存一下你的access_token,后面会用到
3、在Linux上输入以下命令配置

rclone config

4、第一次会出现,选择n

n) New remote s) Set configuration password q) Quit config

5、name随便填,但是要记住,演示使用name为od
6、选择你想绑定的网盘序号(不同版本序号可能不一样),找到显示以下内容的序号,输入

/ Microsoft OneDrive \ "onedrive"

7、此时会提示输入Client Id 和Client Secret,全都留空(输入回车即可)
8、可能还会出现版本选择或者Use auto config等选项,根据实际情况选择,Use auto config一般选择No
9、出现result的时候,粘贴之前保存的{"access_token":xxxxxxxxxxx},回车,无错误的情况下,会出现

y) Yes this is OK e) Edit this remote d) Delete this remote

10、选择y,最后还会出现以下内容,选择q退出(如需再添加请输入rclone config)

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

11、新建文件夹(这个文件夹将会成为本地显示文件夹),mkdir 路径,这里演示为root下新建onedrive文件

mkdir /root/onedrive

12、挂载磁盘,演示name为od,本地文件为/root/onedrive,网盘目录为根目录/的情况,下面命令可能会出现你再输入别的命令,不能运行的问题(解决可参考后台screen运行,或者开机自启部分)

rclone mount od:/ /root/onedrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000

如出现fuse错误,大概率是因为没安装fuse,输入下面命令解决,再运行上述命令(以Debain为例)

apt-get install fuse

如是centos系统使用

yum install fuse

13、查看是否挂载成功,挂载成功后会多显示你的挂载名和路径,大小

df -h

14、如果不需要了可以卸载掉

fusermount -qzu 本地文件路径
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章