How to Mount Google Drive in Linux Using “Google Drive OCamlfuse” Client

10. Now create a mount point say google-drive in your home directory and mount as:

$ mkdir ~/google-drive
$ google-drive-ocamlfuse ~/google-drive

You may check the mount point and disk space usages of your mounted Google Drive using df command as shown below.

Mount Google Drive in Linux

Mount Google Drive in Linux

If you have more than one account, you can run use following command.

$ google-drive-ocamlfuse -label label [mountpoint]

The label options is used to distinguish different accounts under directory ~/.gdfuse/label to host configuration, application state, and file cache.

Do remember no files are shared among different accounts, so that you can have a different configuration for each Google account.

11. To unmount the Google Drive, you have to run:

$ fusermount -u ~/google-drive

For more options and help, run google-drive-ocamlfuse -help command to get all the available commands and switches.

Mount Google Drive Automatically in Linux

You may mount more than one drive at a time and also mount Google drive automatically at boot.

12. create a shell script gdfuse in the directory /usr/bin as root, with the below content.

#!/bin/bash
su $USERNAME -l -c "google-drive-ocamlfuse -label $1 $*" 
exit 0

13. Make it executable.

# chmod 755 /usr/bin/gdfuse

14. Create mountpoint say /mnt/gdrive and give ownership to user ‘avi‘.

# mkdir /mnt/gdrive
# chown avi.avi /mnt/gdrive

15. Next, open and edit file /etc/fstab and add below line at the bottom. Save and exit.

gdfuse#default	 /mnt/gdrive 	fuse 	uid=1000,gid=1000 	0 	0

Take extra care of ‘uid‘ and ‘gid‘. Change it as user’s uid and gid.

16. To mount the google drive now, run:

# mount /mnt/gdrive

For more information about how to include and use multiple Google accounts, see the google-drive-ocamlfuse wiki.

That’s all for now. Installing from source is not a big deal as well and it is pretty straight forward, as tested on Debian. What you think about the project and its setup. Also there is no answer from Google on official Drive client even after 3 years, so what do you think. Is Google Drive Ocamlfuse a life savior? Please let us know your valuable thought in the comments below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

34 Responses

  1. Jessica says:

    There is something strange about the way your code blocks are displaying; ~ is changed to – in my browser (Firefox)

  2. Martin says:

    Does anyone know how this method compares to eg grive/grive2? The latter methods, I’ve had bad experiences with, so I’ll try this new method now, thanks a lot for the article…

  3. Rob says:

    Is it possible to edit this to use lynx instead of “xdg-open”, “firefox” or “google-chrome”. Been following this to install on one of my headless servers which has no gui and therefore no graphical browser.

  4. Lim JH says:

    When I try to give ownership to avi, it says “user is not found” .Any idea?

  5. Thu Win says:

    This caused Linux Mint to stop booting!

  6. Jose Rivera says:

    Thanks a lot folks, very useful, even if I have no knowledge about Linux (sorry my English, I do not speak English).

  7. Jacques says:

    Hi,

    I have had to change:
    gdfuse#default /mnt/gdrive fuse uid=1000,gid=1000 0 0
    to:
    gdfuse#default /mnt/google_drive fuse uid=1000,gid=1000,user 0 0

    • Ravi Saive says:

      @Jacques,

      Thanks for sharing the tip, but could you tell us why it needed and how you came to know? it will help us to correct the article with correct explanation. So, that end users will know more better about the command.

  8. laudup says:

    Thank you very much for this tutorial. It is really very useful.
    The question is what to do if you only have the command line and no GUI (so no browser too ;-).

    Thank you.

  9. Boi Le says:

    google-drive-ocamlfuse on Lubuntu 14.04 is too slow. I tried to use vi to edit a text file in google-drive, when I pasted about 2KB text from clipboard, it took around 60 seconds. The same thing works smoothly on pCloud.com, it seems that pCloud do caching well.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.