Cloud storage is one of the most reliable solutions to sharing and storing critical data accessed from any location or device. Google drive is the most budget-friendly cloud storage, which offers 15GB of free cloud storage and incremental cloud storage services that can be used on Windows, macOS, and Linux. In this article, let’s learn how to mount Google Drive as a disk on Linux VPS. Let’s get started!


Mounting Google drive as a local disk in Linux

1. Download and install the google-drive-ocamlfuse , which is a FUSE filesystem for Google Drive, written in OCaml and lets you mount your Google Drive on Linux as a native disk :

sudo add-apt-repository ppa:alessandro-strada/ppa

sudo apt-get update

sudo apt-get install google-drive-ocamlfuse

If the repository ppa:alessandro-strada/ppa doesn’t work or you are using a different Linux distribution, you may have to follow the OS specific instructions given in the installation wiki.

2. Run the command ‘google-drive-ocamlfuse’ in shell/Terminal and a browser window will open with the prompt to give permission for the app to access your Gdrive data (Please note that if you are using a Minimal OS then you have to make sure that you have enabled x11 forwarding to serve the browser access via SSH or the browser won’t open). Provide access to the gdfuse app and you will receive a “Access token retrieved correctly.” message in shell once you close the browser. If you are confused about any of these, you can refer to the screenshots provided below:

3. Now that you have granted access to gdfuse, lets create a mount point/directory onto which we are mounting our Gdrive data.

sudo mkdir /Gdrive

make sure the user with which you create and authenticate gdfuse have full permission to this Gdrive directory and whatever is inside it.

4. Last step is to mount the drive

google-drive-ocamlfuse /Gdrive

This command will mount the Google drive data onto your Gdrive directory and now you can work on those files like any other normal file on your personal computer.

You can verify if the mount was successful by running the ‘df-h’ command which will list all the active mount points on the OS

If you wish to unmount the drive, then run the below command in terminal:

fusermount -u /Gdrive

You can also automate this by adding an entry to the fstab or by other methods mentioned here.

If you are looking for a reliable VPS or dedicated server, be sure to take a look at RackNerd’s server hosting solutions below!

Server Hosting Solutions by RackNerd:

Shared Hosting
cPanel Web Hosting in US, Europe, and Asia datacenters
Logo
Reseller Hosting
Create your new income stream today with a reseller account
Logo
VPS (Virtual Private Server)
Fast and Affordable VPS services - Instantly Deployed
Logo
Dedicated Servers
Bare-metal servers, ideal for the performance-demanding use case.
Logo

Leave a comment

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