Help create mount check script

My acdcrypt mount disconnects (especially if running an rclone copy whilst accessing the mount through plex simultaneously). Has anyone got a script I can steal to check if the mount is still OK… and if not, re-mount? I’m thinking of running on a cron to check every minute

I’ve tried… but failing miserably!


1 Like

Here’s mine. A few others are already using it, and they’ve had good luck with it. Just make a file called ACDETest.txt and put something in it so it will not be 0b.

if [[ -f "/mnt/disks/ACDE/ACDETest.txt" ]]; then
   echo "$(date "+%d.%m.%Y %T") INFO: Check successful, ACDSecure drive mounted" | tee -a "/var/log/acd-    check.log"
   echo "$(date "+%d.%m.%Y %T") ERROR: ACDSecure Drive not mounted remount in progress" | tee -a     "/var/log/acd-check.log"
   fusermount -u /mnt/disks/ACDE
rclone mount \
	--allow-non-empty \
	--allow-other \
	--acd-templink-threshold 10G \
	--max-read-ahead 4G \
	--buffer-size 1G \
	--contimeout 15s \
	--low-level-retries 1 \
	--no-check-certificate \
	--quiet \
	--stats 0 \
	--retries 3 \
	--timeout 30s \
	ACDSecure:/ /mnt/disks/ACDE &
sleep 5
   if [[ -f "/mnt/disks/ACDE/ACDETest.txt" ]]; then
      echo "$(date "+%d.%m.%Y %T") INFO: ACDE Remount successful" | tee -a "/var/log/acd-check.log"
      echo "$(date "+%d.%m.%Y %T") CRITICAL: ACDE Remount failed." | tee -a "/var/log/acd-check.log"
1 Like

Brilliant. Thanks… it was the file I was missing to check. This now works perfectly. Appreciate the help!

You may want to expand the fusermount -u to help resolve a hung mount. If you use sudo, you’ll need appropriate whitelists in your /etc/sudoers.

fusermount -u $MNT ||
fusermount -z $MNT ||
sudo umount -f $MNT ||
sudo umount -l $MNT

1 Like

This is a very good point. I’ve expanded my own. You should do the same @mechanimal82 .

1 Like

Great. Thanks both - will update accordingly :slight_smile:

OK, so that’s sorted and working perfectly! Thanks.

Next question… why does my acd crypt mount keep closing if being read whilst a copy is in progress??? I’m currently pushing 3TB of data to the acd crypt and if trying to play something on Plex (from the mount), after a couple of minutes it crashes and needs remounting.

Any idea’s? FYI my mount is set as:

rclone mount --allow-other --acd-templink-threshold 0 --stats 1s --buffer-size 1G acdcrypt: /mnt/data/plex/acd &

any help would be appreciated. Thanks again!

Get a debug log and post relevant section…

I run my mount 24/7, and it never crashes. I currently have a rclone copy, rclone move, and rclone sync going to various locations. Videos play fine for me. It may be time to check your RAM.

As I don’t see any --read-only in your mount, I have to ask: Are you attempting to copy directly into the mount? That portion of rclone, while it works for smaller files sometimes, is very spotty currently. You should be using a separate process to do the command rclone copy /source destination:folder.

Still gather and post the debug log, because it can help get that code cleared up, but heed the above for your data’s sake.

1 Like