Jump to content

Emby Media Server adding GDrive Mountpoint on Raspberry PI


Go to solution Solved by rodainas,

Recommended Posts

Posted

Thanks a lot I made it ;) One last question.. I need to keep the terminal window with the rclone command open. Is there a chance to start it by booting the PI?

 

Posted (edited)

I would also check the following out as it works perfectly for me and has been tweaked over the years, i.e VFScache is now the preferred option

[Unit]
Description=RClone Mount Service
Wants=network-online.target
After=network-online.target

[Service]
Type=notify
KillMode=none

ExecStart=/bin/rclone mount YOURRCLONEMOUNTNAME: /PATH/TO/YOUR/LOCAL/MOUNT/POINT \
  --config /root/.config/rclone/rclone.conf \
  --cache-dir=/vfscache/YOURMOUNTNAME \
  --vfs-cache-max-size 80G \
  --poll-interval 15s \
  --log-level INFO \
  --dir-cache-time 5000h \
  --vfs-cache-mode writes \
  --vfs-read-chunk-size 128M \
  --vfs-cache-max-age 3h \
  --vfs-cache-poll-interval 5m \
  --allow-other \
  --bwlimit 110M \
  --no-checksum \
  --no-modtime \
  --drive-pacer-min-sleep 10ms

StandardOutput=file:/rclonelogs/rclone_vfs_mount_flix2.log
ExecStop=/bin/fusermount -uz /PATH/TO/YOUR/LOCAL/MOUNT/POINT
Restart=on-failure

[Install]
WantedBy=default.target

You can add any flags you needed in your previous messages here

 

However Note the following

Path Mounts

/PATH/TO/YOUR/LOCAL/MOUNT/POINT

This is the folder you created on your PI in which the Rclone Mount is Mounted, this is entered twice both at the top and in the unmount command at the bottom

YOURRCLONEMOUNTNAME

This is your Rclone Mount NAME

VFS Cache Settings

--vfs-cache-max-size 80G \
--vfs-cache-mode writes \
--vfs-read-chunk-size 128M \

Set Max size to whatever you like, obviously depends on how much storage space you have

Cache Mode Writes means files you upload to gdrive will get cached this is useful in certain situations and for certain applications, it will cache them for the specified time or until the cache limit is hit. Don't use Full at first which is another option as that caches read and writes and if you scan say with Emby will cause the cache to fill up quick as the emby scan will pull down chunks of files and vfs will cache them all, after an initial scan is complete then you could switch this to full if you have good space

Read Chunk Size is important, default is 128M anyway, And you can add a MAX flag as well however on initial scan i always found setting this to 8mb and max at 32mb meant i did not hit any google api bans, once scan complete you can set back to 128M or remove flag all together

Bandwidth Limits

  --bwlimit 110M \

Set this to the maximum bandwidth you want to allow, this affects both uploads and Downloads. So if your net connection is say 200Mbps but you only want half avaliable for use set this to 12M (12*8 =96mbps)

Api Limits

  --drive-pacer-min-sleep 10ms

Depending on your api limits you may need to change this (Google recently updated the api limits (the old flag used to be called tpslimit) if you have the increased api limits then leave as set above see here for reasoning and how to check - Quotas per 100 Seconds

Logging

StandardOutput=file:/rclonelogs/rclone_vfs_mount_MOUNTNAME.log

If you want logs of whats happening (info) then set the path here

 

Avoiding Errors

Systemd and failures whne starting services can be a royal pain in the backside so i do this before starting

  • If using vfscache create the folder you stated in the --cache-dir first
  • If using logging create the folder you stated in -standardOutput=file
  • Then create the logfile itself - nano rclone_vfs_mount_MOUNTNAME.log ,then ctrl o and ctrl x to close and save

If any of the folders already have files init you may get exit code 1 error so always best to use fresh folder, or add the allow non empty flag

Then:

systemctl start YOURSYSTEMDFILENAME.service

If it starts without error then type:

systemctl enable YOURSYSTEMDFILENAME.service

And check if it's loaded with

systemctl status YOURSYSTEMDFILENAME.service

 

You can create one of these files for each mount you make just name it something different

 

Edited by CassTG
  • Thanks 1
  • 3 weeks later...
Posted

Hello,

would you please advice me one more time? Everything works fine, but every week the token gehts expired and I would like to avoid it adding the new token every week.

Is there a way to get this issue solved?

Thanks

Posted (edited)
1 hour ago, chris31077 said:

Hello,

would you please advice me one more time? Everything works fine, but every week the token gehts expired and I would like to avoid it adding the new token every week.

Is there a way to get this issue solved?

Thanks

This is standard practise, unless you submit the Google OAUTH "app" for approval it is in testing mode, you are unlikely to get approval most do not.

That means you need to renew the token weekly. You could use Service Accounts i believe to get round this, but thats a whole world of pain.

Edited by CassTG

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...