Mount Google Drive Permanently On Linux

This how to helps you to learn Mount Google Drive Permanently On Linux. By mounting it permanently, you will have it always available.

Mount Google Drive Permanently On Linux

Mount Google Drive Permanently On Linux

Index Of How To Mount Google Drive Permanently On Linux

Background of Mount Google Drive Permanently On Linux

In this how to i am leveraging on the following components:

  • Raspberry Pi 4
  • Debian Linux Operating System
  • Google Drive (Google Cloud Service Account)
  • Rclone
  • Google Account available, incl. necessary configuration to share google drive

How To Mount Google Drive Permanently On Linux

To mount Google drive permanently, you need to have a Google Drive Client ID and a properly working configuration. If you have this, then please follow the below. If you haven’t, then you maybe like to check one of these How To’s which help you to get it. Just go thru the first chapters and comeback here.

If you have a working Google drive configuration, then you can make the Google drive connected permanently to you Linux. To do so, follow the below step by step guide. One point, in this How To the google drive to be mounted is called “GoogleDrive”. In case you have a different name, you should replace “GoogleDrive” by whatever is the name of your configuration. 

First of all, we create a configuration file for the service:

sudo nano /etc/systemd/system/rclone@GoogleDrive.service

Into this file you will be copying the following:

# service to mount Google Drive by rclone
# Place the file into /etc/systemd/system/ following how to guidance on https://www.myhowto.blog
# Once the file was placed, reload the systemctl deamon by typing systemctl --user daemon-reload
# To start the service type: systemctl --user start rclone@GoogleDrive
# To stop the service type:: systemctl --user stop rclone@GoogleDrive
# To restart the service type: systemctl --user restart rclone@GoogleDrive
# To check the service status type: systemctl --user status rclone@GoogleDrive 
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
[Service]
Type=notify
ExecStartPre=/bin/mkdir -p %h/mnt/%i
ExecStart= \
  /usr/bin/rclone mount \
    --fast-list \
    --vfs-cache-mode writes \
    --vfs-cache-max-size 100M \
    %i: %h/mnt/%i
[Install]
WantedBy=default.target

Save and exit. To enable the service we fire the below 3 commands on the command line:

openhabian@OpenHAB:~ $ sudo systemctl enable rclone@GoogleDrive
openhabian@OpenHAB:~ $ sudo systemctl daemon-reload
openhabian@OpenHAB:~ $ sudo systemctl start rclone@GoogleDrive

Once done, lets test whether the drive is permanently mapped to the folder in /root/mnt/GoogleDrive:

sudo ls -la /root/mnt/GoogleDrive

This command should provide you with the list of files. If you followed this How To, than you most likely will find in a minimum one file that is called “file.file”.

That’s actually it. You maybe like to restart to doublecheck. 

Additional Information

More information about rclone can be found on the official rclone page. There is also a how to that I have written earlier, though this might not work anymore properly since Google changed some items on OAuth. You maybe like to check out this as well. Its more related to Raspberry and less directly to OpenHAB.

Follow me

It would be amazing if you follow my myhowto.blog. To my blog is actually easy! You can leverage on

  • Click to follow me on Twitter
  • Bookmark this page and comeback from time to time

Help and Comments

I am really looking forward for you to contact me if for example you found a better option or other idea then in this how to. Also, please touch base if you found an error or anything not working or if you have something that you would love to be added to the myhowto.blog. Simply click this link to touch base with me.

Linking Or Recommending The How To Or The myhowto.blog

I would love to see you are recommending this how to or link it to your website. Also, I would love if you link or recommend the whole myhowto.blog. Please feel free to do so! In case you like to touch base regarding this topic with me, then simply click this link. I look forward!