小硬盘VPS挂载 Google Drive 无限存储, 秒变大盘鸡。

准备环境:
VPS一台。至少512M内存,硬盘要求不高,但是最好10G以上。本教程基于CENTOS 7
本文使用的是搬瓦工VPS,还没有VPS 的朋友推荐使用搬瓦工VPS
新手用户搬瓦工VPS购买图文指导教程

CENTOS 7 下装 Google-drive-ocamlfuse 过程
1、安装必要组件
yum install -y git
yum install -y hg
yum install -y sqlite-devel fuse fuse-devel libcurl-devel zlib-devel m4

2、安装opam
yum install -y ocaml ocamldoc ocaml-camlp4-devel
wget https://raw.github.com/ocaml/opam/master/shell/opam_installer.sh -O - | sh -s /usr/local/bin/
opam init
Do you want OPAM to modify ~/.bash_profile and ~/.ocamlinit?
(default is 'no', use 'f' to name a file other than ~/.bash_profile)

看到以上提示记得选 Y
3、安装google-drive-ocamlfuse
opam install google-drive-ocamlfuse
source ~/.bash_profile
4、google-drive-ocamlfuse常用命令
google-drive-ocamlfuse --help
5、获取Google Drive API
https://console.developers.google.com/apis/api/drive.googleapis.com

6、client-ID、client-secret 替换为自己的在VPS中运行。
google-drive-ocamlfuse -headless -label me -id client-ID -secret client-secret
之后会出现一行链接,复制、粘贴到浏览器,打开
确认之后得到 verification code 贴入SSH运行
7、挂载Google Drive
mkdir /home/Cloud
google-drive-ocamlfuse -label me /home/Cloud
8、添加开机启动
echo 'google-drive-ocamlfuse -label me /home/Cloud' >> /etc/rc.d/rc.local
chmod +x /etc/rc.d/rc.local

测试速度

dd if=/dev/zero of=/home/Cloud/1 bs=1024 count=1k​


Leave a Comment