Jump to content
DZMM

Guide: How To Use Rclone To Mount Cloud Drives And Play Files

1060 posts in this topic Last Reply

Recommended Posts

5 minutes ago, DZMM said:

 

Maybe the error is for the rclone mount path - Is it empty?

/mnt/user/mount_rclone/google_vfs ?  No, that's not empty, but unless I'm confused it shouldn't be. It's showing everything that's in my google drive. 

Share this post


Link to post
4 minutes ago, sol said:

/mnt/user/mount_rclone/google_vfs ?  No, that's not empty, but unless I'm confused it shouldn't be. It's showing everything that's in my google drive. 

I got impatient just now and started trying things. 

 

I removed the movies folder in union with rmdir and it deleted, so it didn't have anything in it or it would have warned me. 

I recreated the movies folder and tried to run the mount script. Same error. 

I removed the movies folder from union and ran the mount script. No error!! 

I looked in union and nothing was there. I added the moves folder back and everything in rclone reappeared. 

 

It looks like it's fixed for now, but I don't know how it got broken and why the script wouldn't fix it as it's been running fine. 

Share this post


Link to post
43 minutes ago, sol said:

I got impatient just now and started trying things. 

 

I removed the movies folder in union with rmdir and it deleted, so it didn't have anything in it or it would have warned me. 

I recreated the movies folder and tried to run the mount script. Same error. 

I removed the movies folder from union and ran the mount script. No error!! 

I looked in union and nothing was there. I added the moves folder back and everything in rclone reappeared. 

 

It looks like it's fixed for now, but I don't know how it got broken and why the script wouldn't fix it as it's been running fine. 

There shouldn't be movies folder in unionfs folder before the mount - that was the problem.  Sorry should have spotted that earlier - the unionfs folder should be empty

Share this post


Link to post
1 minute ago, DZMM said:

There shouldn't be movies folder in unionfs folder before the mount - that was the problem.  Sorry should have spotted that earlier - the unionfs folder should be empty

I really appreciate your responses. Thanks for the assist!

Share this post


Link to post

What modifications do I need to make if I want to use this method but without crypt and teamdrives?

Share this post


Link to post
45 minutes ago, Cliff said:

What modifications do I need to make if I want to use this method but without crypt and teamdrives?

Just substitute remotes -  gdrive: for gdrive_media_vfs: in the mount script

Share this post


Link to post

Ok, I changed my mind and tried using the crypt. But I don't understand how to get my google drive media to show up in any of the folders. I noticed that I get a new "crypt" folder on google drive, but if I add any files to it nothing shows up in any of the unraid folders. 

Share this post


Link to post

Dont upload it to google drive direct, let the script upload it.

Share this post


Link to post
8 minutes ago, nuhll said:

Dont upload it to google drive direct, let the script upload it.

Ok, but all folders are empty and nothing gets uploaded or downloaded from the crypt-folder on my google drive. And where am I suppose to see all my mediafiles from the google drive to be able to add them to plex?

 

Share this post


Link to post

I tried changing to a cache instead and mounted manually. Now I get a folder and can see all my google drive media. But when I add that folder to Radarr and try to do a bulk-import of movies the log get flooded with: "Unraid emhttpd: error: get_filesystem_status, 6512: Operation not supported (95): getxattr: /mnt/user/media"

 

Does anyone know why?

Share this post


Link to post

Please follow the tutorial in the first post, if you do it like descriped it works. ALl your questions are answered there too.

Share this post


Link to post
Posted (edited)

I have tried like 5 times now following the guide exactly. I even moved to a new server with new hardware with same result. The closest I have got is that I now got a "crypt file" with random letters in my media folder on google drive which is the mountcheck I believe. If I add another random file to /user/mount_rclone/google_vfs/ I get another encrypted file in my media folder. But nothing from google drive shows up on my server in any of the folders.

 

And if I try with a standard rclone mount command I can mount my google drive to a folder without problems.

Edited by Cliff

Share this post


Link to post
On 8/21/2019 at 7:49 PM, Cliff said:

I have tried like 5 times now following the guide exactly. I even moved to a new server with new hardware with same result. The closest I have got is that I now got a "crypt file" with random letters in my media folder on google drive which is the mountcheck I believe. If I add another random file to /user/mount_rclone/google_vfs/ I get another encrypted file in my media folder. But nothing from google drive shows up on my server in any of the folders.

 

And if I try with a standard rclone mount command I can mount my google drive to a folder without problems.

Post your rclone config and your mount script - remember to remove passwords. 

Share this post


Link to post
Posted (edited)

If u have the mountcheck file crypted on your google drive, all is working. Atleast the transfer. What happens if u use the upload script? All dirs correct? Did you try to restart server and let the scripts automatic run on startup?

 

 

Edited by nuhll

Share this post


Link to post

@DZMMlast couple of days I get API bans. I'm currently filling a backlog, so I'm wondering what could be the case. I suspect it could be both Emby as Plex running on the same API. What do you think?

 

For now I will just create a new API and mount for Plex only.

Share this post


Link to post
1 hour ago, Kaizac said:

@DZMMlast couple of days I get API bans. I'm currently filling a backlog, so I'm wondering what could be the case. I suspect it could be both Emby as Plex running on the same API. What do you think?

 

For now I will just create a new API and mount for Plex only.

Don't know - weren't you having problems with subtitles before?

 

Splitting your mounts will definitely help find the problem

Share this post


Link to post
On 8/23/2019 at 10:18 PM, DZMM said:

Post your rclone config and your mount script - remember to remove passwords. 

I am using all scripts from github unmodified. If I try the same thing using a cache instead and remove the -vfs options in the mountscript it seams to work but when using the crypt nothing gets mounted in any of the created folders. I tried placing a small -nfo file in the upload-folder and after running the upload-script I have a small encrypted file in my media-folder, and also a mountcheck file.

unraid.PNG

Share this post


Link to post
24 minutes ago, DZMM said:

And your mount script 

#!/bin/bash

#######  Check if script is already running  ##########

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

echo "$(date "+%d.%m.%Y %T") INFO: Exiting script already running."

exit

else

touch /mnt/user/appdata/other/rclone/rclone_mount_running

fi

#######  End Check if script already running  ##########

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

# check if gdrive mount already created

if [[ -f "/mnt/user/mount_rclone/google_vfs/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_rclone/google_vfs
mkdir -p /mnt/user/mount_unionfs/google_vfs
mkdir -p /mnt/user/rclone_upload/google_vfs

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 gdrive_media_vfs: /mnt/user/mount_rclone/google_vfs &

# check if mount successful

# slight pause to give mount time to finalise

sleep 5

if [[ -f "/mnt/user/mount_rclone/google_vfs/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/google_vfs/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/google_vfs=RW:/mnt/user/mount_rclone/google_vfs=RO /mnt/user/mount_unionfs/google_vfs

if [[ -f "/mnt/user/mount_unionfs/google_vfs/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   ##########

############### starting dockers that need unionfs mount ######################

# only start dockers once

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

echo "$(date "+%d.%m.%Y %T") INFO: dockers already started"

else

touch /mnt/user/appdata/other/rclone/dockers_started

echo "$(date "+%d.%m.%Y %T") INFO: Starting dockers."

# docker start plex
# docker start ombi
# docker start tautulli
# docker start radarr
# docker start sonarr

fi

############### end dockers that need unionfs mount ######################

exit

Share this post


Link to post

the mount script is exactly as in github, the only thing I modified was commenting out the starting of the docker-containers

Share this post


Link to post

I just noticed when running the uploadscript and looking at the log file it seams too loop through my entire media library on google drive with "skipping undecryptable filename" ? has that something to do with it? I already have a couple of TB with unencrypted media on my google drive that I want to show up in my mount folder

 

Share this post


Link to post
Posted (edited)
29 minutes ago, Cliff said:

 I already have a couple of TB with unencrypted media on my google drive that I want to show up in my mount folder

 

You've just confirmed my suspicions and why i asked for the mount script.  Google_media_vfs: decrypts files that are encrypted on Google - files on Google that aren't encrypted won't be displayed in the mount.  That's why the mountcheck file was all goobledegook on Google as it's encrypted.

 

If you want to see your non-encrypted files mount gdrive:

Edited by DZMM

Share this post


Link to post
28 minutes ago, DZMM said:

You've just confirmed my suspicions and why i asked for the mount script.  Google_media_vfs: decrypts files that are encrypted on Google - files on Google that aren't encrypted won't be displayed in the mount.  That's why the mountcheck file was all goobledegook on Google as it's encrypted.

 

If you want to see your non-encrypted files mount gdrive:

Ok, thanks for the answer. But if I mount gdrive directly I guess that I will not be able to take advantage of the crypt-cache stuff that improved plex-streaming?

As it says on the first page?

 

"I use a rclone vfs mount as opposed to a rclone cache mount as this is optimised for streaming, has faster media start times, and limits API calls to google to avoid bans."

Share this post


Link to post

VFS v cache are the different mount types - you choose the remote to use. If you don't want encrypted then just substitute gdrive: for gdrive_media_vfs: in the script and add an unencrypted version of mountcheck to your /mount_unionfs folder

 

Share this post


Link to post
43 minutes ago, DZMM said:

VFS v cache are the different mount types - you choose the remote to use. If you don't want encrypted then just substitute gdrive: for gdrive_media_vfs: in the script and add an unencrypted version of mountcheck to your /mount_unionfs folder

 

Ok thanks for all the help. I am trying it out now. Just one more question that is slightly of topic. Before when I was experimenting with a cache I was running into some problems where I ran out of RAM or hdd space when I was using plex to scan and add all my media through the remote. After that unraid stopped responding and I had to reboot to be able to get unraid to work again. Is there any settings I need to change in the plex docker when scanning my remotes to prevent it from filling up the docker container? 

 

I have only 12GB of RAM in my current server, do I need to lower any settings in the mountscript? or should it work anyway? 

Share this post


Link to post

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.