皇冠官网

VPS掛載 Google Drive 無限存儲

掛載 Google Drive 無限存儲到VPS本地,當本地硬盤使用。
準備環境:
VPS一臺。至少512M內存,硬盤要求不高,但是最好10G以上。本教程基于CENTOS 7

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 http://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
http://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