Expand Storage With Free Google Shell

As many of you may have discovered, you are given access to your own Debian Linux shell account with 5GB of persistent storage when you sign up for Google’s GMail service, . You can access the console by visiting the Google Cloud Platform. The Debian systems are generated on the fly, and your 5GB of persistent storage is loaded into your home directory on startup. This article will walk you through expanding the 5GB or storage to 20GB by mounting Google Drive.

Headless Authorization Setup

We will be using google-drive-ocamlfuse for mounting the remote drive from within our shell account. As the servers are dynamically generated on use, we need to install the tools and configure them each time that we access our shell account. Due to this, I have included a simple shell script that you can keep in your home directory for setting up the mount points (skip ahead).

Before we get into the shell script, we need to configure Google API Keys using OAuth in order to run this setup in headless mode. The following steps will help you setup the proper authorization.

  1. Access Google’s API Library.

  2. Locate Google Drive API using the search bar.

  3. Click Enable for Google Drive API

Enable Google Drive API

  1. Navigate to Credentials

  2. Click the Create credentials drop down and select OAuth client ID

Create credentials

  1. Application type: other

Create client ID

  1. Copy your Client ID and Client Secret for use later.

Client ID and secret

Mounting the Drive

Now that we have a client ID and secret from the Google API Manager, we can go ahead and plug those values into the script below. Save this gist below to your home folder and make it executable. By default, it mounts your Google drive to $HOME/gdrive. To execute, simply type ./gdrive.sh. After the script executes, it will ask you to authorize the API permissions by copying a link to your web browser. You will then need to copy an authorization string back into the terminal prior to mounting the drive. Once it’s mounted, you can type df -h to see that we have an additional 15GB of storage in ~/gdrive.

Drive mounted

comments powered by Disqus