[Plugin] rclone


Waseh

Recommended Posts

rclone v1.49.5-205-g65a82fe7-beta

 

#!/bin/bash

#######  Start rclone gdrive mount  ##########

# check if gdrive mount already created

if [[ -f "/mnt/user/mount_rclone/Tdrive_Media/mountcheck" ]]; then

echo "$(date "+%d.%m.%Y %T") INFO: Check rclone vfs already mounted."

else

echo "$(date "+%d.%m.%Y %T") INFO: mounting rclone vfs."

# create directories for rclone mount and unionfs mount

mkdir -p /mnt/user/appdata/other/rclone
mkdir -p /mnt/user/mount_unionfs/Tdrive_Media
mkdir -p /mnt/user/rclone_upload/Tdrive_Media

rclone mount --allow-other --buffer-size 256M --dir-cache-time 72h --drive-chunk-size 512M --fast-list --log-level INFO --vfs-read-chunk-size 128M --vfs-read-chunk-size-limit off tdrive1_archive_crypt: /mnt/user/mount_rclone/Tdrive_Media &

#sleep 30


# check if mount successful

# slight pause to give mount time to finalise

sleep 5

if [[ -f "/mnt/user/mount_rclone/Tdrive_Media/mountcheck" ]]; then

echo "$(date "+%d.%m.%Y %T") INFO: Check rclone gdrive vfs mount success."

else

echo "$(date "+%d.%m.%Y %T") CRITICAL: rclone gdrive vfs mount failed - please check for problems."

rm /mnt/user/appdata/other/rclone/rclone_mount_running

exit

fi

fi

#######  End rclone gdrive mount  ##########

#######  Start unionfs mount   ##########

if [[ -f "/mnt/user/mount_unionfs/Tdrive_Media/mountcheck" ]]; then

echo "$(date "+%d.%m.%Y %T") INFO: Check successful, unionfs already mounted."

else

unionfs -o cow,allow_other,direct_io,auto_cache,sync_read /mnt/user/rclone_upload/Tdrive_Media=RW:/mnt/user/mount_rclone/Tdrive_Media=RO:/mnt/user/Media=RO /mnt/user/mount_unionfs/Tdrive_Media

if [[ -f "/mnt/user/mount_unionfs/Tdrive_Media/mountcheck" ]]; then

echo "$(date "+%d.%m.%Y %T") INFO: Check successful, unionfs mounted."

else

echo "$(date "+%d.%m.%Y %T") CRITICAL: unionfs Remount failed."

rm /mnt/user/appdata/other/rclone/rclone_mount_running

exit

fi

fi

#######  End Mount unionfs   ##########

exit

Link to comment

here is my unmount script if it will help:

 

#!/bin/bash

# unmount to be safe

fusermount -uz /mnt/user/mount_unionfs/Tdrive_Media
fusermount -uz /mnt/user/mount_rclone/Tdrive_Media

# Remove other dummy files

if [[ -f "/mnt/user/appdata/other/rclone/rclone_upload" ]]; then

echo "upload file present - removing dummy file"

rm /mnt/user/appdata/other/rclone/rclone_upload

else

echo "rclone upload already exited properly"

fi

if [[ -f "/mnt/user/appdata/other/rclone/rclone_cleanup" ]]; then

echo "cleanup file present - removing dummy file"

rm /mnt/user/appdata/other/rclone/rclone_cleanup

else

echo "cleanup already exited properly"

fi

exit

Link to comment

That's up to you if you want to go back to an RC version to troubleshoot further.

The mount script really only has two primary commands in it....the rclone mount command and the unionfs command.

I'd be curious to know which of those commands cause the error. rclone could very well be working just fine...but unionfs could be the issue. Dunno.

I'm not any pro scripter or anything but that's just the basic troubleshooting I would do.

Link to comment

i have mount script run at start of array and unmount run at stop.  the only log that showed was on the startup one.  sorry i set this up with the help of a friend and it has always worked.  I am not a pro at how it all works TBH.

 

I think its safe to assume it has something to do with a change in 6.8 as it works fine again after rollback

 

 

Edited by Viperkc
Link to comment

ok went back to 6.8 and it seems fusermount is missing all together

 

which: no fusermount in (.:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin)

 

That is for sure the problem.

 

When i ran it in 6.7 i got this:

 

/bin/fusermount

 

How to fix this?

 

 

Edited by Viperkc
Link to comment

To note, this is because unRaid 6.8 has gone to fuse v3, but this is NOT an issue with unRaid, but an issue with the plugin, and your scripts and/or the plugin will ultimately have to be updated because of this

 

But, you can probably work around this for the time being by adding in to your "go" file (config/go on the flash drive) the following line

 

ln -s /usr/bin/fusermount3 /usr/bin/fusermount

 

Link to comment
20 hours ago, Stupifier said:

Seems kinda lame fusermount version 3 executable is named fusermount3.

I mean, it's not like any fusermount version 2 executable was named fusermount2....it was just plain named fusermount

I dunno, just seems silly. Whatever.

If something drastic was changed, it's easier to troubleshoot if you have to take affirmative action to update the script for the new executable than to have the script suddenly start failing because of a change in the file and you have no idea what happened. Imagine if for instance the behaviour of fusermount 3 required a new command line switch to make it work like fusermount 2 in certain circumstances. If your script didn't know it was working with the new fusermount, it wouldn't be able to detect the need for different parameters.

 

I don't know if that's the case for this specific application, but in general it makes sense to have unique names for unique executables.

Link to comment

I did setup rclone and everything think look good ! 
 

and i did enable SMB for rclone mount and try to use MRMC App SMB and mrmc start scan the files and when i want to play the file it stop !!!

i did try with my pc and and with plex and emby docker none of them play the files !!! 
although they able to see and scan the files and folder but they can’t play them !!!

 

I use google drive (team drive)  to mount 7 drives 

I only have 1 disk (samsung 250GB m.2)

unraid os latest Nvidia build (don’t remember the version number ) 

Mount script is 

 

#!/bin/bash

#----------------------------------------------------------------------------

#first section makes the folders for the mount in the /mnt/disks folder so docker containers can have access

#there are 4 entries below as in the video i had 4 remotes amazon,dropbox, google and secure

#you only need as many as what you need to mount for dockers or a network share

 

mkdir -p /mnt/disks/AnmieSeries

mkdir -p /mnt/disks/Movies

mkdir -p /mnt/disks/Music

mkdir -p /mnt/disks/Others

mkdir -p /mnt/disks/TV4K

mkdir -p /mnt/disks/TVShow

mkdir -p /mnt/disks/TVshowothers

 

 

#This section mounts the various cloud storage into the folders that were created above.

 

rclone mount --max-read-ahead 1024k --allow-other AnmieSeries: /mnt/disks/AnmieSeries &

rclone mount --max-read-ahead 1024k --allow-other Movies: /mnt/disks/Movies &

rclone mount --max-read-ahead 1024k --allow-other Music: /mnt/disks/Music &

rclone mount --max-read-ahead 1024k --allow-other Others: /mnt/disks/Others &

rclone mount --max-read-ahead 1024k --allow-other TV4K: /mnt/disks/TV4K &

rclone mount --max-read-ahead 1024k --allow-other TVShow: /mnt/disks/TVShow &

rclone mount --max-read-ahead 1024k --allow-other TVshowothers: /mnt/disks/TVshowothers &

 

 

 

And i did fellow This guide to setup rclone 

 

 

the first time I finish the setup it did work and play a video after that i did go to bed and when i wake up try to play the video i get nothing and did try multiple apps like infuse and mrmc and kodi and emby and even win file explore and none of them work ! 

 

 

And i wonder what did i do wrong that cause this problem ! 
 

 

 

Edited by sniper
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.