378 字
2 分钟
Debian挂载Google Drive
安装google-drive-ocamlfuse
挂载Google Drive还是用google-drive-ocamlfuse,比较舒服。试过rclone,复制和移动命令总有各种问题。
以下操作默认以root用户登陆。
安装OPAM
apt install vim sudo software-properties-common ocamlapt install opam初始化OPAM
opam init更新OPAM
opam update安装外部依赖
opam install depextopam 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-drivegoogle-drive-ocamlfuse -label me /home/google-drive如果出现错误:
fuse: mountpoint is not emptyfuse: 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### 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 0EOF然后赋予权限
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' Debian挂载Google Drive
https://yushum.com/posts/debian挂载google-drive/