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

@botchniaque said:

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

Thanks! Good catch!

Hmm, I’ve been struggling with this too. Kubuntu (KDE version of Ubuntu) now has the option to make a folder/files available for a named user or group though. So I made sure that plex was selected as being able to access (+rwx) the folders that hold the media files I want to use.

I also added to ā€œList of IP addresses and networks that are allowed without authā€ the local network addresses I’m using namely ā€œ192.168.1.1/24ā€. I’m not sure which finally made it all work but I’m not going to mess with it any further, it’s already sucked up the best part of a day!

Happy to answer questions though, just thought it worth posting this additional potential factor.

@saidulhassan said:

@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!

@saidulhassan said:

@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!

I’m running CentOS7 and this is the only thing that helped me out.

Thanks

@skijbal

What are you trying to do? Do you ask a question?

I am finding that none of these solutions work for Ubuntu 16.04. Tried all of them.

just found this, this worked for me.

Applicable across the board… not just mint

File permissions + internal & External disks:

Scroll back a bit, select what’s appropriate, edit and augment (add) as needed to suite your neeed

To customize Plex operation environment on systemd systems

Option A: Create a unit override file

Copy /lib/systemd/system/plexmediaserver.service to /etc/systemd/system
Edit appropriate fields

Option B: Create a service variable override file

Make directory /etc/systemd/system/plexmdiaserver.service.d
Copy /lib/systemd/system/plexmediaserver.service to /etc/systemd/system/plexmediaserver.service.d/override.conf
Edit override.conf, keeping ONLY the changed values

No hacking of group / user names required in /etc/passwd or /etc/group

@ChuckPa said:

@botchniaque said:

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

Thanks! Good catch!

This worked for me, just had to run the same commands for each level of the directory ( /media, /media/user /media/user/storage1, /media/user/storage1/movies, e.g.)

chown -R username takes care of that part.

these take care of adding read permissions but you’re the owner.
find /media -type d -exec chmod 755 {} \;
find /media -type f -exec chmod 644 {} \;

use sudo as required

1 Like

I’m completely at a loss. I have Fedora 25 and installed the latest Plex Media Server for 64 bit. I’ve add plex to the group that owns the Media Directory. And I have the directory on the mounted hard drive so the directory is /mnt/Fileserver/Media. I still can’t get plex the ability to scan the directory even if the permissions are set to 777.

Is there something else that I’m missing? I don’t know why plex won’t work on F25. I have tried everything in this forum but, honestly, none of it seems to pertain to F25. Could SELinux be giving it an issue?

Any help would be appreciated.

@theshaggyviking

Linux groups don’t work like Windows groups do. First, file permissions and how they are mounted matters most. For now, you can remove plex from that group. It serves no purpose at this time. We will address it in a more robust way shortly.

SELinux is of no concern here. It is only of concern with executable programs. Media is data.

I can walk you through making the process which works for you and your configuration. The more you can tell me in your next reply makes it easier for me to give a better and more accurate answer. To that, I have a few questions

  1. Are the drives external and connected via USB?
  2. If so, how did you mount them in /etc/fstab ?
  3. Are the drives NTFS format or Linux (ext4) format? If you don’t know that’s fine.
  4. When you open a Terminal window, and type df would you mind showing me the output of df? I would like to see the device names so I can help with the command sequence you’ll need (explaining as I go).

Edit: We will be following the same basic procedure I outlined in this thread, helping this user. We will customize it for your situation.

@ChuckPa

Hey man! Thanks! I figured it out how to use that drive and keep Plex in it’s place. I didn’t think I could just create a directory in /media and then point the fstab to it but I did and it works and I’m back to reloading the database so thanks!

No more frustration, and no more virtual machines running plex.

1 Like

Thanks for the info.
Partition table format doesn’t impact us at this level. We’re in the Filesystem, not on the bare HD.

My only concern is with x-gvfs-show. It’s been problematic / unstable. Is there a specific reason you’re using it?

I see you have auto for the fs-type. I don’t have that in my version of Fedora (24). that something new?

If I were to adapt one of your lines, I would consider this:

LABEL=Fileserver /mnt/Fileserver auto defaults,auto,nofail 0 4

I’m presuming the first ā€˜auto’ is ā€˜autofs’ determination but cannot verify that. If not ā€˜autofs’, use ext4 or ntfs as appropriate since you know your machine better.

default permission handling for the drive. This is the most important and what I feel you’re missing.
auto mount at boot
nofail if the drive isn’t there

I would use LABEL=Fileserver /media1 ext4 defaults,auto,nofail 1 4 with Plex and all is just fine.

Once that is in place; GVFS is not in the picture (it loves to take exclusive access of anything it can and exclude user plex, we can properly set ownership and perms.

Assuming the FS is ext4 it’s just like I wrote for the other user.

Before mounting the drive, do the following, changing my linux username to yours.

sudo sh
chown -R chuck.chuck /mnt
chmod -R 755 /mnt      # this gets all the mount point directories but not the files (they're not mounted yet)

Now mount the drive

mount /mnt/Fileserver     #   If errors here, fix the typos in /etc/fstab and repeat
cd /mnt/Fileserver

This is where we make Plex happy and you don’t need root to do anything, nor do you need to do any group work

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chown -R chuck.chuck Fileserver

What this all just did:

  1. Mount the file system using defaults and pushed GVFS (Gnome File Manager out of the way because it interferes heavily)
  2. Set the perms and ownership on the base directories before mount
  3. Test mounts what you defined in /etc/fstab
  4. Sets the perms and ownership with everthing now mounted and in place ready for use

At this point, You can go to Plex, Create a library, and navigate down into /mnt and find what you want to be the top level (root dir) of that media library

That’s it.

1 Like

Now, WHY did we do that? Plex runs as as unprivileged user, just as you and I are in Linux. Linux default security keeps us from seeing each other’s files without explicit permissions or as ā€˜root’ (we override all that)

I’m not sure if others had the same problem, but when Ubuntu mounts a partition it’ll place the mounts in /media/username/DiskLabel. Plex seems to have a hard time with /media/username/* mounts, and no matter what permission settings I used Plex still wouldn’t read the files or list the directories.

I found the solution was to create a mount point in /media/DiskLabel (sans username) as well. I’ve chosen to automount my drives, but you may choose to create a symlink instead. Here’s the fstab configuration that I used:

sudo mkdir /media/Prometheus
/dev/disk/by-label/Prometheus /media/ajbogh/Prometheus ext4 nosuid,nodev,nofail,x-gvfs-show 0 0

/dev/disk/by-label/Prometheus /media/Prometheus ext4 nosuid,nodev,nofail,x-gvfs-show 0 0

Two key parts of that are highly problematic.

  1. not standard. Use LABEL=string if you must in /etc/fstab. /dev/by-lavel is not now to do it. That’s why we have LABEL= in /etc/fstab
  2. get it out of /media. Ubuntu loves to claim exclusive access to /media

I’ve created a Linux FAQ with many of these details at the top of the Linux forum.

I am a Linux Mint and Plex newbie and I love Mint 18.2 and the latest Plex server software. That said I had been frustrated for 2 days while searching forums, attempting everything above but to no avail. Despite it being 8/2017, I’m sure there will be new users in my shoes over and over again.

In my situation, I do not have any media in my home folder. I have a SSD with the OS and home partitions on it and a separate drive that contains all (only) my media. I don’t want to give up any permissions so others can access my system. I don’t care if another user can access the media though. After much searching I found the answer which uses the GUI and no command line needed here:

Specifically this post:

{
Its simple:

plug in the drive.
Go to disks
Select the correct disk in the left column.
Click the gear icon enter image description here
Select edit mount options
Turn off
Check both mount at startup and show user interface
Thats it!

shareimprove this answer
edited Jul 5 '16 at 17:40

MERose
189316
answered Nov 11 '14 at 20:21

WhosUrDaddy
30528
}

I tried this and all of a sudden, the name of the drive changed (to what looks like the drive serial number) but when I pointed Plex at it, it was able to see all the sub folders. Yaahh! I’m very satisfied with this solution. With this solution, basically anyone logged in can access the media drive. So what? They need a user account anyway.

Plex should have some option to install and locate media without a hitch. I get there are security issues, but perhaps with permission (password) Plex can determine how to change permissions securely to give access itself access only to the media folders you point it at, preferably without a hitch like in Windows or MacOS. The only way Linux will spread in popularity among home users is if software made for it becomes easier to use. Best of luck to those in the same situation.

1 Like

@Dino9848 said:

Plex should have some option to install and locate media without a hitch. I get there are security issues, but perhaps with permission (password) Plex can determine how to change permissions securely to give access itself access only to the media folders you point it at, preferably without a hitch like in Windows or MacOS. The only way Linux will spread in popularity among home users is if software made for it becomes easier to use. Best of luck to those in the same situation.

  1. Linux isn’t intended for the light hearted. Using PMS on Linux presumes a minimal mastery of Linux before beginning
  2. While we help with Linux issues, we don’t have time to teach Linux. There are plenty of excellent tutorials out on the internet.
  3. I have created the Linux Tips section at the top of the forum to help with the most common Plex-specific issues, such as mounting external disks.
  4. Linux already owns the server market just as Apple and Microsoft own the desktop market.

@Dino9848 said:
I am a Linux Mint and Plex newbie and I love Mint 18.2 and the latest Plex server software. That said I had been frustrated for 2 days while searching forums, attempting everything above but to no avail. Despite it being 8/2017, I’m sure there will be new users in my shoes over and over again.

In my situation, I do not have any media in my home folder. I have a SSD with the OS and home partitions on it and a separate drive that contains all (only) my media. I don’t want to give up any permissions so others can access my system. I don’t care if another user can access the media though. After much searching I found the answer which uses the GUI and no command line needed here:

mount - Mounting external hard disk for all users at start up in ubuntu 14.04 - Ask Ubuntu

Specifically this post:

{
Its simple:

plug in the drive.
Go to disks
Select the correct disk in the left column.
Click the gear icon enter image description here
Select edit mount options
Turn off
Check both mount at startup and show user interface
Thats it!

shareimprove this answer
edited Jul 5 '16 at 17:40

MERose
189316
answered Nov 11 '14 at 20:21

WhosUrDaddy
30528
}

I tried this and all of a sudden, the name of the drive changed (to what looks like the drive serial number) but when I pointed Plex at it, it was able to see all the sub folders. Yaahh! I’m very satisfied with this solution. With this solution, basically anyone logged in can access the media drive. So what? They need a user account anyway.

Plex should have some option to install and locate media without a hitch. I get there are security issues, but perhaps with permission (password) Plex can determine how to change permissions securely to give access itself access only to the media folders you point it at, preferably without a hitch like in Windows or MacOS. The only way Linux will spread in popularity among home users is if software made for it becomes easier to use. Best of luck to those in the same situation.

Ok I had to sign up just to reply to this. As a newb linux mint user who hasn’t done any command line stuff yet (yeah its possible)and this thread was the first one in the google search results. I thought I wold reply that this is the post that sovled my problem and Thanks very much!

@Dino9848 said:
I am a Linux Mint and Plex newbie and I love Mint 18.2 and the latest Plex server software. That said I had been frustrated for 2 days while searching forums, attempting everything above but to no avail. Despite it being 8/2017, I’m sure there will be new users in my shoes over and over again.

In my situation, I do not have any media in my home folder. I have a SSD with the OS and home partitions on it and a separate drive that contains all (only) my media. I don’t want to give up any permissions so others can access my system. I don’t care if another user can access the media though. After much searching I found the answer which uses the GUI and no command line needed here:

mount - Mounting external hard disk for all users at start up in ubuntu 14.04 - Ask Ubuntu

Specifically this post:

{
Its simple:

plug in the drive.
Go to disks
Select the correct disk in the left column.
Click the gear icon enter image description here
Select edit mount options
Turn off
Check both mount at startup and show user interface
Thats it!

shareimprove this answer
edited Jul 5 '16 at 17:40

MERose
189316
answered Nov 11 '14 at 20:21

WhosUrDaddy
30528
}

I tried this and all of a sudden, the name of the drive changed (to what looks like the drive serial number) but when I pointed Plex at it, it was able to see all the sub folders. Yaahh! I’m very satisfied with this solution. With this solution, basically anyone logged in can access the media drive. So what? They need a user account anyway.

Plex should have some option to install and locate media without a hitch. I get there are security issues, but perhaps with permission (password) Plex can determine how to change permissions securely to give access itself access only to the media folders you point it at, preferably without a hitch like in Windows or MacOS. The only way Linux will spread in popularity among home users is if software made for it becomes easier to use. Best of luck to those in the same situation.

Ok I had to sign up just to reply to this. As a newb linux mint user who hasn’t done any command line stuff yet (yeah its possible)and this thread was the first one in the google search results. I thought I wold reply that this is the post that sovled my problem and Thanks very much!