Rclone Mount using Systemd - Edit
This guide is for advanced users only and it serves as a guide for you to use rclone. The systemd files here are the recommended settings for our slots and will subject to change whenever there are new configurations that are appropriate for the slots. Furthermore, Ultra.cc is not responsible for any data loss or application errors due to this setup should you proceed and will not provide official support for it due to the large volume of variables and different configurations possible with rclone. You may visit the community discord server for help.
Please make yourself aware of the Ultra.cc Fair Usage Policy. It is very important not to mount your Cloud storage to any of the premade folders, this creates massive instability for both you and everyone else on your server. Always follow the documentation and create a new folder for mounting. It is your responsibility to ensure usage is within acceptable limits. Ignorance is not an excuse.
Please do not mount to any of the default directories such as:
files
media
bin
.apps
.config
www
/homexx/username/
or any pre-created directory found on your Ultra.cc Slot
Is this method of rclone mounting suitable for your use case?
This method is not suitable for you if you wish to upload/write data to your rclone mount.
- Follow this method only if you plan to read from your rclone mount and not upload/write any data to it.
- In the case that you wish to upload data to your cloud drive, please follow placehoolder.
Overview
Rclone's Mount allows you to mount any of your cloud storage accounts as part of your slot's file system using FUSE. In this guide, we will teach you how to run a rclone mount using systemd. Take note that this guide is setup using Google Drive as the cloud storage provider used. Should you use any other cloud storage providers, you may need consult rclone documentation for the appropriate flags for your setup.
There are many ways to mount rclone. You can run the rclone Mount using the screen
utility, create a script for running rclone Mount, and checking if the command is still alive, using the --daemon
flag, just to mention a few.
We recommend using systemd for several reasons:
- Easy to set up and configure
- Restarts rclone Mount automatically when there's a server restart or error
- You can manually restart the service when there're problems.
rclone mount with no mergerfs
If you don't need to upload files to your mount, follow this guide.
Should you need to upload files or you're planning an automated setup involving your cloud storage, we recommend using Rclone VFS and MergerFS Setup instead.
Preparation
- Login to your service via SSH.
- Ensure Rclone is installed following Rclone Installation Mounting will not work without this.
- Then, create a folder
- For this guide, we'll be making a folder named Mount. So we will run
mkdir -p ~/Stuff/Mount
kbguides@lw902:~$ mkdir -p ~/Stuff/Mount
kbguides@lw902:~$
- Next, create a folder named
scripts
. This is where you'll find logs of the rclone mounts should there be any problems.
kbguides@lw902:~$ mkdir ~/scripts
kbguides@lw902:~$
- Confirm your remote name by running
rclone listremotes
and take note of the name you've set.
$ @lw666:~$ rclone listremotes
Gsuite:
Downloading Rclone Service File
- Choose and run the following command below
- There are 2 systemd files listed here. You have to choose either one of these files.
- The first one should work on most remotes supported by rclone.
- The second one is specific for Google Drive that is optimized for streaming.
Rclone Mount for Most Remotes
wget -P ~/.config/systemd/user/ https://raw.githubusercontent.com/ultraseedbox/UltraSeedbox-Scripts/master/MergerFS-Rclone/Service%20Files/rclone-normal.service && nano ~/.config/systemd/user/rclone-normal.service
Google Drive Rclone Mount for Media Streaming
wget -P ~/.config/systemd/user/ https://raw.githubusercontent.com/ultraseedbox/UltraSeedbox-Scripts/master/MergerFS-Rclone/Service%20Files/rclone-vfs.service && nano ~/.config/systemd/user/rclone-vfs.service
Editing your service file
- After you run the command, a nano text window appears. In this example service file, we'll be using Google Drive Rclone Mount for Plex Streaming.
- Replace
remote:
to the remote name you set previously from the previous guide. - You may also add or edit some rclone flags here if you wish.
- Then save it by doing CTRL + O, press ENTER then exit nano by doing CTRL + X.
Example rclone-normal.service
Example rclone-vfs.service
Systemd Commands
{mount-name} refers to the service of your choice. Either rclone-normal.service or rclone-vfs.service
Enabling and starting Rclone mount: systemctl --user enable --now {mount-name}.service
Restart Rclone Mount: systemctl --user restart {mount-name}.service
Stop Rclone Mount: systemctl --user stop {mount-name}.service
Stop and disable Rclone mount: systemctl --user disable --now {mount-name}.service (Remove service file after)