Mine the Harvest

Google Drive for Linux – grive

by on Jun.01, 2012, under Linux

Google has yet to release a Linux client for its new Google Drive service, but thanks to some enterprising individuals an Open Source client called grive is available at this github repo. Some additional info is available through the grive Google+ site and here.

Google Drive, similar to Dropbox and other file sharing services, allows you to store documents online, share them with others, etc. with a 5GB allocation to start with.

Getting grive for Linux

For Ubuntu 11.10 or later grive should be in your repos.
For other distros, building from source is fairly trivial, but the follow notes might be of assistance.

Building from source

Install the needed libs listed in the README, and cmake then build as below, which uses the typical cmake build process that create a Makefile, etc. (For Suse 12.2: zypper install cmake libgcrypt-devel libjson-devel curl-devel libexpat-devel boost-devel)

git clone git://github.com/Grive/grive.git
cd grive
mkdir build
cd build/
cmake ..
cd grive

You can run the binary from here, without running make install.

Running make install did not install the libgrive.so library correctly for me. You can verify if yours did with ldd `which grive` and see. If needed, you can install the library separately:

Installing the library

From the libgrive directory:
grive/build/libgrive$ sudo make install
#ldconfig (as root)

This should install to /usr/local/lib/libgrive.so


As a note, if you relocate your git repo cmake will freak out as the paths will be wrong. Another lovely benefit of cmake. To clean up and rebuild if needed:

In your build directory:
mv grive/ grive.old
mv CMakeCache.txt CMakeCache.txt.old
cmake ..

Okay, okay – let’s use it already!

Run the resultant binary and connect it to your Google Drive via the nifty Google API. (Create a sync folder first, in which to they sync contents):

mkdir ~/Grive
cd ~/Grive
grive -a

Go to the Google link provided and then enter the API key so grive can talk to your Google Drive. Grive then downloads your drive contents to the local folder.

Now, push stuff up!

echo “Pushing this to my Google Drive.” > grive.push.test.txt

View your drive contents at https://drive.google.com/#my-drive and verify your file has been pushed.

That’s all there is to syncing folders – pretty easy. You can add the -V option for more verbose log messages.

Security via Encfs

For the security conscious, encfs can transparently encrypt files stored in an encfs mounted directory. I use this to mount a encrypted folder in Dropbox to an unencrypted mount point in my home directory. Anything dropped in the mount point dir is AES encrypted and stored in the folder in Dropbox. I find this extremely useful and it integrates with Dropbox well. More information on encfs and integrating it Dropbox is here. Though I’ve not tried it yet, I see no reason it could not also be used with Google Drive folders as well.


Google, despite being a bit late to this game, is sure to win over many people with Google Drive especially heavy Google Docs users or who may be otherwise new to this type service. There is a lot of competition with Dropbox, Spideroak, S3, and Sky Drive – but Google has not exactly been first to market in other areas, which they then dominated. For myself, Google Drive is somewhat handy but I’ve been using Dropbox for a good while now, and Google Drive really offers me nothing more compelling feature wise than I enjoy with Dropbox.  I also like Dropbox’s file recovery options (the pack rat option makes available all previous versions of an object, nothing is ever really deleted) and I like how all clients are automatically synced – no action is required. Still, options are good!

If you would like to try Dropbox, see this previous post which also links to a referral that will give you (and me) an additional 250MB of storage.

Another interesting option is SparkleShare which allows you to store your files in a git repo – be it github, gitorious or a bare repo on your own server. Very cool. The open source client is available for Linux, OSX and Windows. This is also an interesting and compelling new way to centrally save, distribute and share files.



4 comments for this entry:
  1. Barry

    Great instructions, I ran into difficulties with the installation instructions from the grive site itself on opensuse 12.1.

    I just followed the instructions above to the letter and it worked a charm. Currently downloading the contents of my Google Drive.

    Thanks a lot.

  2. nervien

    thanks from belgium
    a sabayon user

    git clone git://github.com/Grive/grive.git

  3. admin

    Updated the github link – thanks!

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...