What to do if the device is busy while unmountall

What is the problem you are having with rclone?

I run the rclone rc in a container. Sometimes when I want to shutdown the container and execute "unmountall", the screen
show me an error says that the resource is busy. I am not sure how safely deal with this ... should I user "fusermount -zu" to force unmount remotes? is it possible that some changes are still in cache, and haven't synced to remotes?

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


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

google drive, onedrive, pcloud

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

rclone rc mount/unmountall --rc-user $UNAME --rc-pass $UPASS

A log from the command with the -vv flag

unmount result: 
2022/10/03 01:45:15 ERROR : rc: "mount/unmountall": error: exit status 1: fusermount: failed to unmount /data/m/le_g: Resource busy
2022/10/03 01:45:15 Failed to rc: failed to read rc response: 500 Internal Server Error: {
        "error": "exit status 1: fusermount: failed to unmount /data/m/le_g: Resource busy",
        "input": {},
        "path": "mount/unmountall",
        "status": 500

This means that something is using the mount. Most likely an application has a file open on the mount.

The OS doesn't like this! If you can kill the application then it will unmount cleanly.

I'm not sure if -z will help if an application has a file open.

Yes, but that isn't related to this error.

There's really no magic here unfortunately as the only thing to do is stop all the processes that are using the volume.

I do that with systemd and ensure my services all have requirements and stop if the mount needs to stop.

You can use fuser as root on the mount point and figure out what's using it.

Other than that, reboot as that's really all you can do.

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