在vps上挂载google drive,享受无限空间

Author Avatar
yiheng 2018年06月27日
  • 在其它设备中阅读本文章

前言

之前搞了个edu邮箱,就注册了一个无限空间的google drive,当然要最大程度利用喽

由于是先折腾了再记录下来,有些地方可能会有错误 敬请谅解

安装rclone

google搜索时看到一个大佬写了个脚本 这样就很方便

wget https://www.moerats.com/usr/shell/rclone_debian.sh && bash rclone_debian.sh

初始化

rclone config
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q>

选n

name>

输入一个名字 比如moe

Type of storage to configure.
Choose a number from below, or type in your own value
 1 / Alias for a existing remote
   \ "alias"
 2 / Amazon Drive
   \ "amazon cloud drive"
 3 / Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)
   \ "s3"
 4 / Backblaze B2
   \ "b2"
 5 / Box
   \ "box"
 6 / Cache a remote
   \ "cache"
 7 / Dropbox
   \ "dropbox"
 8 / Encrypt/Decrypt a remote
   \ "crypt"
 9 / FTP Connection
   \ "ftp"
10 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
11 / Google Drive
   \ "drive"
12 / Hubic
   \ "hubic"
13 / Local Disk
   \ "local"
14 / Mega
   \ "mega"
15 / Microsoft Azure Blob Storage
   \ "azureblob"
16 / Microsoft OneDrive
   \ "onedrive"
17 / OpenDrive
   \ "opendrive"
18 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
19 / Pcloud
   \ "pcloud"
20 / QingCloud Object Storage
   \ "qingstor"
21 / SSH/SFTP Connection
   \ "sftp"
22 / Webdav
   \ "webdav"
23 / Yandex Disk
   \ "yandex"
24 / http Connection
   \ "http"
Storage>

选择11

Google Application Client Id - leave blank normally.
client_id>
Google Application Client Secret - leave blank normally.
client_secret>

两个留空

Scope that rclone should use when requesting access from drive.
Choose a number from below, or type in your own value
 1 / Full access all files, excluding Application Data Folder.
   \ "drive"
 2 / Read-only access to file metadata and file contents.
   \ "drive.readonly"
   / Access to files created by rclone only.
 3 | These are visible in the drive website.
   | File authorization is revoked when the user deauthorizes the app.
   \ "drive.file"
   / Allows read and write access to the Application Data folder.
 4 | This is not visible in the drive website.
   \ "drive.appfolder"
   / Allows read-only access to file metadata but
 5 | does not allow any access to read or download file content.
   \ "drive.metadata.readonly"
scope>

视情况 我选了1

ID of the root folder - leave blank normally.  Fill in to access "Computers" folders. (see docs).
root_folder_id>
Service Account Credentials JSON file path  - leave blank normally.
Needed only if you want use SA instead of interactive login.
service_account_file>

留空

Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n>

如果是家用电脑上挂载 选y vps上则选n
然后打开链接 输入获取的verification code

挂载

rclone mount moe: /mnt/gd --allow-other --allow-non-empty --vfs-cache-mode writes

其中 /mnt/gd是你要挂载的位置
然后就挂载成功了,但是退出后会停止挂载
可以用一个screen套住 或者nohup 方法很多

取消挂载

fusermount -qzu LocalFolder
    Felix
    Felix  2018-11-25, 14:46

    yiheng 的 VPS 挂载之后读写速度大概怎样呢?大概是我这里滥用的人太多了,读写速度不到 1 MiB/s,存个备份还是可以的。