Rclone mount in Docker container ends in Error

What is the problem you are having with rclone?

I am new to Linux. On Christmas I got myself a Raspberry Pi 5 and have been learning about RaspiOS / Debian Bookworm, Docker and finally about rclone since.

I have successfully managed to start a rclone container via Docker compose, mounting my Dropbox into the container and accessing it from the host.
Problem is: after stopping the container the host directory becomes unavailable, because the unmount fails.

ERROR : /data: Failed to unmount: exit status 1: fusermount3: failed to unmount /data: Resource busy

Manually typing „fusermount -u /data“ inside the container to end the mount before stopping the container does not work.
So then my host filesystem takes damage (see below), and all I could come up with so far was rebooting. Which leads to quite some work getting stuff up und running again.

jan_reinhardt@raspi5:~ $ ls -l
ls: cannot access 'Downloads': Permission denied
total 512
dr-xr-xr-x 2 jan_reinhardt jan_reinhardt   4096 Jan 21 21:58  Documents
d????????? ? ?             ?                  ?            ?  Downloads
drwxr-xr-x 2 jan_reinhardt jan_reinhardt   4096 Dec 30 14:48  Music
drwxr-xr-x 2 jan_reinhardt jan_reinhardt   4096 Dec 30 14:48  Pictures


jan_reinhardt@raspi5:~ $ cd Downloads
-bash: cd: Downloads: Permission denied

:thinking: :disguised_face: Please, how do I unmount rclone or stop the Docker container the right way?

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

rclone v1.65.2
- os/version: alpine 3.19.0 (64 bit)
- os/kernel: 6.1.0-rpi7-rpi-2712 (aarch64)
- os/type: linux
- os/arch: arm64 (ARMv8 compatible)
- go/version: go1.21.6
- go/linking: static
- go/tags: none

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


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

mount mydropbox:Scans /data --allow-non-empty --log-file=/logs/rclone-DEBUG-log.txt --log-level DEBUG

See below for the logfile when stopping the Docker container.

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

type = dropbox
token = XXX
### Double check the config for sensitive info before posting publicly

A log from the command that you were trying to run with the -vv flag

2024/01/28 08:03:43 INFO  : Signal received: terminated
2024/01/28 08:03:43 INFO  : Dropbox root 'Scans': Committing uploads - please wait...
2024/01/28 08:03:43 ERROR : /data: Failed to unmount: exit status 1: fusermount3: failed to unmount /data: Resource busy
2024/01/28 08:03:43 INFO  : Exiting...

Please, does nobody have similar problems or solved this issue when clicking on „stop container“ ? How do I end an rclone mount without screwing up my host filesystem?

You have to stop all processes accessing the mount point to unmount it.

You can use fuser or something to check to see what is still accessing it. Not sure it has much to do with docker albeit I don't use rclone in a docker as it tends to overcomplicate things for me.

Please what would be the standard way to identify + end all other processes using the mount? (Im still new to all this)

As root, you can use something like fuser.

root@gemini:~# fuser -cu /mnt/user
/mnt/user:           32019(nobody)
root@gemini:~# cd /mnt
root@gemini:/mnt# cd user
root@gemini:/mnt/user# fuser -cu /mnt/user
/mnt/user:           30522c(root) 32019(nobody)
root@gemini:/mnt/user# ps -ef | grep 30522
root     30522 30520  0 11:16 pts/0    00:00:00 -bash
root     30676 30522  0 11:16 pts/0    00:00:00 ps -ef
root     30677 30522  0 11:16 pts/0    00:00:00 grep 30522

So in my example, to unmount /mnt/user, I have to kill the bash shell.

You'd run that on your mount point and see what is hitting it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.