如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

找不到分类 evilven 3周前 (09-24) 28次浏览 未收录 0个评论 扫描二维码
如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

下面我将会介绍三个用于 Linux 系统非官方开发的 Google 云端硬盘客户端。使用这些客户端,你能把 Google 云端硬盘像虚拟磁盘一样挂载到 Linux 系统。

— Sk


Google 云端硬盘[1] 是全球比较受欢迎的云存储平台. 直到 2017 年, 全球有超过 8 亿的活跃用户在使用它。即使用户数在持续增长,但直到现在 Google 还是没有发布一款可以在 Linux 平台使用的客户端。但这难不倒 Linux 社区。不时就有一些开发者给 Linux 操作系统带来一些客户端。下面我将会介绍三个用于 Linux 系统非官方开发的 Google 云端硬盘客户端。使用这些客户端,你能把 Google 云端硬盘像虚拟磁盘一样挂载到 Linux 系统。请继续阅读。

1、Google-drive-ocamlfuse

google-drive-ocamlfuse 把 Google 云端硬盘当做是一个 FUSE 类型的文件系统,它是用 OCam 语言写的。FUSE 意即用户态文件系统Filesystem in Userspace,此项目允许非管理员用户在用户空间创建虚拟文件系统。google-drive-ocamlfuse 可以让你把 Google 云端硬盘当做磁盘一样挂载到 Linux 系统。支持对普通文件和目录的读写操作,支持对 Google dock、表单和演示稿的只读操作,支持多个 Googe 云端硬盘用户,重复文件处理,支持访问回收站等等。

安装 google-drive-ocamlfuse

google-drive-ocamlfuse 能在 Arch 系统的 AUR[2] 上直接找到,所以你可以使用 AUR 助手程序,如 Yay[3] 来安装。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ yay </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">S google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse</span></code></p></li></ol>

在 Ubuntu 系统:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> add</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">repository ppa</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">alessandro</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">strada</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ppa</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> update</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> install google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse</span></code></p></li>
</ol>

安装最新的测试版本:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> add</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">apt</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">repository ppa</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">alessandro</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">strada</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">beta</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> update</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> install google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse</span></code></p></li>
</ol>

使用方法

安装完成后,直接在终端里面输入如下命令,就可以启动 google-drive-ocamlfuse 程序了:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse</span></code></p></li></ol>

当你第一次运行该命令,程序会直接打开你的浏览器并要求你确认是否对 Google 云端硬盘的文件的操作进行授权。当你确认授权后,挂载 Google 云端硬盘所需要的配置文件和目录都会自动进行创建。

如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

当成功授权后,你会在终端里面看到如下的信息。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Access</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> token retrieved correctly</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li></ol>

好了,我们可以进行下一步操作了。关闭浏览器并为我们的 Google 云端硬盘创建一个挂载点吧。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">mkdir</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

最后操作,使用如下命令挂载 Google 云端硬盘:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

恭喜你了!你可以使用终端或文件管理器来访问 Google 云端硬盘里面的文件了。

使用终端:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">ls</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

使用文件管理器:

如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

如何你有不止一个账户,可以使用 label 命令对其进行区分不同的账户,就像下面一样:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">label label </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">[</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mountpoint</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">]</span></code></p></li></ol>

当操作完成后,你可以使用如下的命令卸载 Google 云端硬盘:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ fusermount </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">u </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

获取更多信息,你可以参考 man 手册。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ google</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">drive</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">ocamlfuse </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">--</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">help</span></code></p></li></ol>

当然你也可以看看官方文档[4]和该项目的 GitHub 项目[5]以获取更多内容。

2. GCSF

GCSF 是基于 Google 云端硬盘的 FUSE 文件系统,使用 Rust 语言编写。GCSF 得名于罗马尼亚语中的“ G oogle C onduce S istem de F ișiere”,翻译成英文就是“Google Drive Filesystem”(即 Google 云端硬盘文件系统)。使用 GCSF,你可以把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux 系统,可以通过终端和文件管理器对其进行操作。你肯定会很好奇,这到底与其它的 Google 云端硬盘 FUSE 项目有什么不同,比如 google-drive-ocamlfuse。GCSF 的开发者回应 Reddit 上的类似评论[6]:“GCSF 意在某些方面更快(递归列举文件、从 Google 云端硬盘中读取大文件)。当文件被缓存后,在消耗更多的内存后,其缓存策略也能让读取速度更快(相对于 google-drive-ocamlfuse 4-7 倍的提升)”。

安装 GCSF

GCSF 能在 AUR[7] 上面找到,对于 Arch 用户来说直接使用 AUR 助手来安装就行了,例如Yay[3]

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ yay </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">S gcsf</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">git</span></code></p></li></ol>

对于其它的发行版,需要进行如下的操作来进行安装。

首先,你得确认系统中是否安装了Rust语言。

◈ 在 Linux 上安装 Rust[8]

确保 pkg-config 和 fuse 软件包是否安装了。它们在绝大多数的 Linux 发行版的默认仓库中都能找到。例如,在 Ubuntu 及其衍生版本中,你可以使用如下的命令进行安装:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">apt-get</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> install </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">y libfuse</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">dev pkg</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">config</span></code></p></li></ol>

当所有的依赖软件安装完成后,你可以使用如下的命令来安装 GCSF:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ cargo install gcsf</span></code></p></li></ol>

使用方法

首先,我们需要对 Google 云端硬盘的操作进行授权,简单输入如下命令:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ gcsf </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">login</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> ostechnix</span></code></p></li></ol>

你必须指定一个会话名称。请使用自己的会话名称来代 ostechnix。你会看到像下图的提示信息和Google 云端硬盘账户的授权验证连接。

如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

直接复制并用浏览器打开上述 URL,并点击 “allow” 来授权访问你的 Google 云端硬盘账户。当完成授权后,你的终端会显示如下的信息。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Successfully</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> logged </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">in</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Credentials</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> saved to </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">"/home/sk/.config/gcsf/ostechnix"</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li></ol>

GCSF 会把配置保存文件在 $XDG_CONFIG_HOME/gcsf/gcsf.toml,通常位于 $HOME/.config/gcsf/gcsf.toml。授权凭证也会保存在此目录当中。

下一步,创建一个用来挂载 Google 云端硬盘的目录。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">mkdir</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

之后,修改 /etc/fuse.conf 文件:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">sudo</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">vi</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">etc</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">fuse</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">conf</span></code></p></li></ol>

注释掉以下的行,以允许非管理员用 allow_other 或 allow_root 挂载选项来挂载。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">user_allow_other</span></code></p></li></ol>

保存并关闭文件。

最后一步,使用如下命令挂载 Google 云端硬盘:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ gcsf </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">mount</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">s ostechnix</span></code></p></li></ol>

示例输出:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Creating</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">and</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> populating </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">file</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> system</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">...</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">File</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> sytem created</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Mounting</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> to </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">home</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">sk</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Mounted</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> to </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">home</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">sk</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">::</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">gcsf</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">::</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">file_manager </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Checking</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">for</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> changes </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">and</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> possibly applying them</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">INFO gcsf</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">::</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">gcsf</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">::</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">file_manager </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">></span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Checking</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">for</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> changes </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">and</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> possibly applying them</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li>
</ol>

重复一次,使用自己的会话名来更换 ostechnix。你可以使用如下的命令来查看已经存在的会话:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ gcsf </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">list</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Sessions</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">:</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> ostechnix</span></code></p></li>
</ol>

你现在可以使用终端和文件管理器对 Google 云端硬盘进行操作了。

使用终端:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">ls</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

使用文件管理器:

如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国

如果你不知道自己把 Google 云端硬盘挂载到哪个目录了,可以使用 df 或者 mount 命令,就像下面一样。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">df</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">h</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Filesystem</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Size</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Used</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Avail</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Use</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="overflow-wrap: break-word;color: rgb(137, 189, 255);">Mounted</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> on</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">udev </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">968M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">968M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">dev</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">tmpfs </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">200M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1.6M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">198M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">run</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">dev</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">sda1 </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">20G</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">7.5G</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">12G</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">41</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">tmpfs </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">997M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">997M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">/dev/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">shm</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">tmpfs </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">5.0M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">4.0K</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">5.0M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">/run/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">lock</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">tmpfs </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">997M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">997M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">0</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">/sys/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">fs</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">cgroup</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">tmpfs </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">200M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">40K</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">200M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">/run/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">user</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1000</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">GCSF </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">15G</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">857M</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">15G</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">6</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">%</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="overflow-wrap: break-word;color: rgb(101, 176, 66);">/home/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">sk</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">mount</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">|</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="overflow-wrap: break-word;color: rgb(226, 137, 100);">grep</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);"> GCSF</span></code></p></li>
<li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">GCSF on </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">home</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">sk</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive type fuse </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">(</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">rw</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">nosuid</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">nodev</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">relatime</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">user_id</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1000</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">group_id</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="lit" style="overflow-wrap: break-word;color: rgb(51, 135, 204);">1000</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">allow_other</span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">)</span></code></p></li>
</ol>

当操作完成后,你可以使用如下命令来卸载 Google 云端硬盘:

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="overflow-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">$ fusermount </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">u </span><span class="pun" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">~/</span><span class="pln" style="overflow-wrap: break-word;color: rgb(184, 255, 184);">mygoogledrive</span></code></p></li></ol>

浏览GCSF GitHub 项目[9]以获取更多内容。

3、Tuxdrive

Tuxdrive 也是一个非官方 Linux Google 云端硬盘客户端。我们之前有写过一篇关于 Tuxdrive 比较详细的使用方法。可以查看如下链接:

◈ Tuxdrive: 一个 Linux 下的 Google 云端硬盘客户端[10]

当然,之前还有过其它的非官方 Google 云端硬盘客户端,例如 Grive2、Syncdrive。但它们好像都已经停止开发了。当有更受欢迎的 Google 云端硬盘客户端出现,我会对这个列表进行持续的跟进。

谢谢你的阅读。


via: https://www.ostechnix.com/how-to-mount-google-drive-locally-as-virtual-file-system-in-linux/

作者:SK[12] 选题:lujun9972 译者:sndnvaps 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出

如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国


Hacking For Fun , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何把 Google 云端硬盘当做虚拟磁盘一样挂载到 Linux | Linux 中国
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址