Best mount settings for streaming ( Plex )

I use the following, which works quite well for me:

./plexdrive-linux-amd64 -v 3 -o allow_other,read_only -t /data/tmp --clear-chunk-max-size=100G --clear-chunk-age=24h --chunk-size=30M /mnt/gdrive02-crypt

edit crontab file with ==> crontab -e and add a line like this

@reboot sleep 30 && /Path/to/Script//RebootMount.sh

This script must be executable and contains the command you normaly use to mount your drive
On cron execution always use absolute path to rclone :

/usr/sbin/rclone mount ACDMount: /path/to/library/Folder -param1 - param2 -param3 &

Cron seems to be the wrong place. On debian based systems, use this more elegant hack:

/etc/rc.local (before the ā€˜exit 0ā€™ line!)

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

nohup ./plexdrive-linux-amd64 -v 3 -o allow_other,read_only -t /data/tmp --clear-chunk-max-size=100G --clear-chunk-age=24h --chunk-size=30M /mnt/gdrive02-crypt &

exit 0

or go the most elegant and correct way, using a systemd service:

hello @dweidenfeld,
is this normal??

[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzdWY3aTNnYjVQZkk in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzR2tNbXd4NUNoN1E
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzR2tNbXd4NUNoN1E in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzQThiUFcyY2pHVU0
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzQThiUFcyY2pHVU0 in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzR1N0ZEtRYVdpZ2s
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzR1N0ZEtRYVdpZ2s in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzMVdJMldzM2l5Rjg
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzMVdJMldzM2l5Rjg in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzekZ4V01WREpkMkU
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzekZ4V01WREpkMkU in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzRDdDQ0k4ZUI0OU0
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzRDdDQ0k4ZUI0OU0 in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzV2J0M2JfNTNVZG8
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzV2J0M2JfNTNVZG8 in cache
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Deleting object 0B0fKJMA00CwzUDZPYno5R3B1T1U
[PLEXDRIVE] [2017-05-19 21:52] DEBUG : Storing object 0B0fKJMA00CwzUDZPYno5R3B1T1U in cache

Iā€™ve started it like this:

plexdrive -v 3 -o allow_other,read_only -t /home/plex/plextmp/ --clear-chunk-max-size=100G --clear-chunk-age=24h --chunk-size=30M /home/plex/ACD/.gdrive

my gdrive is encrypted with encFS
Iā€™m just literally using plexdrive to exchange rclone for the mount (if I understood correctly) and if itā€™s mounted I can encfs the .gdrive folder into gdrive and unionfs with my ā€œlocalā€ folder into media, and point PLEX to the /home/plex/ACD/media folder

(ACD is the folder, as I coming from the ACD setup)

UPDATE:
Itā€™s normal

(if anyone else is having such strange messages)

Itā€™s finished the cache
I have decrypted the drive with encfs

remove the debug switch ā€˜-v 3ā€™ if you wanā€™t it to be less communicative. :slight_smile:

Thank You. Works perfect.

Iā€™ve just kicked off the First cache build process and it looks like it may take many hours. (Very large library.)

Will the cache build process run each time plexdrive is started? Does it run faster after the initial build?

You should point --config=/dev/shm/ ( copy json files from default one inside ) and it will be built within 10 minutes.
Dont forget to move cache file back to default location and remove config flag.

p.s. Once its built, updates are very fast.

Iā€™ve run the first plexdrive and after some hours it finished ā€œcachingā€ my whole GDrive.
Also Iā€™ve created the encripted mount and it is working through ssh but once I try to play any files on plex it stays loading forever.
Plexdrive CMD = /usr/local/bin/plexdrive -v 2 -o allow_other,read_only -t /data/tmp --clear-chunk-max-size=100G --clear-chunk-age=24h --chunk-size=30M /home/plex
Encripted CMD = /usr/sbin/rclone mount --allow-other --allow-non-empty --max-read-ahead 30G --checkers 16 --acd-templink-threshold 0 --quiet --stats 0 secret: /home/gdrive

Hi @IhToN
Iā€™m only just getting started with Plexdrive myself, but Iā€™m not sure we need all of the extra flags in our rclone mount commands. The guide published at https://github.com/dweidenfeld/plexdrive/blob/master/TUTORIAL.md suggests using only the ā€œā€“allow-otherā€ flag.

The ā€œā€“acd-templink-threshold 0ā€ flag youā€™ve got set is specifically intended for Amazon Cloud Drive. So that could be causing a problem of some sort.

The Encrypted command is the same Iā€™ve been using before migrating to plexdrive.

what encryption do you use?
crypt from rclone?

where do you point plex for its library?
/home/gdrive ?

what folders are in /home/plex for you?

Iā€™m using rclone encryption.

/home/plex shows the whole Google Drive folder (with the encrypted folder insied)
/home/gdrive points to /home/plex/encryptedfoldername

rclone should be done local, you have to change a few things:

Folders:

root@ns328963:~# cd /home/
root@ns328963:/home# ls
downloads  gdrive  nextcloud  plex  seedbox
root@ns328963:/home# cd plex
root@ns328963:/home/plex# ls
Biblioteca Calibre  Getting started  mqkb17v8idme414nns29od6j5k  MultiMedia
root@ns328963:/home/plex# cd ..
root@ns328963:/home# cd gdrive/
root@ns328963:/home/gdrive# ls
MultiMedia

Plexdrive.service: https://gyazo.com/c38f52155257f19db91b676249835b6a
Multimedia.service (encrypted rclone): https://gyazo.com/0adca6bebf52c9424ced9cb55664119c

DF command

root@ns328963:/home# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root        20G  7.1G   12G  40% /
devtmpfs        2.0G     0  2.0G   0% /dev
tmpfs           2.0G   12K  2.0G   1% /dev/shm
tmpfs           2.0G   29M  1.9G   2% /run
tmpfs           5.0M     0  5.0M   0% /run/lock
tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup
/dev/sda3       1.8T   41G  1.7T   3% /home
secret:         1.0P     0  1.0P   0% /home/gdrive

Iā€™ve followed that guide and it mounts well, itā€™s just that it seems that Plex canā€™t access the files.

Thank you, @Ajki, for the pointer to use /dev/shm/ as an intermediate config location for the initial cache build. It indeed went much faster, finishing in 16 minutes. Then I moved the files from there to the default config directory and ran Plexdrive again. The update was very fast, as youā€™d predicted.

Okay, Iā€™ve got to askā€¦ I assume everyone is using Google for Business with 5 accounts to get the unlimited storage? Who do you recommend then for the VPS/Dedicated server side of things? To me it seems you must have a provider with unmetered bandwidth? Thanks for any replies. Iā€™m really looking to do this myself, but I canā€™t seem to actually ā€œfindā€ all the puzzle pieces. :wink:

I made a script to rebuild cache in memory and move it back to default location.
It takes 176 seconds for my 64GB Library

p.s. You can specify the list of commands what to stop before it starts eg stop plex radarr sonarr etcā€¦

3 Likes

Thanks for this. May I ask, why is this script necessary? Why would you need to rebuild the cache regularly? Surely once itā€™s built it shouldnā€™t be need again or done regularly.

1 Like

I think you mean 64TB, since my library of 15TB took nearly the same time. Fantastic idea! Before your script it could take like 10hours+