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.
Access Google’s API Library.
Google Drive APIusing the search bar.
Google Drive API
Navigate to Credentials
Create credentialsdrop down and select
OAuth client ID
- Application type: other
- Copy your Client ID and Client Secret for use later.
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