Setting up RClone mount on Ubuntu. A little steer greatly appreciated

Looks good.

Dir-cache time is written up here -> https://rclone.org/commands/rclone_mount/#directory-cache

Ok so that would mean the cache is only updated every 3 days right?

That’s quite a wait for new content. I usually have daily TV episodes downloaded, so that might not work for me.

Were you getting bans going lower than that, or do you not need to update your libraries that often?

You get any new stuff via polling which is 1 minute by default so that’s all you wait if you were loading stuff from another source into your GD.

Lower versions didn’t have chunked support and that’s what caused the bans. You should not see an issue now.

Ok cool, so I should be good to go then?

If I need to make changes to the mount, should I use

fusermount -uz /home/craftyclown/Skull

and then

rclone mount “gdrive:/The Skull” /home/craftyclown/Skull --daemon --dir-cache-time 72h

Yep, looks good to go!

1 Like

So she’s been up and running for almost 24 hours now without issues :slight_smile:

I’ll be installing Radarr, Sonarr, Lidarr, Ombi, Tautualli and RuTorrent next. As they will be interacting with Plex will I need to install them as my user and group craftyclown:craftyclown?

One thing I haven’t got my head around is how to put my rclone mount into a script that starts with the server. Is there some kind of template I can use for anything I want to auto start?

So that isn’t too bad as Ubuntu and Debian (what I use) both use systemd for startup scripts and stuff.

You could do something along these lines with making some changes for your user name.

cd /etc/systemd/system
vi rclone.service

and with the fun of vi, hit “i” to insert and paste in the file below with the proper changes and hit ESC than : than wq! to write/quit and save the file.

[Unit]
Description=RClone Service
PartOf=gmedia.service
RequiresMountsFor=/data

[Service]
Type=notify
Environment=RCLONE_CONFIG=/data/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount gcrypt: /GD \
   --allow-other \
   --bind 192.168.1.30 \
   --buffer-size 256M \
   --dir-cache-time 72h \
   --drive-chunk-size 32M \
   --log-level INFO \
   --log-file /home/felix/logs/rclone.log \
   --umask 002 \
   --vfs-read-chunk-size 128M \
   --vfs-read-chunk-size-limit off \
   --rc
ExecStop=/bin/fusermount -uz /GD
Restart=on-failure
User=felix
Group=felix

[Install]
WantedBy=multi-user.target

I use a custom rclone location for my rclone.conf as you see by the environment variable defined. I run my user as feilx and those are all my standard settings for the mount.

Once the file is saved.

systemctl daemon-reload
systemctl start rclone.service
systemctl status rclone.service

That reloads the files from disk for systemd and starts the service and checks the status on the last command.

Most of that seems clear, however I’m not 100% sure about the ExecStart line. Does the below look about right?

[Unit]
Description=RClone Service
PartOf=gmedia.service
RequiresMountsFor=/data

[Service]
Type=notify
Environment=RCLONE_CONFIG=//home/craftyclown/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount “gdrive:/The Skull” /home/craftyclown/Skull
–allow-other
–bind 148.251.191.194
–buffer-size 256M
–dir-cache-time 72h
–drive-chunk-size 32M
–log-level INFO
–log-file /home/craftyclown/logs/rclone.log
–umask 002
–vfs-read-chunk-size 128M
–vfs-read-chunk-size-limit off
–rc
ExecStop=/bin/fusermount -uz /GD
Restart=on-failure
User=craftyclown
Group=craftyclown

[Install]
WantedBy=multi-user.target

Ok so I must have made a mistake somewhere as

systemctl start rclone.service

returns this message…

Job for rclone.service failed because the control process exited with error code .
See “systemctl status rclone.service” and “journalctl -xe” for details.

My guess is the execstart line?

So close, but see how i have the \ at the end of the lines. That means that the lines continue so you need to put those after each line in the exec start like this:

[Unit]
Description=RClone Service
PartOf=gmedia.service
RequiresMountsFor=/data

[Service]
Type=notify
Environment=RCLONE_CONFIG=//home/craftyclown/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount “gdrive:/The Skull” /home/craftyclown/Skull \
–allow-other \
–bind 148.251.191.194 \
–buffer-size 256M \
–dir-cache-time 72h \ 
–drive-chunk-size 32M \
–log-level INFO \
–log-file /home/craftyclown/logs/rclone.log \
–umask 002 \
–vfs-read-chunk-size 128M \
–vfs-read-chunk-size-limit off \
–rc
ExecStop=/bin/fusermount -uz /GD
Restart=on-failure
User=craftyclown
Group=craftyclown

[Install]
WantedBy=multi-user.target

Make sense?

Sadly that’s not it. I had the back slashes but they didn’t show up when I pasted them onto this page.

[Unit]
Description=RClone Service
PartOf=gmedia.service
RequiresMountsFor=/data

[Service]
Type=notify
Environment=RCLONE_CONFIG=//home/craftyclown/.config/rclone/rclone.conf
ExecStart=/usr/bin/rclone mount “gdrive:/The Skull” /home/craftyclown/Skull
–allow-other
–bind 148.251.191.194
–buffer-size 256M
–dir-cache-time 72h
–drive-chunk-size 32M
–log-level INFO
–log-file /home/craftyclown/logs/rclone.log
–umask 002
–vfs-read-chunk-size 128M
–vfs-read-chunk-size-limit off
–rc
ExecStop=/bin/fusermount -uz /GD
Restart=on-failure
User=craftyclown
Group=craftyclown

[Install]
WantedBy=multi-user.target

lol. No idea why they disappear when I post them here. You’ll have to trust me when I say my script looks exactly the same as yours. Any idea where else I might be going wrong?

My guess was the execstart line. Is that where Rclone is meant to be? I had a look there but couldn’t see it.

Oh two things I can see as I left some of my stuff hanging in there by mistake.

PartOf=gmedia.service
RequiresMountsFor=/data

Those 2 can be just deleted (my mistake).

Do that and systemctl daemon-reload and then try to start it up.

If it fails, you can type systemctl status rclone and see the output.

Still no go. This was the error when I ran

systemctl start rclone.service

Job for rclone.service failed because the control process exited with error code .
See “systemctl status rclone.service” and “journalctl -xe” for details.

and this is what I got when I ran

systemctl status rclone

rclone.service
Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-12-22 02:11:03 CET; 57s ago
Process: 8314 ExecStart=/usr/bin/rclone mount gdrive:/The Skull /home/craftyclown/Skull --allow-other --bind 148.251.191.194 --buff
Main PID: 8314 (code=exited, status=1/FAILURE)

Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Service RestartSec=100ms expired, scheduling restart.
Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Scheduled restart job, restart counter is at 5.
Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: Stopped rclone.service.
Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Start request repeated too quickly.
Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Failed with result ‘exit-code’.
Dec 22 02:11:03 Ubuntu-1810-cosmic-64-minimal systemd[1]: Failed to start rclone.service.

Your line looks to be cutoff as the \ after buffer seems to be missing.

Sorry, here’s the full message…

● rclone.service
Loaded: loaded (/etc/systemd/system/rclone.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2018-12-22 02:21:48 CET; 20s ago
Process: 15400 ExecStart=/usr/bin/rclone mount gdrive:/The Skull /home/craftyclown/Skull --allow-other --bind 148.251.191.194 --buffer-size 256M --dir-cache-time 72h --drive-chunk-size 32M --log-level INFO --log-file /home/craftyclown/
Main PID: 15400 (code=exited, status=1/FAILURE)

Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Main process exited, code=exited, status=1/FAILURE
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Failed with result ‘exit-code’.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: Failed to start rclone.service.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Service RestartSec=100ms expired, scheduling restart.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Scheduled restart job, restart counter is at 5.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: Stopped rclone.service.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Start request repeated too quickly.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: rclone.service: Failed with result ‘exit-code’.
Dec 22 02:21:48 Ubuntu-1810-cosmic-64-minimal systemd[1]: Failed to start rclone.service.

You need to put a logfile name after /home/craftyclown/

so like /home/craftyclown/rclone.log

or something like that.

I have. It doesn’t seem to show in the terminal window as it goes off screen and I can’t copy and paste it.

So the error in red is here, just after --rc

–vfs-read-chunk-size-limit off --rc (code=exited, status=1/FAILURE)