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.
os/version: debian 10.7 (64 bit)
os/kernel: 3.14.29-160-osmc (aarch64)
Which cloud storage system are you using? (eg Google Drive)
The command you were trying to run (eg rclone copy /tmp remote:tmp)
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
# 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
# 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
Mar 20 13:28:02 osmc fusermount: /bin/fusermount: entry for /home/osmc/crypt not found in /etc/mtab
Mar 20 13:28:03 osmc rclone: Fatal error: Directory already mounted, use --allow-non-empty to mount anyway: /home/osmc/crypt
Mar 20 13:28:03 osmc systemd: 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:
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.