Debian挂载Google Drive

安装google-drive-ocamlfuse

挂载Google Drive还是用google-drive-ocamlfuse,比较舒服。试过rclone,复制和移动命令总有各种问题。
以下操作默认以root用户登陆。

安装OPAM

apt install vim sudo software-properties-common ocaml
apt install opam

初始化OPAM

opam init

更新OPAM

opam update

安装外部依赖

opam install depext
opam depext google-drive-ocamlfuse

安装google-drive-ocamlfuse

opam install google-drive-ocamlfuse

至此google-drive-ocamlfuse安装完成。

挂载

进入到Google Drive获取一个API,类型选择“其他”。接着输入以下命令绑定Google Drive的API。

sudo apt install xdg-utils --fix-missing

将client-ID、client-secret 替换为自己的。

google-drive-ocamlfuse -headless -label me -id client-ID -secret client-secret

之后会出现一行链接,复制、粘贴到浏览器,打开

mkdir /home/google-drive
google-drive-ocamlfuse -label me /home/google-drive

如果出现错误:

fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option

使用以下命令

google-drive-ocamlfuse -label me /home/google-drive -o nonempty

设置开机自启动

google-drive-ocamlfuse没有自启动的服务,因此需要手工添加,推荐添加命令到/etc/rc.local文件,但是Debian 9默认不带etc/rc.local文件,而rc.local服务却还是自带的。
一次复制以下命令并执行

cat </etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

exit 0
EOF

然后赋予权限

chmod +x /etc/rc.local

接着启动rc-local服务

systemctl start rc-local

然后添加以下命令到/etc/rc.local,放在exit 0前面即可。

su root -l -c 'google-drive-ocamlfuse -label me /home/gdrive'
实用教程

旧笔记本改造记

2021-8-25 21:04:02

实用教程

Debian 10 系统/网络参数优化

2018-10-19 16:35:00

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索