Plex Wont Read Folders/Files on Mounted Drive in Linux Mint

Hi,

 

I'm really hoping someone can help me get to the bottom of this. I have read through the Linux Permissions Guide and it did not help solve the problem.

 

I am very new to linux so that is likely partially to blame, but after spending 12 hours on this, I can't figure it out on my own.

 

When I attempt to add a library, Plex will see my mounted drives, but no folders beyond that. If I manually try to add a folder by typing it in, it does nothing. It will see folders on the root drive, but I've even tried adding a Media folder on the root drive and still nothing. I suspect there is something very basic wrong.

 

I have tried and set permissions to user Plex for the Media folder on the mounted drive, but it still can't see it. 

 

Any ideas? Sorry If I'm doing this wrong, this is my first time posting.

5 Likes

your permissions still aren't correct.

where are you mounting the drives? how are you mounting them?  what filesystem(s) do they use?

have you permissioned the entire path to the media (aka, all the parent directories are also permissioned)?

The drives are mounted to /media/peter/storage1 and storage2 they use ext4 file system. I mount them through the fstab file at boot.

My files are stored in /media/peter/storage1/Media. Plex won't see anything beyond /storage1/ I also copied that folder to /home/peter/Desktop/Media to see if it was a mounted drive permission issue, but although I can choose that folder in Plex, it won't pick up the media files.

I set permissions to plex:plex for the Media folder in "/media/peter/storage1/Media" the /media/ and the/peter/ folder both are set for permissions to peter:peter. I added plex to the peter group. doesn't seem to help.  

If the permissions of the mounted drives aren't correct, why is plex not able to read the files in the /home/peter/Desktop/Media folder but can actually navigate to it?

Thanks for your help.

1 Like

You are having basic permission and ownership problems as Bob stated.

The reason Plex can't read below a certain point is default linux permissions.  The linux rule states that one unprivileged user (plex) cannot see another user's files (what's in your home directory) without express 'read' permission being granted.  Directory read permission is in two forms.  'r' is to read the names of the files in a directory, 'x' is to descend through it (get to a subdirectory or file within the directory).  File permissions are simple 'r' (read the contents).  'x' is not needed for files since we don't 'execute' media.

I must first ask if Plex is indeed running as user 'plex', in group 'plex' and if it was started at boot (as a service) or if it was started by you.   Plex should be running as itself, not under your username.

Take Plex out of any groups you've added it to.  It serves no purpose.  Take yourself out of the Plex group if you've added yourself to it.  It also serves no purpose.  Plex should be free-standing in its own group and none other.

Presuming this is settled and Plex is indeed running as required,  the correction to your linux filesystem permissions are very simple.   They presume your username will remain the 'owner' of the media.   Plex will be granted Read permission to the files and directories containing your media.  This is its minimal requirement.

I would recommend you naming your media storage directories to exclude your username from the path.   I use  /media/movies, /media/tv, and /media/music.  

You could achieve this with /media/storage1 and /media/storage2.    Care must be given to not have TV series and Movies intermixed as the scanners for each library type will get confused.  (The movie scanner doesn't like scanning TV series names, etc)

if your movies and tv programs are contained in directories /media/storage1/movies, /media/storage2/movies,  /media/storage1/tv and /media/storage2/tv, Plex will find this very easy to navigate and maintain properly.

I will presume, for the rest of my reply, your top level media directories are structured as I outline here.

This will permit you to retain ownership, which you may set back to you as the owner  ('chown -R peter /media/storage1 /media/storage2') to ease managing your media.

sudo find /media/storage1/movies  /media/storage2/movies -type d -print -exec chmod 755 {} \;
sudo find /media/storage1/movies  /media/storage2/movies -type f -print -exec chmod 644 {} \;
sudo find /media/storage1/tv  /media/storage2/tv -type d -print -exec chmod 755 {} \;
sudo find /media/storage1/tv  /media/storage2/tv -type f -print -exec chmod 644 {} \;

Lastly,   your fstab entries for the two drives should be basic entries.     Edit appropriately for your device/partition names:

/dev/sdc1                                 /media/storage1                   ext4    defaults        1 4
/dev/sdd1                                 /media/storage2                   ext4    defaults        1 4

Restart plex or reboot as required.

When restarted,   add movie section for directories storage1 and storage2.  Repeat for tv section.

I have done as you suggested. I remounted the drive to /mnt/storage1/

I also changed my fstab to:

UUID=448775ff-...... /mnt/parity    ext4    defaults   1    4
UUID=3abea078-.... /mnt/storage1    ext4    defaults   1    4
UUID=0faa8ed3-..... /mnt/storage2    ext4    defaults   1    4

Originally it said defaults 0 0.

It now mounts, but no longer shows up on my desktop. I also can't click on them under "Computer" it says "cannot mount location". It is mounted however since I can access it.

This has resulted in some progress! My folders are now all accessible on Plex. However, it will only scan my movies folder, still will not pick up anything in the TV shows folder. I have tried deleting and making it anew, but there is no change. Even adding the specific show folder does nothing, nor adding the season folder.

Thanks for your help so far!

I have done as you suggested. I remounted the drive to /mnt/storage1/

I also changed my fstab to:

UUID=448775ff-...... /mnt/parity    ext4    defaults   1    4
UUID=3abea078-.... /mnt/storage1    ext4    defaults   1    4
UUID=0faa8ed3-..... /mnt/storage2    ext4    defaults   1    4

Originally it said defaults 0 0.

It now mounts, but no longer shows up on my desktop. I also can't click on them under "Computer" it says "cannot mount location". It is mounted however since I can access it.

This has resulted in some progress! My folders are now all accessible on Plex. However, it will only scan my movies folder, still will not pick up anything in the TV shows folder. I have tried deleting and making it anew, but there is no change. Even adding the specific show folder does nothing, nor adding the season folder.

Thanks for your help so far!

are the files themselves permissioned to be read by user plex?

for your mount options, you really want defaults 0 2 for all these (or 0 0).

1 4 is mostly meaningless.  The first digit is if dumps should check the volume to be included in backups, the 2nd is what order to "check" the volumes in (0 = no check, 1 = check first, 2 = check after all the 1s, 4 = invalid)

Both the movie and the tv show are permissioned to be read by "others" and group "peter"

I take it back, its working now! Thank you!!! I don't know why it won't pick up that other folder, but it is picking up other folders ive dropped in. So I'll figure that part out myself.

Again that you so much, it took me literally all day trying to figure this out!

DIdn't work for me.

I am using root user to login

I granted with nautilus full access to anyone to Documents and USB disk and doesn't bring a thing.

I have the USB NTFS formatted

I'm needing a little help, I've added a new 4tb drive to my system and I'm trying to get Plex to see further than just the drives mount point. I've followed the example up above marked as "Best Answer" and still can't seem to get it to work correctly. Any help you can provide would be greatly appreciated, all plex can see with this config is the WD4TB drive itself. No directories or files in the directory's are visible in plex.
 
After following the example above I have the following permissions and fstab settings.
 
Aiur WD4TB # ls -ld Movies
drwxr-xr-x 2 myusrname myusrname 4096 Jan  6 21:43 Movies
Aiur WD4TB # ls -ld TV
drwxr-xr-x 2 myusrname myusrname 4096 Jan  6 21:39 TV
 
My fstab entry
UUID=0ae2ca2a-4dc2-4079-a777-e37ee61881ca /media/WD4TB ext4 defaults 0 0
 
top -u plex list plex as running all the plex services
top - 22:33:47 up 20 min,  2 users,  load average: 0.00, 0.07, 0.15
Tasks: 196 total,   3 running, 193 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.2 us,  1.4 sy,  0.0 ni, 96.7 id,  0.5 wa,  0.2 hi,  0.0 si,  0.0 st
KiB Mem:   8175612 total,  1664872 used,  6510740 free,    84208 buffers
KiB Swap:  8385532 total,        0 used,  8385532 free.   632584 cached Mem
 
  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                           
 1684 plex      35  15 1811408  55948   5856 S   0.3  0.7   0:06.57 python                                            
 1644 plex      15  -5    4444    644    536 S   0.0  0.0   0:00.00 start_pms                                         
 1650 plex      15  -5  384496  97284  14628 S   0.0  1.2   0:01.42 Plex Media Serv                                   
 2443 plex      15  -5  322172  52764  10688 S   0.0  0.6   0:01.86 Plex DLNA Serve

Each user belongs to the following groups.
 
Aiur myusrname # groups myusrname
myusrname : myusrname adm cdrom sudo dip plugdev lpadmin sambashare
 
Aiur myusrname # groups plex
plex : plex
 
1 Like

Instead of messing around with permissions/ownership I chose to run Plex as my user (who has access to my hard drive/media). Simply edit the PLEX_MEDIA_SERVER_USER value in your Plex Server config located at /etc/default/plexmediaserver, e.g.

PLEX_MEDIA_SERVER_USER=james

Then restart the plex server:

sudo service plexmediaserver restart

Afterwards you can select media on your hard drive.

6 Likes

this ^ works everytime.

Why force a round peg into a square hole when you can just do this.

hi-five james.

I must confess I find this whole topic shocking, for lack of a better word. When a consumer pays $1000+ for hardware and software and drives, not to mention the cost of the disks from which one gets the mkv files, to have to then subsequently get into the guts of the NAS OS to establish file permissions is outrageous.

The end use should have to setup the drives, load the data, load Plex server and client apps, and then enjoy. If some sort of specific set of permissions is required to make Plex work, then Plex ought to make that happen. I’ve used three different NAS devices in the past year…all worked, then the new one started acting up (not seeing selected files that it previously could), and for me to believe I now have to go to a command line window for an OS I have no experience with leaves me flabbergasted.

I think that the ability to send files to TV sets has existed for what - 10 years - and yet the organizations and manufacturers who produce the needed equipment can’t produce something remotely resembling a user friendly interface to their (non-network IT) customers that allows the user to configure the hardware and software as it needs to be in order to function correctly.

I think it safe to say 99% of the people who wish to utilize this technology don’t want to have to mess with command line programming changes. There’s a reason the NAS folks don’t let a casual user access their root directories with the software they provide. And Plex has to realize this - so for them to provide a server app that fails to establish the proper (that is to say required) file permissions is (almost) beyond belief! Unfortunately, it’s apparent from this discussion blog that it IS believeable. Consequently, in addition to schooling one’s self in file ripping software, network protocols, IP switches, gateway settings, ad nauseum, we now have to learn how to access the NAS OS so that Plex can see what’s it’s (supposedly) made to see.

And lastly, when somebody complained to one of the Plex code writers several months ago, his replay was, “hey - it’s technology. It doesn’t always work”. I’m not kidding, that’s what he said. He used the root cause of the problem that all computer platforms have (poorly written code, whether the app, the API, the OS - it’s all the same to the end users) as his excuse.

Just wait until the IoT hits the big time…the problems will multiply exponentially.

4 Likes

@jamesmehorter said:
Instead of messing around with permissions/ownership I chose to run Plex as my user (who has access to my hard drive/media). Simply edit the PLEX_MEDIA_SERVER_USER value in your Plex Server config located at /etc/default/plexmediaserver, e.g.

PLEX_MEDIA_SERVER_USER=james

Then restart the plex server:

sudo service plexmediaserver restart

Afterwards you can select media on your hard drive.

Thanks @jamesmehorter … After trying all the permissions “fixes” I found here and elsewhere, your solution just, well, worked.

@jamesmehorter said:
Instead of messing around with permissions/ownership I chose to run Plex as my user (who has access to my hard drive/media). Simply edit the PLEX_MEDIA_SERVER_USER value in your Plex Server config located at /etc/default/plexmediaserver, e.g.

PLEX_MEDIA_SERVER_USER=james

Then restart the plex server:

sudo service plexmediaserver restart

Afterwards you can select media on your hard drive.

This isn’t working on Ubuntu 16.04 LTS/Mint 18 since Plex Server config location isn’t at /etc/default/plexmediaserver anymore. support.plex.tv says:
CentOS7/SuSE/Ubuntu 15.04 Config:
To change the startup configuration and context of the systemd service edit the systemd service file: /lib/systemd/system/plexmediaserver.service.
On Ubuntu this file is located in: /etc/systemd/system/plexmediaserver.service

However $ cat /etc/systemd/system/plexmediaserver.service
returned cat: /etc/systemd/system/plexmediaserver.service: No such file or directory

Though someone on askubuntu.com advised to work with the same file location for Ubuntu 16.04:
Quote
To avoid permission problems run the server as your standard user, replace “plex” with your user and group in:
sudo nano /etc/systemd/system/plexmediaserver.service
Now also change the ownership of the next subdir to your user!
sudo chown -R user:user /var/lib/plexmediaserver
sudo systemctl --system daemon-reload
sudo service plexmediaserver start


How come I can’t find the config file?
Only difference is I’m using Linux Mint 18 Cinnamon 3.0.7 and installed PMS from downloaded deb package (1.0.1.2396). Should I continue here or open my own thread? Thanks everybody in advance!

2 Likes

@admbaum said:
this ^ works everytime.

Why force a round peg into a square hole when you can just do this.

hi-five james.

I guess some people just prefer their systems to remain secure as default and built to best practice. Clearly the option is there for those that don’t. If you choose to use an operating system, it’s a good idea to learn how to actually use it rather than depend on random software companies to teach you the basics.

1 Like

@rifer1 said:
The end use should have to setup the drives, load the data, load Plex server and client apps, and then enjoy. If some sort of specific set of permissions is required to make Plex work, then Plex ought to make that happen.

That would require a horribly insecure OS for that to be allowed. You most certainly don’t want an application, PLEX in this example, to go willy-nilly modifying and updating system security and permissions settings on your computer (or NAS).

1 Like

The easiest way I have found to solve this issue is to apply “Access files” to Folder access in the last section of the permissions tab. Then click on the “Apply permissions…” button. This not only solved my Plex folder access problem but a Logitech Media Server issue of the same nature:

@trudge said:

@admbaum said:
this ^ works everytime.

Why force a round peg into a square hole when you can just do this.

hi-five james.

I guess some people just prefer their systems to remain secure as default and built to best practice. Clearly the option is there for those that don’t. If you choose to use an operating system, it’s a good idea to learn how to actually use it rather than depend on random software companies to teach you the basics.

Very condescending without helping. This has no place on plex forums.

3 Likes

@ChuckPa said:
You are having basic permission and ownership problems as Bob stated.

The reason Plex can’t read below a certain point is default linux permissions.  The linux rule states that one unprivileged user (plex) cannot see another user’s files (what’s in your home directory) without express ‘read’ permission being granted.  Directory read permission is in two forms.  ‘r’ is to read the names of the files in a directory, ‘x’ is to descend through it (get to a subdirectory or file within the directory).  File permissions are simple ‘r’ (read the contents).  ‘x’ is not needed for files since we don’t ‘execute’ media.

I must first ask if Plex is indeed running as user ‘plex’, in group ‘plex’ and if it was started at boot (as a service) or if it was started by you.   Plex should be running as itself, not under your username.

Take Plex out of any groups you’ve added it to.  It serves no purpose.  Take yourself out of the Plex group if you’ve added yourself to it.  It also serves no purpose.  Plex should be free-standing in its own group and none other.

Presuming this is settled and Plex is indeed running as required,  the correction to your linux filesystem permissions are very simple.   They presume your username will remain the ‘owner’ of the media.   Plex will be granted Read permission to the files and directories containing your media.  This is its minimal requirement.

I would recommend you naming your media storage directories to exclude your username from the path.   I use  /media/movies, /media/tv, and /media/music.

You could achieve this with /media/storage1 and /media/storage2.    Care must be given to not have TV series and Movies intermixed as the scanners for each library type will get confused.  (The movie scanner doesn’t like scanning TV series names, etc)

if your movies and tv programs are contained in directories /media/storage1/movies, /media/storage2/movies,  /media/storage1/tv and /media/storage2/tv, Plex will find this very easy to navigate and maintain properly.

I will presume, for the rest of my reply, your top level media directories are structured as I outline here.

This will permit you to retain ownership, which you may set back to you as the owner  (‘chown -R peter /media/storage1 /media/storage2’) to ease managing your media.

sudo find /media/storage1/movies  /media/storage2/movies -type d -print -exec chmod 755 {} ; sudo find /media/storage1/movies  /media/storage2/movies -type f -print -exec chmod 644 {} ;

sudo find /media/storage1/tv  /media/storage2/tv -type d -print -exec chmod 755 {} ; sudo find /media/storage1/tv  /media/storage2/tv -type f -print -exec chmod 644 {} ;

Lastly,   your fstab entries for the two drives should be basic entries.     Edit appropriately for your device/partition names:

/dev/sdc1                                 /media/storage1                   ext4    defaults        1 4 /dev/sdd1                                 /media/storage2                   ext4    defaults        1 4

Restart plex or reboot as required.

When restarted,   add movie section for directories storage1 and storage2.  Repeat for tv section.

Also make sure that permissions to /media and /media/storage1 are correct. It was a problem I had.

1 Like