Rclone will not mount without --allow-non-empty (I am unable to unmount also)

What is the problem you are having with rclone?

I'm using this on a Vero 4K+ box, with OSMC OS.

Rclone will not mount without using --allow-non-empty, and I can't unmount the folder

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

rclone v1.58.0

  • os/version: debian 10.7 (64 bit)

  • os/kernel: 3.14.29-160-osmc (aarch64)

  • os/type: linux

  • os/arch: arm64

  • go/version: go1.17.8

  • 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)

[Unit]
Description=rclone_mount
After=network-online.target
Wants=network-online.target

[Service]
Type=notify
Environment=RCLONE_CONFIG=/home/osmc/.config/rclone/rclone.conf
KillMode=none
RestartSec=5
ExecStartPre=-/bin/fusermount -uz /home/osmc/crypt
ExecStart=/usr/bin/rclone mount crypt:media /home/osmc/crypt
# This is for allowing users other than the user running rclone access to the mount
--allow-other \
# Google Drive is a polling remote so this value can be set very high and any changes are detected via polling.
--dir-cache-time 1000h \
# To log to syslog as well
--syslog \
# I reduce the poll internval down to 15 seconds as this makes changes appear fast the API quotas per day are huge
--poll-interval 15s \
# This adds a little buffer for read ahead
--vfs-read-ahead 256M \
# This limits the age in the cache if the size is reached and it removes the oldest files first
--vfs-cache-max-age 1000h \
# This sets a per file bandwidth control and I limit this to a little bigger than my largest bitrate I'd want to play
--bwlimit-file 16M \
ExecStop=/bin/fusermount -uz /home/osmc/crypt
User=osmc
Group=osmc

# Restart=on-failure

[Install]
WantedBy=multi-user.target

The rclone config contents with secrets removed.

[gsuite]
type = drive
client_id = xxxxxxxx
client_secret = xxxxxx
scope = drive
token = {"access_token":"xxxxxxx
team_drive =

[crypt]
type = crypt
remote = gsuite:media
password = xxxxx

A log from the command with the -vv flag


Mar 20 13:28:02 osmc fusermount[1741]: /bin/fusermount: entry for /home/osmc/crypt not found in /etc/mtab
Mar 20 13:28:03 osmc rclone[1743]: Fatal error: Directory already mounted, use --allow-non-empty to mount anyway: /home/osmc/crypt
Mar 20 13:28:03 osmc systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE

I've searched the forums and used google, but I can't figure it out. This thread seems to have some similar problems:

Let's break it up into a few questions. First, let's tackle non empty. This means some other process started before your rclone mount and wrote there. You want to make sure that nothing else does this. This is usually accomplished by making a few lines into your other service files once you figure out what is causing it. In my example, I use Sonarr and I use this in my service file area:

Wants=rclone-movies.service rclone-tv.service
After=rclone-movies.service rclone-tv.service
Requires=rclone-movies.service rclone-tv.service

I had 2 mounts and that ensures that the service starts after the rclone does.

This is also common as the second part of my service file above is 'required'. You can't generally unmount a network mount if another process is accessing it or you get things left in a bad state. I use that require to make sure all processes accessing the mount are stopped.

I use that required for all services that hit the mounts (Sonarr/Radarr/Plex/QBIt/etc.) Once all processes are stopped, you can then unmount it. The -z in the fusermount is a lazy unmount which means it'll return back before it's actually unmounted. I use that as well as I take care of all my prereqs in my other service files.

First of all, thank you for the reply.

I have done some googling and I've tried using the command lsof to find which process is causing trouble, and I can't find any.

Will Kodi interfere when it searches for new content ? My media libraries are supposed to be mounted on "/home/osmc/crypt".


Did I understand your reply correct? That I should find out what other process is writing to that folder ?

**osmc@osmc**:**~**$ sudo lsof +f -- /home/osmc/crypt/

**osmc@osmc**:**~**$

I'd imagine it would as that's similar to plex. You'd want to see what files are there to get an idea.

You have to break it down, don't start rclone and figure out what's writing there before you mount it. If you over mount it with allow-empty, you'll run into issues.

Fantastic!

This seems to have solved my problems, I removed the libraries within Kodi and rebooted, and now it works!

Side-note: This is a small little thing, kind of like an Raspberry Pi, with:

  • Quad Core 1.6Ghz 64-bit processor
  • 2GB DDR3 RAM and 16GB eMMC storage

Any tips on how to tweak my mount-settings ? I have a large library.

I don't use Pis as I rather not spend the effort on a subpar device for streaming. Someone else may chime in.

Also 'large' library means nothing as that's relative. You probably want to share more specifics.

The device is a Vero 4K+ and my library is around 120 TB.

i have a bunch of pizero, pizero2 and a pi4.
rclone mount runs great on all of them.

as for tweaks, is there anything wrong with your current command?

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