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
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:
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.
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.