Skip to main content

Part 5 - Mounting the drive(s)

You made it up to here, you finished Part 4 - Setting up Rclone and/or Plexdrive and are still with it, congratulations! The hardest parts are done, it'll be downhill from now on. Promise!

We now need to mount our drive so that Plex can access it as if it is just one giant external drive.

Douglas Adams would have loved it!

Mounting the Google drive (Rclone)

You are probably still logged in with your user account, which is exactly what we want. From there go into root mode. Type

sudo -s

Creating the mount script:

nano /etc/systemd/system/rclone.service

Then paste (right click):

Description=Mount and cache Google drive to /mnt/Gdrive
ExecStartPre=-/bin/mkdir /mnt/Gdrive
ExecStart=/usr/sbin/rclone mount \
  --config /home/plexuser/.config/rclone/rclone.conf \
  --allow-other \
  --cache-info-age 5m \
  --cache-writes \
  GdriveCache: /mnt/Gdrive
ExecStop=/bin/fusermount -u -z /mnt/Gdrive
ExecStop=/bin/rmdir /mnt/Gdrive

Of course you will need to replace plexuser with your own username.

Important: if you decided not to use the Rclone cache, change GdriveCache to Gdrive and remove the two lines prior to that (--cache-info-age 5m \ and  --cache-writes \)

When you are done, save the file by typing Ctrl-O, Enter to save, then Ctrl-X to exit.

You will need to enable the service. Type

systemctl enable rclone.service

Reload the service so it'll work:

systemctl daemon-reload

Exit the root mode by typing


If you don't plan on installing Plexdrive, then you will need to reboot your server now. Type

sudo reboot

You may need to wait a few seconds for the server to be back online again... just enough time to grab another cup of coffee. You deserve a break.

If you only wish to use Rclone and rebooted, just click away the PuTTY session (it has become unresponsive anyway). You are done now and you can proceed to Part 6 - Making it all come together.

If however you are planning to add Plexdrive, read on.

Mounting Plexdrive

Make sure you are logged into PuTTY with your own username. First, let's create the mount directory:

sudo mkdir /mnt/Plexdrive

To speed up the installation a bit, create a screen session so that we can proceed while Plexdrive is creating the cache. Type

screen -S plexdrive

This will open a new session which we can place in the background later to continue setting things up. Type

sudo plexdrive mount -c /root/.plexdrive -o allow_other -v 2 /mnt/Plexdrive

You will be asked to provide your generated client ID. This is the Google client ID you created in part 4. Remember how I asked you to keep the browser open? The codes are probably still sitting on your screen. Paste it using right click, then hit Enter.

Do the same with the generated client secret, again this is the client secret you created in part 4 and that is still on your browser screen. If you had closed your browser after all, head back to, click "Credentials", and click "Edit" behind the API you created. This will show you the OAuth information again.

You will now be asked to paste a link in your browser. Use your mouse to select the entire link (see screenshot below). DO NOT TYPE CTRL-C!!! Just selecting it will copy the link.

Paste this link in your PC browser. You are asked to authorize Google drive and will be given an authorization code. Paste the code in PuTTY (right click!).

If all goes well, Plexdrive will start generating the cache. This will take a long time, but thanks to the separate screen we do not have to wait till it is completely finished. I do suggest waiting a few minutes until it mentions that it finished the initial scanning.

Once the cache creating process slows down to 1 or 2 items at the time, you can safely detach the screen to proceed with the following steps. To detach from the screen press Ctrl-A, then the letter D.

Once you are back on your main screen (placing the cache process in the background), type

sudo -s

This starts a root session. Then type

nano /etc/systemd/system/plexdrive.service

In the nano text editor paste the following lines:

Description=Mount Plexdrive to /mnt/Plexdrive
ExecStartPre=-/bin/mkdir /mnt/Plexdrive
ExecStart=/usr/local/bin/plexdrive mount \
  -c /root/.plexdrive \
  -o allow_other \
ExecStop=/bin/fusermount -u -z /mnt/Plexdrive
ExecStop=/bin/rmdir /mnt/Plexdrive

Save with Ctrl-O, Enter, then Ctrl-X. You will need to enable the service. Type

systemctl enable plexdrive.service

Reload the service so it'll work:

systemctl daemon-reload

Time to check our caching process! To go back to user mode, type


Then go back to the screen you placed in the background:

screen -r plexdrive

I did not find it necessary to wait till the entire scanning process was done. Once mine slowed down to one or two items at the time, I found I could reboot safely and let the service take over. First detach your screen (Ctrl-A, D), then reboot.

sudo reboot

Click away the PuTTY session, it has become unresponsive.

We're almost there! All that needs to be done now is Part 6 - Making it all come together.