What is the problem you are having with rclone?
I made .mount
and .automount
files based on the documentation for rclone mount
. I am able to mount the drive correctly by starting the .mount
file using systemctl. But if I try to trigger the .automount
by accessing the folder, I get an error.
Weirdly, this used to work a while ago. I regularly update my system and found the breakage only now, so I don't know whether an rclone update caused it or an OS update, or something else I changed.
Run the command 'rclone version' and share the full output of the command.
rclone v1.64.0
- os/version: arch (64 bit)
- os/kernel: 6.5.6-arch2-1 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.21.1
- go/linking: dynamic
- go/tags: none
Which cloud storage system are you using? (eg Google Drive)
Google Drive (same issue with OneDrive Business)
The command you were trying to run (eg rclone copy /tmp remote:tmp
)
ls /mnt/Google
to trigger /etc/systemd/system/mnt-Google.automount
:
[Unit]
Description=Automount Google Drive at /mnt/Google
[Automount]
Where=/mnt/Google
TimeoutIdleSec=600
[Install]
WantedBy=default.target
which in turn should call /etc/systemd/system/mnt-Google.mount
:
[Unit]
Description=Mount Google Drive at /mnt/Google
[Mount]
Type=rclone
What=GoogleDrive:
Where=/mnt/Google
Options=rw,_netdev,allow_other,args2env,config=/etc/rclone/rclone.conf,cache-dir=/var/cache/rclone
The rclone config contents with secrets removed.
[GoogleDrive]
type = drive
scope = drive
token = {"access_token":"REDACTED","token_type":"Bearer","refresh_token":"REDACTED","expiry":"2023-10-11T18:26:20.45650324+01:00"}
root_folder_id = REDACTED
A log from the command with the -vv
flag
If I add ,vv to the mount options, I get in the .mount
systemd log
Oct 11 17:33:27 REDACTED systemd[1]: Mounting Mount Google Drive at /mnt/Google...
Oct 11 17:33:28 REDACTED mount[69529]: DEBUG : rclone: Version "v1.64.0" starting with parameters ["/usr/bin/mount.rclone" "mount" "GoogleDrive:" "/mnt/Google" "--allow-other" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--verbose=2" "--daemon"]
Oct 11 17:33:28 REDACTED mount[69529]: DEBUG : rclone: systemd logging support activated
Oct 11 17:33:28 REDACTED mount[69529]: DEBUG : Using fallback PATH to run fusermount
Oct 11 17:33:28 REDACTED mount[69529]: DEBUG : Creating backend with remote "GoogleDrive:"
Oct 11 17:33:28 REDACTED mount[69529]: DEBUG : Using config file from "/etc/rclone/rclone.conf"
Oct 11 17:34:28 REDACTED mount[69529]: DEBUG : Daemon timed out. Terminating daemon pid 69540
Oct 11 17:34:28 REDACTED mount[69529]: Fatal error: mount not ready: /mnt/Google
Oct 11 17:34:28 REDACTED systemd[1]: mnt-Google.mount: Mount process exited, code=exited, status=1/FAILURE
Oct 11 17:34:28 REDACTED systemd[1]: Mounted Mount Google Drive at /mnt/Google.
If instead, I start the .mount
unit manually then it works and I get the log
Oct 11 17:38:00 REDACTED systemd[1]: Mounting Mount Google Drive at /mnt/Google...
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : rclone: Version "v1.64.0" starting with parameters ["/usr/bin/mount.rclone" "mount" "GoogleDrive:" "/mnt/Google" "--allow-other" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--verbose=2" "--daemon"]
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : rclone: systemd logging support activated
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : Using fallback PATH to run fusermount
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : Creating backend with remote "GoogleDrive:"
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : Using config file from "/etc/rclone/rclone.conf"
Oct 11 17:38:00 REDACTED mount[76618]: DEBUG : rclone: Version "v1.64.0" finishing with parameters ["/usr/bin/rclone" "mount" "GoogleDrive:" "/mnt/Google" "--allow-other" "--config=/etc/rclone/rclone.conf" "--cache-dir=/var/cache/rclone" "--verbose=2" "--daemon"]
Oct 11 17:38:00 REDACTED systemd[1]: Mounted Mount Google Drive at /mnt/Google.
The log is identical until the timeout, so I really don't know what is going on.