[LINUX] Mount google drive with google-drive-ocamlfuse

Overview

You can mount Google Drive using google-drive-ocamlfuse. Since it is "mount" rather than "synchronous", it does not overwhelm the storage capacity.

Installation

sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt-get update
sudo apt-get install google-drive-ocamlfuse

If you are told

-bash: add-apt-repository:Command not found

Let's do this

sudo apt install software-properties-common

Authentication

google-drive-ocamlfuse

Since google-drive-ocamlfuse requires authentication with a GUI browser, the following error will occur if there is no GUI environment such as VPS.

$ google-drive-ocamlfuse 
/bin/sh: 1: xdg-open: not found
/bin/sh: 1: firefox: not found
/bin/sh: 1: google-chrome: not found
Cannot retrieve auth tokens.

There are the following ways to eliminate this error

  1. Have a virtual machine at hand, create an authentication file there, and transfer it to a VPS
  2. Completed with VPS (described later)

The method for case 1 is here.

In case of 2, you need a Slack workspace. First, set up the Slack app following here, and then here Go to% 82% B3% E3% 83% 9E% E3% 83% B3% E3% 83% 89% E5% 8C% 96). that time,

--Insert read on the last line. --Save to / usr / local / bin / xdg-open instead of / usr / local / bin / slacknotify.

Then run the following command again.

google-drive-ocamlfuse

Then you will receive the authentication URL in Slack. TyyzRNGgfK8b8DN1583235404_1583235445.jpg After that, open this on your PC and log in to complete the authentication.

setup

Create a directory in a suitable location and mount it there.

mkdir ~/google-drive
google-drive-ocamlfuse /home/ubuntu/google-drive

You can now mount it.

You can check with the following command

$ df -h --total
Filesystem              Size  Used Avail Use% Mounted on
udev                    471M     0  471M   0% /dev
tmpfs                    99M  1.2M   98M   2% /run
:
google-drive-ocamlfuse   15G  3.6G   11G  24% /home/ubuntu/google-drive
total                   115G   24G   91G  20% -

Unmount

fusermount -u /home/ubuntu/google-drive

Reference source

Official repository https://github.com/astrada/google-drive-ocamlfuse

Mount Google Drive with google-drive-ocamlfuse on debian https://k-side.hatenablog.jp/entry/2016/09/05/205407

I was told that there is no add-apt-repository in Ubuntu 14.04 https://loumo.jp/wp/archive/20150626000042/

Recommended Posts

Mount google drive with google-drive-ocamlfuse
Access Google Drive with Python
How to search Google Drive with Google Colaboratory
Upload images to Google Drive with Python
Upload files to Google Drive with Lambda (Python)
Authenticate Google with Django
Drive WebDriver with python
How to load files in Google Drive with Google Colaboratory
Upload to a shared drive with Google Drive API V3
ls -R on Google Drive
Test embedded software with Google Test
Try Google Mock with C
Study Python with Google Colaboratory
About learning with google colab
Try OpenCV with Google Colaboratory
Google Drive Api Tips (Python)
Translate PHP_UML --help with google translate
Python: Extract file information from shared drive with Google Drive API
Google App Engine development with Docker
Download Google Drive files in Python
Mount S3 on Ubuntu with goofys
OpenCV feature detection with Google Colaboratory
Play with Turtle on Google Colab
Introducing Google Map API with rails
Create and edit spreadsheets in any folder on Google Drive with python