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?
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:
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?
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.
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:
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.
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.
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:
From Rockstor’s webUI, create a share to serve as mounting point of your remote NFS export.
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:
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>.
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.