Plex vs media on remote NFS volume (solved)

Hi,

I’ve been playing around with Rockstor for the last few weeks and, in particular, with the Plex Rock-ons. Plex is working fine. My problem is that I have numerous medias that are on a remote NFS volume. I can mount it on the Rockstor system (CLI) and I’m able to see all the folders/files that are in there. However, once I share this to the container. I’m only seeing the shared directory with Nothing below it.

I’ve done a few research and it seems to be a problem since Docker enforce a little more security. CoreOS seems to have the possibility to mount NFS exports with cloud-config but I don’t seems to find the equivalent to this on Rockstor.

Is there Something I can do to let the Plex container access the medias that are on this shared volume?

Thank you.

ehfortin

Seems like either I’m the only one trying to do this or nobody found a solution…

I’m currently looking at systemd.mount. I was hoping for it to be able to “wait” for a specific folder to be mapped before proceeding. I’m still having issue with that. If I use the “noauto” switch in /etc/fstab, everything boot fine but the remote-fs.target doesn’t seems to be executed at all. If I restart it manually, everything mount correctly but… I have to do a restart of the container as well to recognize it. I want this automated at boot so, it is not good enough. If I use the “auto” switch, well, the boot process hang waiting on the fstab to complete but it never stop even if I put a 10 seconds timeout on it. Here is the line I’m using in fstab:

10.0.0.1:/recordings /mnt2/plex-data nfs users,noauto,x-systemd.automount,x-systemd.device-timeout=10,timeo=14,noatime 0 0

I tried a few other switches like x-systemd.requires-mounts-for=/mnt2/plex-data but… nothing changed. I’m not sure why.

I have to get in there just between the moment that rockstor is creating /mnt2/plex-data and before docker start the container. Is there a way to get at this exact moment to start either a script that would mount a share or that will execute systemctl restart remote-fs.target?

Thank you.

ehfortin

Hi @ehfortin and welcome to Rockstor :dizzy:

Actually I can’t help you with Plex Rock-on (not playing with it), but I’m quite sure community users will provide feedbacks.

Sorry for these 4 day without answers, all Rockstor contributors (@phillxnet & @suman) too had some major tasks

Mirko

Still not able to make this work. As per this discussion, if I mount manually the folder in the plex-data directory and restart the plex container, it works but… I want this automated at boot time. Up to now, I’ve been unable to find exactly when the /mnt2 directories are mounted. Basically, I would like to script something that will run just after /mnt/plex-data is mounted but before the plex container is started.

Who knows the boot sequence and how I should proceed to make sure I’m right at the exact spot I need to be when I do the mount I need?

BTW, this would be a great feature to be able to add mount point to external server or just to be able to use NFS or CIFS mount point as a path for any container. I’m sure Plex is not the only one that could benefit from having access to multiple external data source.

Thanks.

ehfortin

Found a way to do it. It’s not the best but it seems to work.

I’ve started with the idea of doing a mount at the end of the whole boot sequence and just do a restart of the plex container. So, in short, I had to create the files “custom.target” and “custom.service” as per the examples. The script I’ve used is called “mount_reload.sh” and is stored in /root so the executable is called as the following “ExecStart=/root/mount_reload.sh”. This script is as follow:

#!/bin/bash
/usr/bin/mount -t nfs <server_ipaddr>:/path /mnt2/<plex_data_path>
/usr/bin/sleep 15
/usr/bin/docker restart plex-linuxserver.io

Then, as per the example, I had to do a symlink to point default.target to custom.target. This way, it is the last thing that is done by the “default” runlevel.

With that, I’ve rebooted a few times to test it and each time, I can see the mount point under the plex container.

Hope it can help someone else. If you have a better option, please don’t hesitate to share, I’m willing to change the way it currently work.

Thank you.

ehfortin

1 Like

I’m stunned at the lack of response that this has had, it would seem to me an obvious thing to want to mount network shares from elsewhere within a container. I’m going to test this out as I’m planning to migrate Plex, Couchpotato, Sickrage, Sabnzbd from Ubuntu server to Rockstor and intend to initially mount the media via NFS. Perhaps the title was misleading because this isn’t a Plex issue, it’s a making network shares accessible in Rockons.

1 Like

I too have been sort of stunned by the lack of a need for this. Some of the responses I have seen on forums regarding this are surprising (move your files to your server) ?? Even after two years I don’t see much support for this. OpenMediaVault has a Remote Mount plugin that seems to work pretty well. I was considering switching to Rockstor, so this gives me hope. Is this still the solution you are using?

Just to drop my 2 cents here, I’m fairly new to docker myself and went through several growing pains trying to get containers to see various locally mounted NFS directories as well.

In the end it all comes down to permissions. I do NOT recommend mounting shares inside your container, it’s unneeded when docker provides the ‘volumes’ ability.

RS shows this with it’s ‘share’ window when you setup a rockon. Be sure the remote NFS share can be written to by RS’s root user. If it can’t be, you’re containers access will fail.

PS > Many containers, like those from linuxservers.io, allow setting the containers user/group ID’s which help in this regard. Be sure to set those values to the same ID’s as the user on your remote system.

Hope that helps some.

Being new to both Rockstor, Rockons and containers, a tutorial on this would be helpful to many. If there is one you can point me to, I would be greatful.

@gmoyle Welcome to the Rockstor community.

I can chip in on the Rock-ons doc side of this with the following doc section:

Rock-ons (Docker Plugins)

It has, in turn, some links out to other references.

Hope that helps.

I appreciate that. I have read through both of those. Perhaps I am missing something.

To be clear, my exact issue is that I already have a netgear NAS with several terrabytes of data. Music, Pictures, etc. I dont want to move it to Rockstor.

The Rockstor documentation as I understand it is showing how to enable Samba/CIFS/NFS, etc for shares ON the Rockstor appliance. My files are not on the Rockstor shares.

For example…

192.168.0.70@media/movies while my Rockstor is on a completely different computer.

I do not see how to create a Rockstor share to that specific location outside of the container, that I can then point Plex to.

If I am missing it, please a specific link to how to do that would be great, but as the original poster noted, that doesn’t seem to be directly supported.

Am I missing it?

Hi @gmoyle,

There is also a few hints to gather from an older post in this forum:

Combined with @ArmyHill01’s recommendation, I would suggest something akin to the following:

  1. From Rockstor’s webUI, create a share to serve as mounting point of your remote NFS export.
  2. If needed, go to the share’s detail page, and then to the Access control tab. There you can change the ownership and permissions to make sure that it is compatible with the ownership and permissions of your remote NFS export (as recommended by @ArmyHill01 above). See below image for an illustration of which tab I’m talking about:

  1. From the command line, mount your remote NFS export to the newly-created share on Rockstor. The command should be similar to the one described in the forum post I linked above, and be along the lines of mount -t nfs <remote-NFS-export> /mnt2/<share-name>.

  2. You then only need to add the share to your rock-on(s) of choice, using the Add storage feature. Note that we have a detailed description of this process in the process of being published to our docs, but in the meantime, you can follow the post below (it concerned the NZBGet rock-on, but works with most rock-ons).

I believe it should be at least a good starting point. I haven’t mounted an NFS share manually in a little while but as far as I remember that should do it :-P.

Let us know how it goes!

1 Like

That’s good until you reboot. Using the mount command is ok for testing. Creating an entry in /etc/fstab would be better so that the mount point persists after a reboot.

Something along the lines of:

<ip-of-nfs-server>/<nfs-export> /mnt2/<share-name> nfs <options> 0 0

What <options> that are available to be set can be found with:

man nfs

Then they could just run:

mount -a

to mount it without a need to reboot.

2 Likes

Just for the sake of sharing, here is how I’m currently mounting my FreeNAS NFS exports in /etc/fstab

10.0.0.150:/mnt/vault/media /mnt/media nfs4 rw,intr,rsize=8192,wsize=8192 0 0

Gotcha’s include making sure the dir where you are mounting to already exists.
Also note I’m using NFS4 here, I’d try just nfs first unless you know the exporting server is using ver4.

1 Like