Skip to main content

Mounting Google Drive on Arch Linux

··2 mins·
Google-Drive Opam Arch-Linux
Makoto Morinaga
Author
Makoto Morinaga
A personal notebook for tech notes, coding, and system experiments.
Table of Contents

In this note, I will share my personal experience on how to mount Google Drive on Arch Linux using google-drive-ocamlfuse.

Install opam
#

First, I need to install opam using the following command:

Terminal
sudo pacman -S opam

Initialize opam
#

Next, I initialize opam with this command:

Terminal
opam init

Install google-drive-ocamlfuse
#

After initializing opam, I install google-drive-ocamlfuse with the following commands:

Terminal
eval $(opam env)

opam install google-drive-ocamlfuse

Append environment variable
#

I add the following lines to ~/.zshenv file to set up the environment variables:

~/.zshenv
# opam
export OPAMROOT="${XDG_DATA_HOME}/opam"
export PATH="${PATH}:${OPAMROOT}/default/bin:"

Authorization
#

I run google-drive-ocamlfuse without any parameters to start the authorization process:

Terminal
google-drive-ocamlfuse

This launches a web browser to obtain authorization to access my Google Drive.

Mount Google Drive
#

I create the mount point (if it doesn’t exist) and mount my Google Drive using the following commands:

Terminal
mkdir ~/GoogleDrive
google-drive-ocamlfuse ~/GoogleDrive

Auto-mounting
#

To automatically mount Google Drive when I start a new shell session, I add the following lines to ~/.zshenv file:

~/.zshenv
local GOOGLE_DRIVE="${HOME}/GoogleDrive"

if [ -x "$(command -v google-drive-ocamlfuse)" ] && ! mountpoint -q "$GOOGLE_DRIVE"; then
    google-drive-ocamlfuse "$Google_Drive"
fi

That’s it! Now I can mount Google Drive on Arch Linux using google-drive-ocamlfuse. I hope this note helps you set up Google Drive on your Arch Linux system.

Related

Sway Desktop Environment in Arch Linux
··11 mins
Sway Arch-Linux
i3 Desktop Environment in Arch Linux
··6 mins
Arch-Linux
Installing Emacs28 with Native compilation enabled
··4 mins
Arch-Linux Macos Ubuntu Emacs