Quantcast
Channel: Debian User Forums
Viewing all articles
Browse latest Browse all 2681

Beginners Questions • [Hardware] What is the recommended way to automatically mount Google Drive as a network drive

$
0
0
Hi all

I have been experimenting a bit with mounting google drive as a network drive using rclone. I can mount and unmount manually in the CLI, but wanted to automate it such that it mounts drives when network is available. One of the recommended ways seems to be to create a service.

Code:

[Unit]Description=Mount Google Drive using rcloneAfter=network-online.target[Service]Type=simpleExecStart=/usr/bin/rclone --vfs-cache-mode writes mount google_drive: /home/xxx/GoogleDriveExecStop=/bin/fusermount -u /home/xxx/GoogleDriveRestart=alwaysUser=xxx[Install]WantedBy=default.target
This gets me somewhere but it is far from a robust solution. Sometimes after a reboot, gnome files refuses to open, apparently because the drive failed to mount. I also had issues with suspending the laptop which seems related to this as it gave me this error:

Code:

Freezing user space processes failed task:gvfsd-recent
and this error disappeared when I disabled the googledrive.service.

Is this the recommended way to mount Google Drive (or other services like OneDrive)? If so what else is needed to make this more robust?

Thanks

Statistics: Posted by bjvca — 2024-11-24 12:07



Viewing all articles
Browse latest Browse all 2681

Trending Articles