Mount Synology share with NFS in Plex jail

NitroDesign

Cadet
Joined
Aug 11, 2019
Messages
4
Hello,

I'm new to this forum and to Freenas :).
I have a question about mapping a share from my Synology to my Freenas Plex jail.

First of all, here is my gear:

Synology NAS (192.168.2.2)
DS414+
4x 2TB HDD WD Red

Freenas (Plex jail 192.168.2.11)
I5 4e gen (don't know which one)
16GB DDR3
1GB ethernetcard
1x SSD Freenas boot
3x 500GB HDD

It is necessary that you activate on the Synology the NFS permissions and the NFS service.
So I have followed this link: Synology NFS

In the control panel (Synology) I have activate the NFS with:
Enable NFS --> And for sure also the Enable NFSv4 support

I have se the NFS permissions on:
Hostname/ip: 192.168.2.11
Privilege : read/write
Squash: No mapping
Security: sys (AUTH_SYS) (this option is not showing in the link above)
Checked: Asynchronous and Allowed non-privileged port

The next step is to look what the mounting path is, this is: /volume1/video
My guess is that I configured all in the Synology.

On my Freenas I have installed in a jail the Plex plugin.
Also added a map in the mnt folder named "remoteshare".

When I open the jail shell I use the following code:
Code:
mount -t nfs 192.168.2.2:/volume1/video /mnt/remoteshare


When I add the NFS permissions, I get the following output:
root@plex:~ # mount -t nfs 192.168.2.2:/volume1/video /mnt/remoteshare
mount_nfs: nmount: /mnt/remoteshare: Operation not permitted
root@plex:~ #

When I remove the NFS permission, I get the following output:
root@plex:~ # mount -t nfs 192.168.2.2:/volume1/video /mnt/remoteshare
[tcp] 192.168.2.2:/volume1/video: Permission denied

Also find on the internet that I maybe need to add some lines to the rc.conf.
To try I have added the following rules:
Code:
nfs_client_enable="YES"
nfs_client_flags=n 4
mountd_enable="YES"
unfsd_enable="YES"


To try some more I have did port forwarding the NFS
UDP&TCP: 111, 892, 2049
But no luck

When I check the /var/log "userlog" I get the following output:
[root:groupadd] plex(972)
[root:useradd] plex(972): plex(972): Plex Media Server:/nonexistent:/usr/sbin/nologin
[root:groupadd] _tss(601)
[root:useradd] _tss(601):_tss(601):TrouSerS user:/var/empty:/usr/sbin/nologin

So I think it is a rights question, but I don't where to look now.
Some people talk about UID and GID, but I don't know what that is or how to use it.

Hopefully you can help me with this problem.

Grtz,

NitroDesign
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
From "man jail"
Code:
 allow.mount
           privileged users inside the jail will be able to mount
           and unmount file system types marked as jail-friendly.
           The lsvfs(1) command can be used to find file system
           types available for mount from within a jail.  This per-
           mission is effective only if enforce_statfs is set to a
           value lower than 2.

So I guess the plex jail is not set up to treat a NFS share as jail friendly.
You could try to mount the share directly from FreeNAS into the jail.

But actually I don't quite get your setup. Why try to mount a synology share into FreeNAS for Plex?
There is a Plex Server available for Synology, why not use that?

And you should really read about what UID and GID means.....
 

NitroDesign

Cadet
Joined
Aug 11, 2019
Messages
4
Hello Fredda,

Thank you for the response. This is the first thing I want to try.
When this is working, I will add more stuff like:

Spotweb server (now it's only online when I use Spotnet on my Windows machine)
Unifi controller (now it's only online when I use the software on my Windows machine)
Pi-hole or other ads blocker
Domoticz or Homeassist (I have smart lightning, Nest, smoke detectors and other stuff)

But the solution u say is that i need go to the shell of the Freenas instead of the jail Shell.
And try to mount then the NFS share.

But what do u mean with the:
Code:
 allow.mount
           privileged users inside the jail will be able to mount
           and unmount file system types marked as jail-friendly.
           The lsvfs(1) command can be used to find file system
           types available for mount from within a jail.  This per-
           mission is effective only if enforce_statfs is set to a
           value lower than 2.


Is this someting i need to add to the mount line or do I need this to add to the rc.conf ?

Hopefully you can help me with this.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
But the solution u say is that i need go to the shell of the Freenas instead of the jail Shell.
And try to mount then the NFS share.

But what do u mean with the:
Code:
 allow.mount
           privileged users inside the jail will be able to mount
           and unmount file system types marked as jail-friendly.
           .....


Is this someting i need to add to the mount line or do I need this to add to the rc.conf ?

Hopefully you can help me with this.
This is a part of the manpage for jail. It means a filesystem has to "jail-friendly" to be mounted from within a jail,
which nfs is not. Changing that (I'm not even 100% sure it is possible) you'd need to configure the advanced settings
of the jail and probably also to set some sysctl's.

The alternative would be to mount from FreeNAS itself into the jail. But FreeNAS being an appliance this is not the
way it is supposed to operate.

I would consider both options really just for advanced users who know what they are doing.

I would recommend one of the easier options.
- Install the plex server on your synology, or
- Copy your media data to the FreeNAS server
 
Last edited:

NitroDesign

Cadet
Joined
Aug 11, 2019
Messages
4
Thank you for your time Fredda, but both options is not what I want:
I would recommend one of the easier options.
- Install the plex server on your synology, or
- Copy your media data to the FreeNAS server

It is stupid that something like share a map from one server to a other server is a pain in the ass :(.
Is it possible if I make a user in Syno with the same UID and GID as in the Plex jail that it then gonne work ?
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
It is stupid that something like share a map from one server to a other server is a pain in the ass :(.
You seem to have a misunderstanding what FreeNAS is. It intended to work as a server offering files
via SMB or NFS. It is not intended to work as a NFS client.

If you want more flexibility run a Linux or FreeBSD server. But FreeNAS is an appliance, which offers
a nice and easy to configure GUI to allow simple use of its intended purpose. Most of the stuff not
needed for that purpose is stripped away.

As mentioned in my post above, you can mount a NFS share from FreeNAS via shell into the jails filesystem.
You'll have to do that manually after each boot, but you can probably do that with the Tasks Init Scripts.
 

NitroDesign

Cadet
Joined
Aug 11, 2019
Messages
4
Thank you for make things clear, but what NAS OS can i better use then for the purpose what I want:
Spotweb server
Unifi controller
Pi-hole or other ads blocker
Domoticz or Homeassist

I have a machine where I can run it on, so the anwser of use a new Synology nas is no option.
 

Fredda

Guru
Joined
Jul 9, 2019
Messages
608
Thank you for make things clear, but what NAS OS can i better use then for the purpose what I want:
Spotweb server
Unifi controller
Pi-hole or other ads blocker
Domoticz or Homeassist

I have a machine where I can run it on, so the anwser of use a new Synology nas is no option.
I still try to wrap my head around what you need a NAS for. None of your mentioned use cases requires a NAS.

Please note the "S" in NAS stands for Storage not Server. All the stuff you mention is better run from a normal
Linux distribution or from a FreeBSD.
 
Top