How to mount your Google Drive on Linux with google-drive-ocamlfuse
If you prefer a GUI tool, you've got Insync. If you prefer the command line, there are tools such as Grive2 and the incredibly easy to use FUSE-based system written in Ocaml. I'll show how to use the latter to mount your Google Drive account on your Linux desktop. Although it's done via the command line, you'll be surprised at how easy it is to pull off. It's so easy, anyone can do it.
This system features:
- Full read/write access to ordinary files/folders
- Read-only access to Google Docs, sheets, and slides
- Access to your Drive's Trash (.trash) Directory
- Duplicate file handling
- Support for multiple accounts
- Open a terminal window.
- Add the necessary PPA with the command sudo add-apt-repository ppa:alessandro-strada/ppa.
- When prompted, type your sudo password and hit Enter.
- Update app with the command sudo apt-get update.
- Install the software by issuing the command sudo apt-get install google-drive-ocamlfuse.
AuthorizationThe next step is to authorize google-drive-ocamlfuse so it will have access to your Google account. To do this, go back to the terminal window and issue the command google-drive-ocamlfuse. This command will open a browser window that will either prompt you to log into your Google account or, if you're already logged in, ask you to allow google-drive-ocamlfuse access to your Google account. If you've not logged in, do so and then click Allow. The next window (which appeared on a Ubuntu 16.04 desktop, but not an Elementary OS Freya desktop) will ask you to grant permission for both gdfuse and OAuth2 Endpoint to access your Google account. Click Allow again. The next browser screen will inform you to wait until the authorization tokens have downloaded; you can minimize the browser at this point. When your terminal prompt returns (Figure A), you know the tokens have been downloaded, and you're ready to mount.
Mounting your Google DriveBefore you mount your Google Drive, you must create a folder to serve as the mount point. From the terminal, issue the command mkdir ~/google-drive to create a new folder in your home directory. Finally, issue the command google-drive-ocamlfuse ~/google-drive to mount your Google Drive to the google-drive folder.
When you want to unmount the google-drive folder, issue the command fusermount -u ~/google-drive.
It's no GUI, but it works like a champI find this particular system really handy to use. It's incredibly fast at syncing with Google Drive, and it can make for an elegant means of backing up your Google Drive account locally.
Give google-drive-ocamlfuse a go, and see what kind of magic you can make with it.
- Need to free up disk space? Now Google Drive lets you pick which folders to sync (ZDNet)
- How to sync your Google Cloud on Linux with Grive2 (TechRepublic)
- How to make the most out of Google Drive on GNOME (TechRepublic)
- How to work offline with Google Drive files (TechRepublic)
- How to blacklist files and folders in Insync to prevent filling up Google Drive (TechRepublic)
- Job description: Cloud engineer (Tech Pro Research)
Google 还没有发行 Linux 版本的 Google Drive程序，尽管现在有很多方法从 Linux 中访问你的 GOOGLE Drive。
- 对于 Google Docs，sheets，slides 这三个应用只读
- 能够访问 Drive 回收站（.trash）
sudo add-apt-repository ppa:alessandro-strada/ppa命令添加必要的 PPA
- 出现提示的时候，输入你的 root 密码并按下回车。
sudo apt-get update命令更新应用。
sudo apt-get install google-drive-ocamlfuse命令安装软件。
google-drive-ocamlfuse， 这个命令将会打开一个浏览器窗口，它会提示你登陆你的 Google 帐号或者如果你已经登陆了 Google 帐号，它会询问是否允许 google-drive-ocamlfuse 访问 Google 账户。如果你还没有登录，先登录然后点击“允许”。接下来的窗口（在 Ubuntu 16.04 桌面上会出现，但不会出现在 Elementary OS Freya 桌面上）将会询问你是否授给 gdfuse 和 OAuth2 Endpoint 访问你的 Google 账户的权限，再次点击“允许”。然后出现的窗口就会告诉你等待授权令牌下载完成，这个时候就能最小化浏览器了。当你的终端提示如下图一样的内容，你就能知 道令牌下载完了，并且你已经可以挂载 Google Drive 了。
挂载 Google Drive
google-drive-ocamlfuse ~/google-drive将你的 Google Drive 挂载到 google-drive 文件夹中。
fusermount -u ~/google-drive。