Plex DVR "No Write Access" issues

Server Version#: 1.13.5.5332
Player Version#:
Hi all,

I’ve been toying with the DVR feature from my HDHomerun Quatro of the past couple of days but I can’t seem to figure out permissions. I have my library hosted on my Freenas box running 11.1-u6 and my Plex server installed on Ubuntu 18.04. I’ve followed advice to make sure that the plex user and groups match up UID and GID on the server install and the Freenas box.

uid=111(plex) gid=113(plex) groups=113(plex),44(video)

This is the output from my server install and I created a plex account in Freenas with UID 111 and a group account of plex with GID 113. My media folder on Freenas is group owned by plex and I did set that recursively.

From what I’ve been reading, as long as the plex user in Freenas is in the owning group of my share, I should have write capability. However when I try to record from my guide in Plex, I’m consistently getting a “No Write Access” error when I try to record something.

Can someone please point out what I may be doing wrong here?

TIA

Thanks for the info @ChuckPa but this is why I’m confused.

Here is the output of my directory structure and plex info from FreeNAS:

[root@freenas ~]# ls -la /mnt/Household/Media/                                                                                      
total 344                                                                                                                           
drwxrwxr-x    8 castacio  plex     8 Sep  7 22:32 .                                                                                 
drwxrwxr-x    5 castacio  ateam    5 Sep  1  2017 ..                                                                                
drwxrwxr-x    3 castacio  plex     3 Oct 31  2017 AtmosFX                                                                           
drwxrwxr-x    2 castacio  plex     2 Sep  7 22:32 DVR                                                                               
drwxrwxr-x    5 castacio  plex   356 Sep 10 13:49 Movies                                                                            
drwxrwxr-x  250 castacio  plex   357 Aug 24  2017 Music                                                                             
drwxrwxr-x   15 castacio  plex    15 Aug 26  2017 Pictures                                                                          
drwxrwxr-x    3 castacio  plex     3 Apr  3 12:51 TV Shows                                                                          
[root@freenas ~]# ls -la /mnt/Household/Media/DVR                                                                                   
total 18                                                                                                                            
drwxrwxr-x  2 castacio  plex  2 Sep  7 22:32 .                                                                                      
drwxrwxr-x  8 castacio  plex  8 Sep  7 22:32 ..                                                                                     
[root@freenas ~]# ls -la /mnt/Household/Media/TV\ Shows/                                                                            
total 35                                                                                                                            
drwxrwxr-x   3 castacio  plex   3 Apr  3 12:51 .                                                                                    
drwxrwxr-x   8 castacio  plex   8 Sep  7 22:32 ..                                                                                   
drwxrwxr-x  10 castacio  plex  10 Apr  5 17:34 Futurama                                                                             
[root@freenas ~]# id plex                                                                                                           
uid=111(plex) gid=113(plex) groups=113(plex),1003(ateam)

The user plex is in the group plex and the group plex owns my shares. So as far as I can tell, I have FreeNAS setup as your instructions suggest but I still can’t record. I’m using the TV Shows directory for DVR until I get this worked out so you can just ignore the DVR directory.

Doesn’t FreeNAS use a jail or other such container mechanism?

I don’t use FreeNAS but seem to remember it has similar constraints as a Docker container would and therefore mapping needs to occur somewhere in that process.

Help?

Yes, FreeNAS does offer a jail to run Plex in. In my case I have a separate piece of hardware that I’m running my Plex server on. FreeNAS is just hosting the files for which my Plex server is connecting.

OK, so I finally fixed my issues with the DVR!

The issue was that the share was being mounted as root:root. I found out how to change this in my fstab entry so that the mount would be for plex:plex.

//freenas/media /shares/media cifs comment=systemd.automount,credentials=/home/castacio/.smbcredentials,iocharset=utf8,defaults 0 0
//freenas/media/DVR /shares/DVR cifs uid=plex,gid=plex,comment=systemd.automount,credentials=/home/castacio/.smbcredentials,iocharset=utf8,defaults 0 0

Notice the difference between the DVR share mount and the media share mount is uid=plex,gid=plex. This will give PMS the write permissions, as the plex user, necessary to save to my NAS.

2 Likes

Just for reference for anyone else who comes across this thread. This is what my permissions look like. I left the media mount as root:root because nothing on the system where I have PMS installed needs to write to that share. But you can see how the DVR share was mounted as plex:plex permissions.

ls -al /shares/
total 8
drwxrwxr-x  4 plex plex 4096 Sep 21 20:43 .
drwxr-xr-x 24 root root 4096 Sep 17 20:39 ..
drwxr-xr-x  2 plex plex    0 Sep 21 19:50 DVR
drwxr-xr-x  2 root root    0 Sep 17 20:56 media

Yep, you posted that same link earlier in the thread.

The missing link for me turned out to be figuring out how to mount the DVR share as plex:plex in fstab.

You don’t mount it as plex:plex. That’s the point.

The files are UID/GID matched and sec=sys takes care of the rest.

Sorry, I don’t think I’m fully understanding what you’re saying.

The post you are referencing is basically saying that in order for PMS to have permissions you want on the directory you’re writing to, it needs to be either the user that owns it or in the group that owns the directory.

In my case, the DVR directory is over the network and on a NAS. When I’m mounting the NAS in /etc/fstab on my Ubuntu plex server I’m using credentials for the user that owns the DVR directory. So that should give me write permissions on the NAS.

As I understand, /etc/fstab is run as root. so in order to give the mount directory on my plex server the correct permissions for PMS I declared the user and group in the /etc/fstab entry. Otherwise, it mounts as root:root which doesn’t allow PMS the permissions needed to write.

This does work for me so I’m not understanding what it is you’re stating that I’m doing incorrectly?

I do really appreciate the feedback here.

This is where you are mistaken.

You have two choices:

  1. Use sec=sys and use the UID/GID matching method where there exists a username plex and group plex on the NAS with the same UID & GID as the PMS host

or

  1. You create user plex and group plex on that NAS, give it write permission to those shares, but omit the sec=sys option.

What I am saying is:

PMS must have permission to write to any directory it is going to write to, whether that be to create new directories for the movies or new directories for the series.

You can “shotgun” this by performing a chmod -R 777 on the NAS side. This disables all sense of ownership but will soon come back to haunt you as ownership gets out of control.

This is why I have taken the time to show how to have PMS create entrries automatically which comply to the first permissions you applied.

1 Like

OK, so to be clear my fstab entry should look something like the following?

//freenas/media /shares/media cifs comment=systemd.automount,sec=sys,iocharset=utf8,defaults 0 0

As long as I have a plex:plex on my NAS which matches the UID and GID of plex:plex on my PMS server this will work? I don’t need to supply a credentials file on the entry?

I’m not seeing this as an example in your documentation. This is why I’m so confused here.

You’re using CIFS notation.

Does FreeNAS (being unix) not offer NFS share exports? CIFS is not very compatible with Linux at all.
Please go into the sharing settings in the NAS and enable NFS if it has it.
You will then be able to use NFS share mounting as I show.

Everything is here.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.