Mounting Google Drive in Ubuntu/Linux land. I needed this for the Obsidian-LiveSync dance.

Two options I dug deep into:

InSync

Insync, which despite sounding like the name of a dodgy 90s boyband, is arguably the slickest of these.

Along with instantaneous syncing of your Drive contents to and from Ubuntu, the tool lets you edit your documents offline, quickly generate share links through Nautilus, and alert you to any changes or errors via an indicator applet.

FUSE Method (not recommended)

Linux FUSE Mount work great for many use cases but I would not recommend it for Obsidian.

This method is not an alternative to a native Google Drive sync client like InSync or OverGrive, which creates and local copies of your files for offline access.

With thus FUSE method all your Google Drive files remain remote. If your internet connection dips out, so does access to files you haven’t made local copies of.

But what it does allow you to open most files in local apps and write changes to the file direct to Google Drive. Think of it this as a remote USB thumb drive: you can copy, edit, write and open files while it’s attached.

Google drive has launched a FUSE-based file system that allows users to access files and folders in google drive through command line as well as the File Explorer. Run through the following steps to mount your Google Drive with your Linux machine:

  1. Install ocamlfuse using the following command:
sudo add-apt-repository ppa:alessandro-strada/ppa
sudo apt update && sudo apt install google-drive-ocamlfuse

2. Run ocamlfuse in the command line:

google-drive-ocamlfuse

3. Authorize the ocamlfuse system to access files and folders on your google drive. A sign-in window will open in your browser automatically where the user needs to sign-in and provide required access.

4. Make a new directory named ‘googledrive’ where the Google drive will be mounted

mkdir ~/googledrive

5. Mount the google drive on your Linux-based system by running the following command and you are done:

google-drive-ocamlfuse ~/googledrive

6. Unmounting of the FUSE system can be done in case one wishes to disconnect the google drive with local system, by running the following command:

fusermount -u ~/google-drive

Note: In case the google drive get unmounted on rebooting the system, run the above command in step 5 again and you will be good to go.

More Options & Configuration

See the official wiki for more details on installation, authorisation, and advanced usage. You can also run google-drive-ocamlfuse --help from the command line to see the various arguments and flags you can use.