Mounting Google Drive in a Jail

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Hi Guys,

I am looking forward to the impending release of TrueNAS Core.

From what I have understood from previous forum posts, TrueNAS Core should give me the ability to mount my Google Drive in a Jail.

I was just wondering whether anyone who has moved on to the Nightlies has tried this out.

Thanks

Tony
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
admitedly not at all familiar with this but...if you can mount a google drive in freebsd, why would it need truenas core jails specifically? jails already exist, and you can install freebsd packages?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You would need to mount it from outside the jail and I guess the OP is looking for that fuction in the UI ...
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
From what I have read, you need FreeBSD 12 for this to work.

I have managed to get RClone to mount my Google drive outside the jail by setting a tunable to load Fuse at startup (fuse_load=YES)

However I was having problems getting the mount visible inside the jail. I have got "allow_mount" and "allow_mount_fusefs" checked and "enforce_statfs" set to 0 in my Plex jail settings. This allowed me to see my Google drive when I shelled into the jail as root, but unfortunately Plex doesn't have the appropriate permissions to see the drive or it's contents.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
why point plex to google drive at all?
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Because my media library is synced up to my Google drive and a few of my family and close friends access my media via their own Plex servers mounting my Google drive. My library stands at around 32TB at the moment.
My problem is my local storage is close to the recommended 80%, so either I increase my local storage (could be pricey) our I start archiving some of my least accessed media by deleting it off my local storage and just leaving it on my Google drive. If I can access the archived library by using RClone to mount my Google on my FreeNAS server I have an ideal situation where I still have access to my entire library, but I have the ability to free up local storage by archiving older and almost never used media to my Google drive.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
you have....32TB on gdrive? isn't that...costly?
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Google G-Suite - minimum of 5 users and US$12 per user per month for unlimited Google Drive. Best cloud storage deal in town
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Having now upgrading to TrueNAS Core Beta, I have been working on mounting my Google drive in a Jail.
As my existing jails are not upgraded to FreeBSD 12.1, I have created a new jail to start the testing.
I set the jail properties to “allow mount” and clicked the ”allow_fusefs” tick box.
You are also meant to set the “enforce_statfs” property to a value of 1 or less, but I couldn’t find this setting in the GUI. It was there in FreeNAS 11.3. So I used the command line to set the property to “1”. I will raise a bug report to get the property back in the GUI.
I installed a fresh installation of RClone in the jail following the installation instructions on rclone.org and created a remote drive pointing to one of my Google Drive folders (rclone config)
I created a new folder in the root of the jail as a mount point for the Google drive folder.
I just did a basic mount in the jail shell “rclone mount <remote:> <mount point> —daemon” and hey presto my Google drive folder was mounted.
That’s all for today.
The next problems to solve are how to get the drive to automatically mount when the jail starts up and how do I upgrade my Plex plugin to use FreeBSD 12.1
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You could put the mount command in /etc/rc.local inside the jail ...
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
You could put the mount command in /etc/rc.local inside the jail ...
I tried that and it doesn't work when I restart the jail.
I can run /etc/rc.local from the command line in the jail and it works, but when I exit the jail, stop it and then restart it and go back in to the jail, the drive has not been mounted.
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
I tried that and it doesn't work when I restart the jail.
I can run /etc/rc.local from the command line in the jail and it works, but when I exit the jail, stop it and then restart it and go back in to the jail, the drive has not been mounted.
I stand corrected. I have got it working now. I hadn't included the full path to rclone or the path to the rclone.conf file. You don't need those when you are just running it from the command line.

Thanks for your assistance Patrick

Now to upgrade my Plex plugin jail. I hope upgrading to FreeBSD 12.1 won't kill it
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Why not just rclone in the jail. That's what I do to backup my Google drive account.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I stand corrected. I have got it working now. I hadn't included the full path to rclone or the path to the rclone.conf file. You don't need those when you are just running it from the command line.
That's a tricky one so well known by old greybeards like myself, we tend to forget about it. /usr/local/bin is not in the search path in startup scripts, neither in cron jobs. This can of course be changed. Or use full paths like you did - which I would recommend, anyway.
 
Last edited:

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
OK, I have now upgraded my PlexPass jail to 12.1-RELEASE.
I have got my Google drive folder mounted and I can see the contents using ls at the command line in the PlexPass jail.
The problem now is Plex itself, that is running as user plex can see the mount point, but can not see the contents.
The owner of the mount point is root:wheel and I don't seem to be able to change that.
I have tried adding plex to the wheel group, but that makes no difference.
I have changed the enforce_statfs property to 0, but again no difference.
I have used rclone mount on Ubuntu, Debian, MacOS and Windows to allow Plex to access media on my Google drive without an issue.
I presume this is a permissions issue of some sort, but I am not sure what else to try.
Any suggestions would be gratefully received.
 

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
Have you tried to add option "--allow-other" to rclone mount options?

Best regards,
Maciej
Thank you, thank you, thank you.
That has done the trick.
you have made my day.
 

Tullk

Cadet
Joined
Jul 22, 2020
Messages
3
I cant my rclone mount. Have tried the things you wrote about. Allowed fs mount, rulset to 0. But i get operation not permitted.
1613984032878.png
 

Attachments

  • 1613983977768.png
    1613983977768.png
    251.2 KB · Views: 171

Tony Self

Contributor
Joined
Jan 30, 2017
Messages
130
I have recently updated my TrueNAS Core server to 13.0-U3 and my Google Drive mount using Rclone has stopped working.
Rclone is giving me the following error: -
2022/11/12 11:42:57 INFO : Starting transaction limiter: max 10 transactions/s with burst 10
2022/11/12 11:42:57 NOTICE: Serving remote control on http://localhost:5572/
2022/11/12 11:42:57 INFO : Starting transaction limiter: max 10 transactions/s with burst 10
2022/11/12 11:42:57 Failed to start remote control: start server failed: listen tcp 127.0.0.1:5572: bind: address already in use
Has TrueNAS started using port 5572 for something else?
Is it possible to get Rclone to use a different port?
 
Top