DVR Issue (Write Permission Issue)

server-linux

#1

My DVRs are failing due to write permissions. I have Plex set up to run as my user account and the folders are set up where I am the owner, and my group and all others have read and write permissions. However, when I have something set up with a folder to record every episode they fail as they do not have write permissions. If I go to record a new show it will record properly but the folder it sets up has no one listed as the owner, my group listed with read access and others listed as having read access. Any insight into how I can correct this?


#2

PMS (user plex) needs permission to write to the directory just as you do.

Please see my Linux tips as I show multiple methods of working with this.


#3

I have it set so that anyone has write and read access to the directory so it should be able to write... the directories it is creating however have no one listed as the owner... could it be an issue with how I changed the user? My plexmediaserver file under /etc/default is (also did I miss a step switching something in /etc/passwd? I'm new to linux):

# default script for Plex Media Server

# the number of plugins that can run at the same time
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6

# ulimit -s $PLEX_MEDIA_SERVER_MAX_STACK_SIZE
export PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000

# where the mediaserver should store the transcodes
export PLEX_MEDIA_SERVER_TMPDIR=/tmp

# uncomment to set it to something else
# export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"

# the user that PMS should run as, defaults to 'plex'
# note that if you change this you might need to move
# the Application Support directory to not lose your
# media library (match what is in /etc/passwd)
export PLEX_MEDIA_SERVER_USER=santo

# Uncomment this to use syslog for logging instead of
# sending logs to Plex Media Server.log
#export PLEX_MEDIA_SERVER_USE_SYSLOG=true

Moderator edit: 'Code' paragraph formatting applied for legibility.


#4

Which distribution and version please?

What does cat /proc/1/comm return?


#5

Ubuntu 16.04... when I do cat /proc/1/comm it says systemd


#6

That explains your issues:

/etc/defaults was discontinued over a year ago when SELinux and bash became super security conscious.

I needed to implement full systemd support for PMS on Ubuntu and all systemd systems.

Now you create /etc/systemd/system/plexmediaserver.service.d/override.conf. In it, you override the values you used to in /etc/defaults.

If you look here https://forums.plex.tv/discussion/277724/moving-pms-library, at the top, you'll see how you can customize your PMS library location easily and permanently. This file persists even after you remove PMS. I do not track it. In the example I provide, you see the most commonly used override variables.


#7

I stopped the plexserver, made the plexmediaserver.service.d folder (as root) under /etc/systemd/system and override.conf inside that folder with the following and then started it again and it still did not work... did I miss a step?:

#
# Customize Plex's config
#
#  These values are only needed if you wish to change user & group
User=santo
Group=santo
#
# This is needed to change the default umask 
UMask=0002    # this must be 4 digits of octal 

Moderator edit: "Code" formatting for legibility.


#8

Where is PMS's "Application Support" directory. ?

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Application Support"


#9

I added that in (but did lib/plexmediaserver/Library as that was the folder I had) then did systemctl daemon-reload and systemctl start plexmediaserver and it is no longer finding my server... my override now shows:

Customize Plex's config

[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"

These values are only needed if you wish to change user & group

User=santo
Group=santo

This is needed to change the default umask

UMask=0002 # this must be 4 digits of octal


#10

Let us skip this override for now.

Your DVR is failing with Write permission problems. Which directory is it trying to write to? Into the Plex Library or elsewhere?


#11

An external harddrive mounted to /media/santo/NAS(the drive)/Video/

anytime I go to dvr a random show to test it out it works but puts it in a folder with the user permissions with no owner, group santo with just access rights and others with access rights... anything I have set to dvr automatically it fails due to write permissions errors... any of the random shows I dvr that work I can only delete through Plex

I really appreciate all the help you are providing! Sorry for the basic understanding of linux I've only used it for my Plex server I have had for about a year or two but haven't had to do much on it since I set it up


#12

NOW, I see what's happening. it's not the override or anything of the kind.

Did you mount the drive in /etc/fstab to prevent default linux security from taking over? /media/santos (matching your username) is a common mount method for GVFS (dynamic / auto mounts)

Is the drive a USB or network drive?


#13

I think fstab... I have one that is SATA plugged into the server itself and another one on the network I'm not currently using


#14

Can you look at fstab and see what's mounted?


#15

the 192.168.1.7/Public is my network drive which is what I used originally until I got the external harddrives... I'm guessing the other one would be my other mount "NAS"... Also as of right now my Plex Server is showing up as unavailable and there is a new one that is running

 # /etc/fstab: static file system information.
 #
 # Use 'blkid' to print the universally unique identifier for a
 # device; this may be used with UUID= as a more robust way to name devices
 # that works even if disks are added and removed. See fstab(5).
 #
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
 # / was on /dev/sda1 during installation
 UUID=b69f90f3-1661-457f-8838-829058e18fa3 /               ext4    errors=remount-ro 0       1
 # swap was on /dev/sda5 during installation
 UUID=9ed114c5-2a4e-44f3-b82f-3c5cd1e86a61 none            swap    sw              0       0
 //192.168.1.7/public /media/Plex cifs guest 0 0

#16

The new server that is working doesn't have access to my external storage... could it be the override we set up and me having a password the problem?


#17

Please use the procedure I show here https://forums.plex.tv/discussion/279063/using-ext-or-ntfs-drives-internal-or-external-on-linux#latest

Put your other drives (your media, including where DVR saves) in that structure.


#18

Ok I have that all set... how do I get my plex server back and running? After the other things we did my server is no longer working and shows up as unavailable and the one that is running has access to nothing on my computer


#19

Any idea where it went wrong? My plex server says unavailable and there's a second server that shows zero folders or files on my computer


#20

My apologies for the delay. I was away (a couple vacation days).

Please do the following.

sudo sh
systemctl reset-failed
systemctl start plexmediaserver

# after it fails / prompt returns
systemctl status plexmediaserver

# and now examine the system logs
journalctl -xe | grep -i plex

Please copy/paste that output here. If the output from journalctl is HUGE, please put it all in a text file and attach the text file instead.

Next,

df -m

Let me see what is mounted where