plex Plugin FN11.2

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
hi guys,
I'm trying to get plex to work on my server (HPE Microserver Gen8 with Xeon E3-1260L 16GB ECC 4*8TB Iron Wolf) and I'm running into problems.
The plugin installs fine and I can go to the management site without a problem. After installing I went to the jail and added the my media as a mount point to the media folder. Since you cant navigate in the folders on the web interface I just tried to give it the path e.g. /media/Vidoes/ ; /media/Series/ ; /media/music/. When this didn't work I tried mounting the media straight into a Folder i could see inside the management web interface so I set my media folder to be at /usr/local/plexdata-plexpass/Plex Media Server/ but this didn't help either.
So then I thought I probably need to restart the server for the mounting points to take effect, but after a reboot the Jail stays down and so does the plugins. I can select the jail and restart it without a problem but the plugin doesn't respond to a click on start.

I'm pretty sure this is a simple permissions thing so here's how I have set up my media folder. User and Owner both have the id 1000 and both have read/write/execute rights. So far group 1000 consists only of user 1000.
I've read that I have to have the same permissions inside and outside of the jail. How do I find out how the permissions look inside the jail?
hope you guys can help me out with this rookie question
 

White95supra

Dabbler
Joined
Nov 13, 2016
Messages
19
I fought with this for quite some time, I actually thought I was the only one having this problem but I did find the solution for you. The destination mount point for the plex jail is the problem, it must be formatted as follows: /mnt/<drive name>/iocage/jails/plex/root/media/Videos Then when you are in plex add your media folder by adding /media/Videos as the folder location.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
First thing to do is see what your mount actually is:

iocage fstab <jailname> -l

Then, you might want to remove a mount that shows with the full path as quoted by @White95supra (note down the ID number of that mount)

iocage fstab <jailname> -r <ID number to remove>

Make sure your jail runs without the mounts that were causing the problem.

With the jail running, try adding the mounts again... this will probably be most of the fix, but don't forget to ensure the user with the same name and number exists inside the jail to sort out the permissions:

iocage exec <jailname> "cat /etc/passwd"
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
hello guys,
after some hardware and software failures I'm back.
I've now done a clean install of FN 11.2 with the latest stable release. I imported my existing pool and set up Users. My Main User has access to the Media Folder.
I installed the Plex Server Plex Pass Plugin and added mounted my media Folder als Source to /iocage/jails/plex/root/media as Destination. In the management interface for plex I can Navigate to the folder but I cant see any of the content. No subfolder and no files.

I guess this is because I'm missing a user with the name and number inside the jail for the permissions. can you point me to a how to or guide me through the process?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
hello guys,
after some hardware and software failures I'm back.
I've now done a clean install of FN 11.2 with the latest stable release. I imported my existing pool and set up Users. My Main User has access to the Media Folder.
I installed the Plex Server Plex Pass Plugin and added mounted my media Folder als Source to /iocage/jails/plex/root/media as Destination. In the management interface for plex I can Navigate to the folder but I can't see any of the content. No subfolder and no files.

I guess this is because I'm missing a user with the name and number inside the jail for the permissions. can you point me to a how to or guide me through the process?

I wrote a reply for a similar issue in another thread. Essentially, you need to make sure your plex user and group have the same uid and gid both on the FreeNAS host and inside the plugin jail. You can find the uid and gid plex uses inside the jail by entering it and typing id plex

Additionally, when you're setting up plex from the web ui, the path you need to provide it is the local path (the path the jail sees). If your fstab file looks similar to the following:
/mnt/toplevel_dataset/media/tv /mnt/iocage/jails/plex/root/mnt/media/tv nullfs rw 0 0

Then the local path will be the portion of the destination path following /mnt/iocage/jails/plex/root, i.e. /mnt/media/tv
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
thanks for this detailed how to... Is this possible from the gui shell aswell or do I need to set up SSH?
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
did I missunderstand you here:
Before discussing a solution, there are a couple of things I should clarify. A plex user and group will have been automatically created for you, regardless of your installation method. If you used the plugin, this should have happened in plugin installation, and if you used the pkg install, they are also created automatically.
because I had a look under users and neither found a group or a user named plex. I installed the plugin via GUI.
Or did you mean there is a user and a group inside the jail?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
did I missunderstand you here:

because I had a look under users and neither found a group or a user named plex. I installed the plugin via GUI.
Or did you mean there is a user and a group inside the jail?
A user and group will have been automatically created inside the jail. you need to make sure the user and group that you create outside the jail have the same uid and gid
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
OK
once I created the users and group with the same id I have to make them owner of the dataset right? right now I have this dataset shared as a smb share with windows permissons and my user and the group wheel as the owner. once I change those all I need to do to still be abled to access the share would be to add my user account (and all other users who should have access) to the group plex right?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
OK
once I created the users and group with the same id I have to make them owner of the dataset right? right now I have this dataset shared as a smb share with windows permissons and my user and the group wheel as the owner. once I change those all I need to do to still be abled to access the share would be to add my user account (and all other users who should have access) to the group plex right?

Yep, this is certainly one way of doing it. Another consideration is whether you plan on using daemons such as Sonarr, Radarr, Lidarr or headphones, etc. These might require read/write access to the directory as well, so (as mentioned in my other post), using a service agnostic group such as media_share that has more semantic meaning in the name might be more appropriate. You could then add your user account to that group, along with plex et al.

Or not. You could use the plex group for the same thing, it's just less semantically meaningful.
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
so its not necessary to have both group and user as owner. a group with the plex user as owner is sufficient as long as the group has the correct permissions? but it is necessary to have both group and user with the same id on the host system right? even though I might not be using either the group or user at all?

I havent looked into Sonarr and co. might be doing so in the future but for now a working plex server without the need for a dedicated machine would be all i'm looking for.

edit: I cant thank you enough! I've been struggling with this simple task for far too long (though to my shame I must admit I never put enough effort into it)!

Now Plex can see the my files. Only problem is, that I now need to add new datasets since I only have an Audio and a Video dataset and everything else below this was done via windows. obviously if i tell plex to grab my movies it also sees the tv shows and under audio it will mash up my audio books and my music but that should be easily remedied if I just create more datasets below audio and video I guess.
I'll try it out in a sec.

Thanks again for all the great advice and patience!

edit2: turns out it wasnt the lack of sub datasets but rather a lack of mounting points. How do I creat sub datasets in the media folder in the plex jail? this way I could mount movies to media/movies tv shows to media/tv shows and so on

edit3: I've created sub datatsets like this
/iocage/jails/plex/root/audiobooks
by going to the location where the jail is sitting and adding sub datasets under root
but when I try to mount my audiobooks folder to it freenas tells me
Destination directory should be empty
any ideas? Or should I just mount into already existing folders?
 
Last edited:

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
so its not necessary to have both group and user as owner. a group with the plex user as owner is sufficient as long as the group has the correct permissions? but it is necessary to have both group and user with the same id on the host system right? even though I might not be using either the group or user at all?

The only requirement is that the user executing the commands (in this case the plex user) has the permissions it needs to to execute the command it's trying to. If you so desired (not advised) you could give all users rwx permissions for the directories, and then plex would neither have to be the owning user or a member of the owning group. This leaves your media wide open to manipulation by malicious users though. With that in mind, the plex user would either have to be a member of the owning group, or the owning user. As long as the user has the permissions it needs through one of these avenues, it will work. It doesn't need to be a member of the group and the owning user, it can be one or the other.

edit2: turns out it wasnt the lack of sub datasets but rather a lack of mounting points. How do I creat sub datasets in the media folder in the plex jail? this way I could mount movies to media/movies tv shows to media/tv shows and so on

edit3: I've created sub datatsets like this
by going to the location where the jail is sitting and adding sub datasets under root
but when I try to mount my audiobooks folder to it freenas tells me
any ideas? Or should I just mount into already existing folders?

This shouldn't be necessary. The point of mounting a directory is so that you have access to its contents, so by mounting the parent directory, all child directories will be accessible within the jail. These won't show up within the FreeNAS GUI however, unless you created them specifically as datasets.

You should be able to confirm their presence by listing the contents of the media directory from within the jail:
ls -l /mnt/media

This should give an output similar to the following:
Code:
root@plex:/ # ls -l /mnt/media
total 999
drwxrwxr--   65 plex  plex     75 Dec  31 12:00 Audiobooks
drwxrwxr--  761 plex  plex    762 Dec 31 12:00 Movies
drwxrwxr--  111 plex  plex    112 Dec 31 12:00 Music
drwxrwxr--  123 plex  plex    124 Dec 31 12:00 TV Shows


These will be the directories you're after. The path you specify would be the same as what you've tried to mount. The reason why your final mount isn't working is that there is obviously already content in the parent directory you've mounted. In fact, at a guess I would say that it's the same content that you're trying to mount; you're trying to mount a directory into the location it already exists. Hope this helps.
 
Last edited:

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
You should be able to confirm their presence by listing the contents of the media directory from within the jail:
ls -l /mnt/media

This should give an output similar to the following:
Code:
root@plex:/ # ls -l /mnt/media
total 999
drwxrwxr--   65 plex  plex     75 Dec  31 12:00 Audiobooks
drwxrwxr--  761 plex  plex    762 Dec 31 12:00 Movies
drwxrwxr--  111 plex  plex    112 Dec 31 12:00 Music
drwxrwxr--  123 plex  plex    124 Dec 31 12:00 TV Shows

If I try with /mnt/media it gives me
Code:
No such file or directory


I could mention that my jail runs of the same pool as the media.
my media is under pool\<myself>\Media
the plex is in pool\iocage\jails\plex

so I went ahead and created subdatasets: plex\root\audiobooks; plex\root\tvshows; plex\root\movies and plex\root\music but I cant set those datasets as destinations for a mountpoint and when I went and set all my media folders as source with plex\root\media as destination I can only see the contents of my tv shows dataset

no clue if this is important information. If it helps once this is working I wanted to set up plex and all future plugins on an SSD for performance reasons. In case these issues are because plex and the media are on the same pool I could try and move it/set it up anew on the ssd
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
If I try with /mnt/media it gives me
Code:
No such file or directory

Where have you mounted your media folder inside the plex jail? post the output of ls -l path/to/your/folder

Edit: To be explicit, you must be logged into your plex jail
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
I went into the shell used jexec <jailid> csh
and then typed in ls -l /mnt/media
I guess the last step was the mistake. should I use the path to the media or the path to the mount point?
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
I went into the shell used jexec <jailid> csh
and then typed in ls -l /mnt/media
I guess the last step was the mistake. should I use the path to the media or the path to the mount point?
/mnt/media was an example, if you haven't mounted your media to /mnt/media then it's going to say "no such file or directory", because this isn't the location relevant to you.

All you should need to mount is the parent directory, which will already contain all of the subdirectories you need. Better yet, go to your FreeNAS host and post the output of iocage fstab -l plex
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
is there a simple way to copy something out of the gui shell? in lack of any way known to me I'll have to type the relevant lines myself
Code:
| 14 | /mnt/Balerion/Balerion/Media/Audio/Hörbücher /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 15 | /mnt/Balerion/Balerion/Media/Audio/Musik/Plex /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 16 | /mnt/Balerion/Balerion/Media/Video/Filme/HD /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 17 | /mnt/Balerion/Balerion/Media/Video/Serien /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0 

everything before that is just from plex itself
 

samuel-emrys

Contributor
Joined
Dec 14, 2018
Messages
136
is there a simple way to copy something out of the gui shell? in lack of any way known to me I'll have to type the relevant lines myself
Code:
| 14 | /mnt/Balerion/Balerion/Media/Audio/Hörbücher /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 15 | /mnt/Balerion/Balerion/Media/Audio/Musik/Plex /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 16 | /mnt/Balerion/Balerion/Media/Video/Filme/HD /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0
| 17 | /mnt/Balerion/Balerion/Media/Video/Serien /mnt/Balerion/iocage/jails/plex/media nullfs rw 0 0 

everything before that is just from plex itself

Your issue is that you're mounting your subdirectories into one directory; that's not how this works. You could fix this by just mounting your Media directory as follows:

/mnt/Balerion/Balerion/Media/ /mnt/Balerion/iocage/jails/plex/mnt/media nullfs rw 0 0

And this is all that would be needed. I recommend putting this in the /mnt/ directory; this is a semantic indication that the filesystem is not the jails own, and has been mounted from somewhere else. Not crucial, but good practice. You would then be able to find your content in the following locations within the jail:

/mnt/media/Audio/Hörbücher
/mnt/media/Audio/Musik/Plex
/mnt/media/Video/Filme/HD
/mnt/media/Video/Serien

Alternatively, if you want to maintain a scheme closer to what you've tried to do, you could change your fstab file to the following:

Code:
 /mnt/Balerion/Balerion/Media/Audio/Hörbücher /mnt/Balerion/iocage/jails/plex/media/Hörbücher nullfs rw 0 0
 /mnt/Balerion/Balerion/Media/Audio/Musik/Plex /mnt/Balerion/iocage/jails/plex/media/Musik/Plex nullfs rw 0 0
 /mnt/Balerion/Balerion/Media/Video/Filme/HD /mnt/Balerion/iocage/jails/plex/media/Filme/HD nullfs rw 0 0
 /mnt/Balerion/Balerion/Media/Video/Serien /mnt/Balerion/iocage/jails/plex/media/Serien nullfs rw 0 0 


Both essentially achieve the same thing; the first is far and away more simple though. You can remove the desired lines from your fstab using this command from the freenas host:
iocage fstab -r plex <index>
i.e:
iocage fstab -r plex 14

or, you can edit the file in a text editor. From the FreeNAS host:
setenv EDITOR nano
iocage fstab -e plex

Delete/add the appropriate lines and then press Ctrl + X, y, enter to exit.
 

ledieu

Dabbler
Joined
Oct 15, 2016
Messages
40
I just went ahead and migrated the jails to an SSD and started from scratch. now it seems like its working and plex is rebuilding my library. no clue what was the problem before but now its working as planned

thanks again for your help
 
Top