Google drive on Ubuntu – Automount

Create the unit file as nano ~/.config/systemd/user/google-drive-ocamlfuse.service (be sure to replace instances of {label} and {mountpoint}):

[Unit]
Description=FUSE filesystem over Google Drive
After=network.target

[Service]
ExecStart=google-drive-ocamlfuse -label {label} {mountpoint}
ExecStop=fusermount -u {mountpoint}
Restart=always
Type=forking

[Install]
WantedBy=default.target

To automount on boot:

systemctl enable --user google-drive-ocamlfuse.service

To mount drive:

systemctl start --user google-drive-ocamlfuse.service

To unmount drive:

systemctl stop --user google-drive-ocamlfuse.service

More info can be found here: https://github.com/astrada/google-drive-ocamlfuse/wiki/Automounting

Google drive on Ubuntu

Configure apt repository:

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

Install ocamlfuse

sudo apt install google-drive-ocamlfuse

Launch ocamlfuse to configure the authentication tokens

google-drive-ocamlfuse

Configure root_folder in subl ~/.gdfuse/default/config . It should be folder id that you can get from the web interface (it’s the id in the url after https://drive.google.com/drive/folders/). Remember remount with -cc after you change the root folder.

root_folder=the id

Create mount folder and execute the mount command:

mkdir ~/.gdfuse/folders
google-drive-ocamlfuse -cc ~/.gdfuse/folders

When done/tired of google drive, execute:

umount ~/.gdfuse/folders

For automount, please follow the instructions from here: https://blog.ciprianpascu.ro/2023/03/28/google-drive-on-ubuntu-automount/