I had PMS running on an ubuntu system on mdraid-1. When a drive failed on reboot after an update, I took the opportunity to reinstall linux and try to recover plex. I do have the old data as one drive is fine, so I followed the “Move plex” article to try and get it back up and running. I can install plex anew, and I can copy in the old Library directory to the new system, but I get a PMS with no media libraries.
I have:
reinstalled OS
install plex (just days after system crashed, so versions should be same or very close)
copied old Library directory over new installation
chown and chmod to new plex:plex with 755
start service and login local web app
I have no media libraries
Any help would be appreciated. Thanks!
Ken
I should add that my media is on NFS and the mounts have been established in fstab prior to starting plex. So if the libraries had existed, then they would be accessible.
Looks like I can close my own case. I was using an incomplete copy of my Library directory. When I compare the data I was using to another, very recent, backup in another location, I was missing some amount of data from my Library backup. I used the other, complete copy and all is well.
I did have some problems with permissions and ended up opening things up more than I’d like just to regain access to some media folders. Anyone have a link to a good resource on media permissions and plex? I know there is likely an article. but if anyone recalls a good discussion on it, then please share.
For anything in /var/lib/plexmediaserver, the easiest way is:
sudo bash
cd /var/lib/plexmediaserver
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \'
For media folders, the same applies.
the ‘7’ and ‘6’ give you the read/write control you need.
the ‘5’ and ‘4’ give minimal read-only access to the media (max protection)
Hey thanks for the reply. I guess I should have been more clear. I was in a bit of a hurry when I posted my last…
I’m quite capable of setting permissions myself. My problem is that when I chown and chmod one of my media folders to plex:plex with 755, PMS can’t access the files. The plex user was created during installation of PMS and I haven’t changed what user PMS runs as. So I found it strange that plex user and group couldn’t access my media when rwx and rx, respectively, was given to plex user and plex group. How is one supposed to set permissions on media? And why couldn’t PMS access media with those permissions set?
First, your username owns the media. You grant permission through either the ‘group’ or ‘other’ bit fields.
Second, if PMS can’t see your media, start tracing the path (one directory at a time).
Examples:
/media/movies - On Ubuntu & Debian based distros with the Gnome desktop, all contents in /media will block any username, except yourself, from seeing it no matter what permissions you assign.
The resolution here is to move the media mount point out from under /media.
For all other paths: /a/b/c/movies/Movie1 (year)/Movie1 (year).ext
Does user plex, via the permission bits, have access to each level?
– /a
– /a/b
– /a/b/c
– /a/b/c/movies
So I used my user and plex group with 775 for my media mounted in /mnt/XXX paths. As I understand it, if I want plex to be able to delete media, which I sometimes like to do when I’m done with optimized versions, the w permission would be needed for group in my example. And it works…well, I haven’t tried deleting yet, but it works to access media.
Anyway, for those of you that may find this later, immediately after changing owner:group and permissions, I started PMS and tried it. I got an error stating the media was not available/accessible (can’t remember) and then I tried again a few seconds later and all was well. So I guess it took a moment for PMS to see what it needed to see…I dunno. But its working now.
Thanks, Chuck!
Ken
EDIT: Deleting from Plex Web works fine with my permissions, FYI.