Rclone Mount Google Drive Deleted My Files Without My Knowledge

What is the problem you are having with rclone?

I used the following script to mount my Google Drive Remote which was configured with my own client id and secret... But unfortunately since, Nov 17 2024, My Files and Folders slowly started to delete from my Google Drive and was in the Google Drive Bin.

#.config/systemd/user/drive.service 
[Unit]
Description=rclone: Remote FUSE filesystem for cloud storage config %i
Documentation=man:rclone(1)
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
ExecStartPre=-/usr/bin/mkdir -p %h/Google
ExecStart= \
  /usr/bin/rclone mount \
    --config=%h/.config/rclone/rclone.conf \
    --vfs-cache-mode writes \
    --vfs-cache-max-size 100M \
    --log-level INFO \
    --log-file=/tmp/rclone-%i.log \
    --umask 022 \
    D01: %h/Google
ExecStop=/bin/fusermount -u %h/Google
ExecStopPost=/usr/bin/rm -r %h/Google

[Install]
WantedBy=default.target

Fortunately, I was able to recover all of them from the Google Drive Bin, I hope that all are recovered without any miss. I recovered them after stopping the mount service. I also deleted that remote from my System.

Run the command 'rclone version' and share the full output of the command.

rclone v1.68.1
- os/version: fedora 41 (64 bit)
- os/kernel: 6.11.7-300.fc41.x86_64 (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.23.1
- go/linking: static
- go/tags: none

Which cloud storage system are you using? (eg Google Drive)

Google Drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

systemctl --user enable --now drive

The above command was what I used to start the service.

The rclone config contents with secrets removed.

Unfortunately, It is empty as I deleted the remote.

A log from the command with the -vv flag

Paste  log here

I don't have that as well as the remote is deleted.


If you want any other information in this regard, Please let me know.

Rclone doesn't just randomly delete things as that isn't how it works.

If you have a log file, you would be able to see what was accessing the mount and deleting things.

Just now I noticed that I have defined a log file, but unfortunately, it does not exist in the /tmp directory...It must be because I restarted my computer. Is there anywhere else I can get the logs of rclone...

@Animosity022

Or shall I recreate the rclone remote with the same client id and secret and mount a temporary subdirectory and check whether it repeats, if it does, will get the logs...

If you'd like to.

Something on your mount was deleting things as rclone is just a tool. If you think of a hammer breaking something, the hammer is just the tool that was used. Someone swung the hammer and hit something.

If rclone was mounted and files are removed, some other piece of software/human removed files.

Looks like you are running a mount as root which I personally would not do. If you are concerned about things, you'd lock down permissions and ensure what has the ability to delete and go from there.

And I'm like 99% sure I see the issue.

That fusermount won't work if things are hitting the mount point as it's also fusermount3 these days.

So it doesn't unmount and you are removing all the files..

Thank You for the reply, anyway I did not do it as root. I mounted is as user.

Actually the ExecStop came from the script I copied, I am not sure what it does.

And the ExecStopPost, I did it as I wanted to remove the Google folder, when I stop the service.

Anyway, will remove them and check, what happens.... It must do the job right?

I'd imagine if you to remove a folder, you'd use rmdir instead.

I'm not a huge fan of removing the mount point and re-adding it and I tend to keep things as simple as possible.

Stop a network mount means you have to stop all IO/processes hitting the mount and then you can unmount it.

Systemd will end up just killing it after 60 seconds and you end up in a funky state.

When I was using it, I would tie all my dependencies back and you can validate no processes are hitting the mount via fuser or something until you are sure you have everything quiet before unmounting it.