Skip to content

Instantly share code, notes, and snippets.

@marshki
Last active May 31, 2023 12:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshki/dcecf0f3b3b812f677b6dabaf22e51bc to your computer and use it in GitHub Desktop.
Save marshki/dcecf0f3b3b812f677b6dabaf22e51bc to your computer and use it in GitHub Desktop.
Mount Google Drive via command line interface (CLI) in Ubuntu.

Mount Google Drive in Ubuntu ☁️💾

Scope: Mount Google Drive from a terminal using Google Drive Ocamlfuse.

Preflight check ✔️✈️

You'll need the following package:

  • google-drive-ocamlfuse

You may install it via the Apt package manager:

sudo add-apt-repository ppa:alessandro-strada/ppa

sudo apt-get update

sudo apt-get install google-drive-ocamlfuse

Alternatively, you may retrieve the relevant (per your distribution) .deb file from: launchpad.net, then execute it using Apt, e.g.:

cd ~ && wget --progress=bar --tries=3 --wait=5 \ https://launchpad.net/~alessandro-strada/+archive/ubuntu/ppa/+files/google-drive-ocamlfuse_0.7.23-0ubuntu1~ubuntu16.04.1_amd64.deb

sudo apt install ./google-drive-ocamlfuse_0.7.23-0ubuntu1~ubuntu16.04.1_amd64.deb

How to Mount Google Drive using Google Drive Ocamlfuse from a Terminal

NOTE:You must link ocamlfuse to your Google Drive account once, by calling ocamlfuse without parameters:

google-drive-ocamlfuse

This will open a browser, and present you with an authenticaion prompt, which you may accept.

For additional configuration options see here.

  • Step 1:

Create a mount point (if one does not exist), e.g.:

sudo mkdir -v /media/GDriveNetID

  • Step 2:

Grant current user ownership of mount point, e.g.:

sudo chown -Rv $USER /media/GDriveNetID

  • Step 3:

Mount Google Drive to mount point created above, e.g.:

google-drive-ocamlfuse -label NetID /media/GDriveNetID

  • Step 4:

When you're done, unomount Google Drive:

cd ~ && fusermount -u /media/GDriveNetID

:neckbeard:❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment