Plex Gdrive using union mount

That would be amazing if it worked. Do I just do

mkdir -p /mnt/disks/moviesunion
rclone mount
–allow-other
–allow-non-empty
*> --cache-dir /mnt/disks/rclonetmp *
–vfs-cache-max-age 24h
–vfs-read-chunk-size 32M
–vfs-read-chunk-size-limit 1G
–buffer-size 1G
–log-level INFO
moviesunion: /mnt/disks/moviesunion &

Because doing that didn’t seem to change the cache folder. Am I doing it wrong?

Yeah, that should be it actually. Does the folder exist and are the permissions ok?

Yeah it should be right. However using the option doesn’t change anything. It still shows the old temp folder

2018/10/01 21:41:51 ERROR : Ant-Man and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL-1080p FAS.mkv.partial~: WriteFileHandle.New Rcat failed: write /tmp/rclone-spool322899173/Ant-Man and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL-1080p FAS.mkv.partial~: no space left on device

Maybe it’s some other option when using vfs?

No, shouldn’t be. I am using the same option and its working fine for me.

Can you make sure the same option is not present in rclone.conf? Also, try launching with the debug output and paste the initial lines. Perhaps they will give some hints.

Well the rclone config hasn’t changed, so it still looks like this

[gdrive]
type = drive
scope = drive
token = {“access_token”:“XXXXXX”}

[crypt]
type = crypt
remote = gdrive:crypt
filename_encryption = standard
directory_name_encryption = true
password = XXXXX
password2 = XXXXX

[moviesunion]
type = union
remotes = crypt:movies mnt/user/Movies

[showsunion]
type = union
remotes = crypt:shows mnt/user/Series

This is the start of the debug, it looks fine to me

2018/10/01 22:20:07 DEBUG : rclone: Version “v1.43-119-g59e14c25-beta” starting with parameters [“rcloneorig” “–config” “/boot/config/plugins/rclone-beta/.rclone.conf” “mount” “–allow-other” “–allow-non-empty” “–cache-dir” “/mnt/user/tmp” “–vfs-cache-max-age” “24h” “–vfs-read-chunk-size” “32M” “–vfs-read-chunk-size-limit” “1G” “–buffer-size” “1G” “–log-level” “DEBUG” “moviesunion:” “/mnt/disks/moviesunion”]
2018/10/01 22:20:07 DEBUG : Using config file from “/boot/config/plugins/rclone-beta/.rclone.conf”
2018/10/01 22:20:09 INFO : union root ‘’: poll-interval is not supported by this remote
2018/10/01 22:20:09 DEBUG : union root ‘’: Mounting on “/mnt/disks/moviesunion”
2018/10/01 22:20:09 INFO : union root ‘’: poll-interval is not supported by this remote
2018/10/01 22:20:09 DEBUG : Adding path “vfs/forget” to remote control registry
2018/10/01 22:20:09 DEBUG : Adding path “vfs/refresh” to remote control registry
2018/10/01 22:20:09 DEBUG : Adding path “vfs/poll-interval” to remote control registry
2018/10/01 22:20:09 DEBUG : : Root:
2018/10/01 22:20:09 DEBUG : : >Root: node=/, err=
2018/10/01 22:21:07 NOTICE: Ant-Man and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL-1080p FAS.mkv.partial~: Removing partially written file on error: write /tmp/rclone-spool210980343/Ant-Man and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL-1080p FAS.mkv.partial~: no space left on device

I really can’t tell why it keeps to /tmp/rclone, but I’m glad we’ve narrowed the issue down to that. But I have no idea how to change it. Hmmmmm

There looks to be an issue for this: https://github.com/ncw/rclone/issues/2604

Potential fix: Cach-chunk-path ignored when vfs set

Try if this works.

Wow, thank you for finding that!

How would I go about setting XDG_CACHE_HOME?
Is it just add “XDG_CACHE_HOME=/mnt/user/tmp” to the script?

Yeah, that should be it.

Well I could just wait for the bug-fix, since I still can’t write or play anything from the mount.
I’m running unraid so maybe setting XDG_CACHE_HOME is a different command?

My script is now

#!/bin/bash
mkdir -p mnt/user/tmp

XDG_CACHE_HOME=mnt/user/tmp

mkdir -p /mnt/disks/moviesunion
rclone mount
–allow-other
–cache-db-purge
–allow-non-empty
–vfs-cache-max-age 24h
–vfs-read-chunk-size 32M
–vfs-read-chunk-size-limit 1G
–buffer-size 1G
–log-level DEBUG
moviesunion: /mnt/disks/moviesunion &

mkdir -p /mnt/disks/showsunion
rclone mount
–allow-other
–cache-db-purge
–allow-non-empty
–vfs-cache-max-age 24h
–vfs-read-chunk-size 32M
–vfs-read-chunk-size-limit 1G
–buffer-size 1G
–log-level INFO
showsunion: /mnt/disks/showsunion &

The log still shows this, when writing to it:

2018/10/02 07:33:33 ERROR : Ant-Man and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL1080p
FAS.mkv.partial~: WriteFileHandle.New Rcat failed: write /tmp/rclone-spool132999955/AntMan
and the Wasp (2018)/Ant-Man and the Wasp (2018) - WEBDL-1080p FAS.mkv.partial~: no space
left on device

@ncw Any thoughts on how to solve this?

Try this: export XDG_CACHE_HOME=mnt/user/tmp instead of simply assigning to the variable.

I’m really glad you’re helping. Unfortunately adding export didn’t work either. Still getting the same

The.Lord.Of.The.Rings.The.Fellowship.Of.The.Ring.2001.1080p.BluRay.h.265.HEVC-SiNNERS/The Lord of the Rings The Fellowship of the Ring (2001) - Bluray-720p CtrlHD.mkv.partial~: WriteFileHandle.Flush error: write /tmp/rclone-spool419779146/Lord of the Rings The Fellowship of the Ring, The (2001) -

I’m also getting another new error now, but I don’t know if they are related

2018/10/02 10:08:22 ERROR : Bull (2016)/Season 3/Bull.(2016).S03E02.Jury.Duty.HDTV-720p.KILLERS.mkv.partial~: Dir.Rename error: Fs “union root ‘’” can’t rename files (no server side Move or Copy)

that should work. You need to run that in the same shell you run the rclone mount in. Also you’ll probably want a leading / so export XDG_CACHE_HOME=/mnt/user/tmp

That is a different issue. The Union mount needs to implement the optional Methods Move, Copy, DirMove etc. It might be better to embed the fs for this…

Can you please make a new issue on github about this - it should be straight forward to fix.

Unfortunately the leading / didn’t fix it. Rclone just doesn’t use the new folder as the cache, but keeps the old one.
My script looks like this:

mkdir -p /mnt/user/tmp/rclone

export XDG_CACHE_HOME=/mnt/user/tmp/rclone

mkdir -p /mnt/disks/moviesunion
rclone mount
–allow-other
–allow-non-empty
–vfs-cache-max-age 24h
–vfs-read-chunk-size 32M
–vfs-read-chunk-size-limit 1G
–buffer-size 1G
–log-level INFO
moviesunion: /mnt/disks/moviesunion &

It doesn’t really show any errors when playing an item, that’s located in the cloud, but it doesn’t play.
Trying to write into the folder gives this error (which is caused by the use of /tmp/ ):

2018/10/02 11:40:40 ERROR : The Legend of Tarzan (2016)/The Legend of Tarzan (2016) - Bluray-1080p SPARKS.mkv.partial~: WriteFileHandle.New Rcat failed: write /tmp/rclone-spool849075579/The Legend of Tarzan (2016)/The Legend of Tarzan (2016) - Bluray-1080p SPARKS.mkv.partial~: no space left on device

An update:

I tried a hacky solution, by running a script on startup that deletes the mandatory cache folder, and afterwards symlinking it to another folder with more capacity. That fixed the transfer issues.

And then I mounted the union on a SMB share on windows, and tried to play a remote file through there, and it worked! Now it’s only plex who doesn’t play along. Plex still only plays the local files.

Does that somehow get us any further?

Ah, should have spotted that earlier… That is Rcat buffering the files in /tmp not the cache backend. So either set the TMPDIR environment variable or use --vfs-cache-mode writes and --cache-dir to say where you want the writes to go.

Does this mean without the writes cache-mode, it will still use /tmp/ even if cache-dir is specified because of the earlier mentioned bug?

Plex & Rclone Info logs?

Wow that moved the tmp folder, good job! And it almost works as well. It worked to the point where I ran into the error, that has to be fixed, and that I made an issue for on github. Is there a possible workaround until it’s fixed? (I mean, I can just upload to a crypt mount instead for now)

2018/10/02 19:24:49 INFO : The Legend of Tarzan (2016)/The Legend of Tarzan (2016) - Bluray-1080p Radarr.mkv.partial~: Copied (new)
2018/10/02 19:24:49 ERROR : The Legend of Tarzan (2016)/The Legend of Tarzan (2016) - Bluray-1080p Radarr.mkv.partial~: Dir.Rename error: Fs “union root ‘’” can’t rename files (no server side Move or Copy)
2018/10/02 19:24:49 ERROR : The Legend of Tarzan (2016)/The Legend of Tarzan (2016) - Bluray-1080p Radarr.mkv.partial~: Dir.Rename error: Fs “union root ‘’” can’t rename files (no server side Move or Copy)

It also posts this every time I run the script, even though I haven’t set a poll-interval

2018/10/02 19:45:32 INFO : union root ‘’: poll-interval is not supported by this remote

The playback works from changing that one command (I think there’s some issue with some subtitles, but I can figure that out myself). My God you’ve been helpful, thank you so much.

Yes it will still use /tmp but it is a different problem - namely the Rcat operation needing to make a temporary file.

Maybe Rcat should be storing it’s data somewhere else, I don’t know!

Great!

On the issue https://github.com/ncw/rclone/issues/2619 I posted a beta (which is really there now!) which should fix the problem.

That is normal - mount attempts to set up a poll-interval at the default 1m rate.