一 ,领取无限量团队盘
谷歌网盘免费空间是15GB,不过有人共享开团队盘,理论上是无限容量。
链接为王大佬持续更新的团队盘申请地址 https://wangdalao.com/1949.html
填写想要的团队名字 还有云端硬盘的邮箱 申请后等一会就自动加入了
二,安装rclone
Centos7安装很简单
# 安装依赖
yum -y install wget unzip screen fuse fuse-devel
# 安装rclone
yum -y install rclone
三,配置rclone
配置比较复杂一些,完全跟着下面教程输入命令就不会错了 首先执行配置命令
[root@us ~]# rclone config
2019/11/24 10:09:06 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults
No remotes found - make a new one
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> remote
输入n,remote。创造新的remote,名称是remote
Type of storage to configure.
Enter a string value. Press Enter for the default ("").
Choose a number from below, or type in your own value
1 / A stackable unification remote, which can appear to merge the contents of several remotes
"union"
2 / Alias for a existing remote
"alias"
3 / Amazon Drive
"amazon cloud drive"
4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
"s3"
5 / Backblaze B2
"b2"
6 / Box
"box"
7 / Cache a remote
"cache"
8 / Dropbox
"dropbox"
9 / Encrypt/Decrypt a remote
"crypt"
10 / FTP Connection
"ftp"
11 / Google Cloud Storage (this is not Google Drive)
"google cloud storage"
12 / Google Drive
"drive"
13 / Hubic
"hubic"
14 / JottaCloud
"jottacloud"
15 / Koofr
"koofr"
16 / Local Disk
"local"
17 / Mega
"mega"
18 / Microsoft Azure Blob Storage
"azureblob"
19 / Microsoft OneDrive
"onedrive"
20 / OpenDrive
"opendrive"
21 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
"swift"
22 / Pcloud
"pcloud"
23 / QingCloud Object Storage
"qingstor"
24 / SSH/SFTP Connection
"sftp"
25 / Webdav
"webdav"
26 / Yandex Disk
"yandex"
27 / http Connection
"http"
Storage> 12
输入12。选择Google Drive
** See help for drive backend at: https://rclone.org/drive/ **
Google Application Client Id
Setting your own is recommended.
See https://rclone.org/drive/#making-your-own-client-id for how to create your own.
If you leave this blank, it will use an internal key which is low performance.
Enter a string value. Press Enter for the default ("").
client_id>
输入空,直接回车。使用rclone的client_id启动google api,这个client_id用的人肯定比较多,用的太多会被限制,不过先用着吧,后面可以根据https://rclone.org/drive /#making-your-own-client-id创建自己的client_id
Google Application Client Secret
Setting your own is recommended.
Enter a string value. Press Enter for the default ("").
client_secret>
描述:输入空,直接回车。使用rclone的client_secret,和上面的一样
Scope that rclone should use when requesting access from drive.
Enter a string value. Press Enter for the default ("").
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
输入1。有最大的使用权限。
ID of the root folder
Leave blank normally.
Fill in to access "Computers" folders. (see docs).
Enter a string value. Press Enter for the default ("").
root_folder_id>
输入空,直接回车。空是跟路径,如果想用别的根路径,到google网盘页面打开那个文件夹,上面的链接是https://drive.google.com/drive/folders/1E8NDZ9OTGSM72eP0kiPG0gQoZ0RzOtyV,这儿输入最后的那部分就好了,1E8NDZ9OTGSM72eP0kiPG0gQoZ0RzOtyV。
Service Account Credentials JSON file path
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Enter a string value. Press Enter for the default ("").
service_account_file>
输入空,直接回车
Edit advanced config? (y/n)
y) Yes
n) No
y/n> n
输入n。不用别的高级配置。
Remote config
Use auto config?
* Say Y if not sure
* Say N if you are working on a remote or headless machine
y) Yes
n) No
y/n> n
输入n。因为我们是vps操作,不能auto config。
If your browser doesn't open automatically go to the following link: https://accounts.google.com/o/oauth2/auth?access_type=offline&client_id=202264815644.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive&state=e0bb55f32e81360bc1d383ec5bbc08cc
Log in and authorize rclone for access
Enter verification code> 4/tgEm4WM9FWvI4yZjiwLvw-52zlCpVZGx7AQBLCdGLI_Er7-NuempcXM
输入上方的链接授权访问,最后会获取身份验证码,像4 / tgEm4WM9FWvI4yZjiwLvw-52zlCpVZGx7AQBLCdGLI_Er7-NuempcXM。
Configure this as a team drive?
y) Yes
n) No
y/n> y
输入y。因为我们之前领取了团队盘
Fetching team drive list...
Choose a number from below, or type in your own value
1 / siyou325
"0AFyEOkup0ciMUk9PVA"
Enter a Team Drive ID> 1
输入1.选择我们的团队盘。
--------------------
[remote]
type = drive
scope = drive
token = {"access_token":"ya29.Il-yB6QCh3vuBT9AyGwo69FLusoNzQBTYfR15HFtrPIlY38U4DNYkxPd7wmbbGInRM3Uwj2sN0OvIO0hjrX32tZuIScFpp_N4MKt1zeG8jj-dY2zCBrpqhe2LPB9GiEcPA","token_type":"Bearer","refresh_token":"1//06y1obaMxj9XNCgYIARAAGAYSNwF-L9IrPLszAaTSCd5WDRLSBO3ohK6xl8xkJwHuSmI_r4KLeaopjXscdaJkRl9ZlbURLfenSSs","expiry":"2019-11-24T11:10:48.072564672+08:00"}
team_drive = 0AFyEOkup0ciMUk9PVA
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
输入y。配置好了
Current remotes:
Name Type
==== ====
remote drive
e) Edit existing remote
n) New remote
d) Delete remote
r) Rename remote
c) Copy remote
s) Set configuration password
q) Quit config
输入:
e/n/d/r/c/s/q> q
输入q。退出配置
设置好的配置会保存在/root/.config/rclone/rclone.conf
四,挂载gdrive
配置好,后面就好操作了
挂载网盘下的文件目录到本地 /mnt/gdrive,执行以下命令就好了
mkdir -p /mnt/gdrive
rclone mount remote:files /mnt/gdrive --allow-other --allow-non-empty --vfs-cache-mode writes
五,测试挂载是否成功以及开机自启
进入刚刚挂载的目录 /mnt/gdrive 新建一个文件,看看google drive是否同步,同步就挂载成功, 别急 还没完 我们需要把它弄成开机自启
我们在/etc/rc.d/rc.local
文件里添加如下语句,调用需要执行的命令:
rclone mount remote:files /mnt/gdrive --allow-other --allow-non-empty --vfs-cache-mode writes
重启测试,完工!
六,如果 fuse 报错 尝试以下命令
mknod -m 666 /dev/fuse c 10 229
评论前必须登录!
注册