CentOS 7 如何挂载 Google Drive

标签: none

一、背景

Google Drive 即 GDrive 是谷歌家的云盘产品,官方网站:https://drive.google.com,新注册账号默认 15G 免费,教育版无限空间,官方支持 Windows、iOS、Android 客户端同步,那么如何在 Linux 下使用谷歌的超大云盘呢?

二、安装

本教程基于 CentOS 7.3
相关软件版本:pip 8.1.2/python 2.7.5
项目主页:dsoprea/GDriveFS

1、安装依赖

# yum -y install gcc gcc-c++ python-devel libxslt-devel libffi-devel openssl-devel fuse fuse-devel
# 大便环境安装命令
apt-get install python-pip build-essential python-dev 

2、安装 Google API

# git clone https://github.com/google/google-api-python-client
# cd google-api-python-client
# python setup.py install
# python setup.py install_egg_info

3、安装 GDriveFS

# pip install gdrivefs

三、使用

1、登录

# gdfstool auth -u
To authorize FUSE to use your Google Drive account...

将显示的 URL 贴到网页,会显示授权页面,授权后显示授权码,拷贝完整授权码待用

# gdfstool auth -a /var/cache/gdfs.creds "刚拷贝的完整授权码"
Authorization code recorded

2、挂载

# mkdir /mnt/gdrivefs
# gdfstool mount /var/cache/gdfs.creds /mnt/gdrivefs

四、问题摘要

1、问:greenlet.h:8:20: fatal error: Python.h: No such file or directory
答:

#  yum install python-devel -y

2、问:OSError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/google_api_python_client-1.6.2-py2.7.egg'
答:

# yum install libffi-devel -y

3、问:ImportError: cannot import name util
答:

# pip install oauth2client==2.2.0

注:可能会提示:OSError: [Errno 2] No such file or directory: '/usr/lib/python2.7/site-packages/oauth2client-4.1.1-py2.7.egg',可无视,因为我们装的是 2.2.0 版本。

https://blog.vircloud.net/linux/how-mount-gdrive.html


扫描二维码,在手机上阅读!

已有 4 条评论

  1. 龟速 龟速

    [root@host google-api-python-client]# mkdir /mnt/gdrivefs
    [root@host google-api-python-client]# gdfstool mount /var/cache/gdfs.creds /mnt/gdrivefs
    WARNING: This subcommand is obsolete. Use the 'gdfs' command directly.

    [root@host google-api-python-client]# gdfs mount /var/cache/gdfs.creds /mnt/gdrivefs
    usage: gdfs [-h] [-o OPT] [-v] auth_storage_filepath mountpoint
    gdfs: error: unrecognized arguments: /mnt/gdrivefs

    看到报错做其他事,回来看看糊里糊涂的,不知道是那一步就挂载上了。

    1. 一定要使用的话 建议从github上面找使用说明

    2. WARNING: This subcommand is obsolete.

      这里可以看出 这篇文章不适用新版本的 挂载程序.
      我之后也没在更新过这个挂载了, 当时有些功能用着不是很方便就没继续使用了.
      找到了个新的程序 rclone 可以满足我的需求.

      1. 龟速 龟速

        好的,现在挂上了先懒得管它,出了问题再换掉。
        看你这文章前有看到rclone,那个教程看的有点眼花就换了

添加新评论