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


DZMM

2468 posts in this topic Last Reply

Recommended Posts

4 hours ago, X672 said:

Hello again :)

 

Just wondering if there is a "easier" way if I already have a shared folder in unraid with about 4000 folders except for copying them into the "\mount_mergerfs\gdrive_media_vfs" folder to make it upload them to gdrive?

 

I used MC and went to each drive and created a \local\ folder - and moved any movies from whatever path they were at to the \local\ folder. so that you are moving within the disk. 

Link to post
  • Replies 2.5k
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

3/1/20 UPDATE: TO MIGRATE FROM UNIONFS TO MERGERFS READ THIS POST.  New users continue reading 13/3/20 Update: For a clean version of the 'How To' please use the github site https://github.com/B

Multiple mounts, one upload and one tidy-up script.   @watchmeexplode5 did some testing and performance gets worse as you get closer to the 400k mark, so you'll need to do something like bel

so ive been reading for ages but theres so many pages here, my issue is that when the array is stopped the mergerfs mount is not unmounted casuing unraid to keep retrying indefinately to unmount share

Posted Images

Hi

 

A quick question to the performance for docker an mergerfs. On Git it is described that dockers shoulb be linked direktly to the /mnt/user share for best perfomance with mergerfs. Isn't this a bit risky to give dockers full access to all files on UnRaid this way?

Is the perfomance much worse if its linked to a subfolder in the "union" directory of mergerfs?

 

 

Cheers

Simon

Link to post
On 6/1/2021 at 8:03 AM, Symon said:

Hi

 

A quick question to the performance for docker an mergerfs. On Git it is described that dockers shoulb be linked direktly to the /mnt/user share for best perfomance with mergerfs. Isn't this a bit risky to give dockers full access to all files on UnRaid this way?

Is the perfomance much worse if its linked to a subfolder in the "union" directory of mergerfs?

 

 

Cheers

Simon

 

I'm wondering the same thing; and I'm wondering how much of this is dogma. I also don't know why it would need the root /mnt/user instead of the more conservative /mnt/user/merger_fs (which I would still not be a fan of since I assume most of us are going to be compartmentalizing that directory further).

 

My only guess as to why their might be a difference is if rclone can share a connection if the root directory is mounted, instead of having to reestablish a connection to the Cloud service for each individual subdirectory request, but I readily admit ignorance of rclone's mechanisms.

Link to post
Posted (edited)

Another few questions myself:

 

1. RcloneCacheShare="/mnt/user0/mount_rclone" - Is there a reason this "Rclone Cache" isn't using the cache and is using spinning rust directly instead? Should this be /mnt/cache/mount_rclone? I saw a similar question asked in the past 99 pages, but never saw a response.

 

2. If we're using VFS caching with rclone mount, why do we need the rclone upload (rclone move) script? I have noticed that sometimes when I make a change, it's transferred immediately (even though the upload script hasn't run yet) and other times, the upload script seems to have to do the work. Any idea why?

 

Thanks.

Edited by T0rqueWr3nch
Link to post

I would appreciate some help from anyone. I'm not good with rclone but I'd like to use it with Google drive. I followed spaceinvader one's 4 year old video but it's changed a lot since then. I've got my drives setup like in the video. I've got a google and a secure. I found the github scripts for mounting, unmounting and uploading, but I have no idea how to change those to fit my needs. I'm wanting to first copy my Plex folder to it and then start having my plex use the cloud files.

Here's my mount part that I edited:

 

RcloneRemoteName="secure" # Name of rclone remote mount WITHOUT ':'. NOTE: Choose your encrypted remote for sensitive data

RcloneMountShare="/mnt/user/google" # where your rclone remote will be located without trailing slash e.g. /mnt/user/mount_rclone

RcloneMountDirCacheTime="720h" # rclone dir cache time

LocalFilesShare="/mnt/user/Plex" # location of the local files and MountFolders you want to upload without trailing slash to rclone e.g. /mnt/user/local. Enter 'ignore' to disable

RcloneCacheShare="/mnt/user0/google" # location of rclone cache files without trailing slash e.g. /mnt/user0/mount_rclone

RcloneCacheMaxSize="400G" # Maximum size of rclone cache

RcloneCacheMaxAge="336h" # Maximum age of cache files

MergerfsMountShare="/mnt/user/mount_mergerfs" # location without trailing slash e.g. /mnt/user/mount_mergerfs. Enter 'ignore' to disable

DockerStart="sabnzbd plex binhex-sonarr binhex-radarr radarr ombi" # list of dockers, separated by space, to start once mergerfs mount verified. Remember to disable AUTOSTART for dockers added in docker settings page

MountFolders=\{"downloads/complete,downloads/intermediate,downloads/seeds,movies,tv,scary movies,kids movies,4k movies.4k tv series"\} # comma separated list of folders to create within the mount

 

 

 

Here's my upload that I know isn't right:

RcloneCommand="copy" # choose your rclone command e.g. move, copy, sync

RcloneRemoteName="secure" # Name of rclone remote mount WITHOUT ':'.

RcloneUploadRemoteName="secure" # If you have a second remote created for uploads put it here. Otherwise use the same remote as RcloneRemoteName.

LocalFilesShare="/mnt/user/Plex" # location of the local files without trailing slash you want to rclone to use

RcloneMountShare="/mnt/user/google" # where your rclone mount is located without trailing slash e.g. /mnt/user/mount_rclone

MinimumAge="15m" # sync files suffix ms|s|m|h|d|w|M|y

ModSort="ascending" # "ascending" oldest files first, "descending" newest files first

Link to post

Hi all 

 

Quick question, does anyone has been able to map 2 gdrive with 2 seperate script or in the same ?

 

i want to access 2 gdrive account but i can't i'm always gettin errors about port already bind

 

 

thx

Link to post
6 hours ago, francrouge said:

Hi all 

 

Quick question, does anyone has been able to map 2 gdrive with 2 seperate script or in the same ?

 

i want to access 2 gdrive account but i can't i'm always gettin errors about port already bind

 

 

thx

 

Try to add this to your script under "# Add extra commands or filters" and restart your server :)

Command2="--rc-addr 127.0.0.1:0"

 

Link to post

My issue is that on server reboot some of my docker containers seem to boot faster than the rclone mount comes up. For example emby keeps giving me can't find media stream errors and from within the docker console no files show up. Rebooting the docker containers picks up the mount properly.

Anyone else have this problem ? Any way to delay docker startup on array start ?

Sent from my SM-N960W using Tapatalk

Link to post
26 minutes ago, bobo89 said:

My issue is that on server reboot some of my docker containers seem to boot faster than the rclone mount comes up. For example emby keeps giving me can't find media stream errors and from within the docker console no files show up. Rebooting the docker containers picks up the mount properly.

Anyone else have this problem ? Any way to delay docker startup on array start ?

Sent from my SM-N960W using Tapatalk
 

There's an option in the script to enter dockers to start after a successful mount

Link to post

Hi all 

 

 

Anyone has tried to sync or copy a gdrive account to another gdrive account throught this rclone script ?

 

Looking for help or maybe hits if its possible in another way .

 

 

thx all

Link to post
On 6/3/2021 at 5:59 PM, T0rqueWr3nch said:

Another few questions myself:

 

1. RcloneCacheShare="/mnt/user0/mount_rclone" - Is there a reason this "Rclone Cache" isn't using the cache and is using spinning rust directly instead? Should this be /mnt/cache/mount_rclone? I saw a similar question asked in the past 99 pages, but never saw a response.

 

2. If we're using VFS caching with rclone mount, why do we need the rclone upload (rclone move) script? I have noticed that sometimes when I make a change, it's transferred immediately (even though the upload script hasn't run yet) and other times, the upload script seems to have to do the work. Any idea why?

 

Thanks.

I was wondering the same. You ever figure it out?

Link to post
On 6/14/2021 at 5:00 AM, INTEL said:

I was wondering the same. You ever figure it out?

 

So just a follow-up for at least question 1: I DO NOT recommend using /mnt/user0/mount_rclone. I wanted my cache to be a real cache (i.e. to use the Unraid cache drive), but I also wanted to be able to move it to disk if I need to clear up space, so instead I went with /mnt/user/mount_rclone with the mount_rclone share set to use cache.

 

As for question two, I still haven't thoroughly looked into why the upload script is necessary when using rclone mount. I believe the reason is because we're using mergerfs and when we write new files to the mergerfs directory, we're physically writing to the LocalFileShare mount and not to mount_rclone itself. Therefore the upload script is necessary to make sure any new files get uploaded. Any pre-existing files, if modified, I'm willing to bet are actually modified within the rclone mount cache and handled directly by rclone mount itself.

Link to post
  • 2 weeks later...

I'm having problems getting the service accounts to automatically rotate. Once the api limit is reached on an account the counter doesn't seem to update to use the next one. Everything works fine if change the counter manually.

I also took a look at the code and there doesn't seem to be any feedback mechanism to iterate the account on api errors. However it seems like others are able to run large jobs without any problems?

 

Anyone able to provide some guidance on how to properly get the service accounts to iterate?

Link to post

Is there a simple way to mount more than 1 gdrives? I have 3 teamdrives that I would like to mount on the same box. Should I simply copy the script and modifie to the new mount? I feel like this is not the way to go - or is it?

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.