Linux and DVR permissions

Server Version#:3.69.1
N/A

I have followed the directions found at Plex DVR "No Write Access" issues but am still getting a write access error when trying to record something from Plex DVR in Ubuntu 17.10. The drive is mapped successfully via SMB (and is on a windows 2016 server host).

Please let me know what additional information I can provide to try and troubleshoot this issue. If I run “ls -laR” on the folder it shows root:media (media being a group I created following the above guide). The only thing I didn’t do after the above is reboot the server.

Thanks in advance, and I’ve been researching this for a few days now and can’t tell where I’m going wrong.

User plex must also have write permission.

Chuck! I’ve read so many of your posts trying to figure this out.

How do I grant plex write permission?

Since your storage is a Windows share,

  1. Primary permission to write must be granted to a user named plex on the Windows side.
  2. The mount point must allow user plex write to the mounted directories on the Linux side
  3. Since you’re mounting the share using SMB in /etc/fstab, adding user=plex to the credentials and the permissions masking is best.

Have you seen this writeup?

  1. This was not done and is not a step I’ve seen in my googling. I’m running a windows domain so I’ve created a new domain user called “plex” and have given that account read/write/modify on the folders that I’m using on the Windows side of things (I created two new folders [under a folder called DVR] to house the recordings called “TV” and “Movies” [so D:\DVR\TV and D:\DVR\Movies] to keep them separate from my other non-DVR’d library).

  2. I believe I did this by adding the plex user to a group called “media” (I think this was in a guide you had written up). How can I tell if I’ve done this correctly? ls -laR on the folder?

  3. Should I be mounting the share as my newly created plex user in Step 1?

I did see the writeup. What threw me is that when the guide mentions “NAS” I’m thinking of a Drobo or a QNap (or a device running a linux / terminal based OS) and not so much of a Windows Server hosting SMB file shares. I’m guessing that this guide would also apply to a Windows file share as well, correct?

I’m not sure which reference you’ve included with the media group. The link you provided isn’t mine.

Mixing Linux setuid/setgid doesn’t apply to Windows shares. This might be what you’re experiencing.

I do need to see:

  1. ls -la of the mount point directory without the share mounted
  2. Again with it mounted.

This is the link I was referring to re: media group: Automating Linux permissions using inheritance (Helps DVR)

I was following this guide to try and get the permissions to switch from root root to plex plex or even media media (with my linux logon account as a part of that group - let’s call that account “ted”)

drwxr-sr-x 4 root media 4096 Nov 23 14:29 .
drwxr-xr-x 16 root root 4096 Nov 22 09:30 …
drwxr-sr-x 2 root media 4096 Nov 23 14:29 Movies
drwxr-sr-x 2 root media 4096 Nov 23 14:28 TV

drwxr-sr-x 4 root media 4096 Nov 23 14:29 .
drwxr-xr-x 16 root root 4096 Nov 22 09:30 …
drwxr-sr-x 2 root media 4096 Nov 23 14:29 Movies
drwxr-sr-x 2 root media 4096 Nov 23 14:28 TV

Thanks Lloyd, now I’m in sync.

the commands to do this (short form) are:

cd /directory/containing/media
chown -R YourLinuxUsername:plex .
find . -type d -exec chmod 775 {} \;
chmod -R ug+s .

What these 3 do:

  1. Get into the directory you want to set inheritance for
  2. Set everything to the desired permissions (recursively from this point down)
  3. Change group permission on the directories so they are writeable.
  4. Enable setuid and setgid so they propagate (recursively from this point down)

I wrote the above so

  1. your username owns the files (easy admin of everything)
  2. group plex has write access. only Plex is in group plex
  3. it self propagates.

Does this help?

That does. I’ve run the commands; the output of ls -la with the folders mounted is:

ted@UbuntuPlex:/mnt/DVR$ ls -la
total 4
drwxr-xr-x 2 root root 0 Nov 22 09:57 .
drwxr-xr-x 16 root root 4096 Nov 22 09:30 …
drwxr-xr-x 2 root root 0 Nov 24 15:34 Movies
drwxr-xr-x 2 root root 0 Nov 24 15:33 TV

Does this now look correct (I don’t think so but I’m not sure)?

the directory listing part where the permissions are (drewr-xr-x) should also show the letter s in it.
THat tells me SMB doesn’t honor the permissions.
This will have to be done entirely on the Windows side.

You will need give user plex permission to write and ownership of the files.

Also, as stated in the tip, mount as user plex (user=, pass= clauses)

The plex account I created in windows (called “plex”) has R/W/M on the DVR folder and all subfolders (set via windows). I’ve also set the “plex” account as the owner of the files in windows as well.

Where do I modify my fstab file to mount the drive as the plex user? Here is what I’m currently using (some data changed and bracketed to protect the innocent):

//[server]/Videos/DVR /mnt/DVR cifs user=plex,password=[password],iocharset=utf8,vers=2.0 0 0

//[server]/Videos/DVR /mnt/DVR cifs uid=plex,gid=plex,user=plex,password=[password],iocharset=utf8,vers=2.0 0 0

add the UID GID force on this end. the other fields are for logging in.

Better, though now I’m getting “Recording failed. Please check your tuner or antenna.”

That’s the signal strength on the input to the tuner side.
Without being hands on, there is nothing we can do for that except to
recommend a) check how many splitters involved (do the math and see how weak the signal is) b) amplify the signal by 3 -> 6dB before starting to split it out everywhere.
If it doesn’t get a channel lock (tuned) within X seconds, it will report the error

WIll do. For those reading this, mounting the drive as the plex user solved the issue. I’ll open a new ticket if the tuner issue persists (know that the tuner shouldn’t be an issue as I watched the same show on my TV at the same time from the same antenna connected to the TV Tuner)

For anyone following along, here’s a link to the new forum post about the antenna issue:

Hi! I have sins last week problem that I cant record any tv shows “permissions not allowed” and evrytime I change a channel it says… Recording failed TV live…
Im using a CentOS … not that good in linux… followed some guides have been workin fine until recently.
Im using a NAS and mountpoint /nas/plex with some subfolders. I have created a plex user with a password on the NAS… I have read sevral guides here… but got nothing to solve my problem. @ChuckPa plz… help :smile:

@Nevon

Does the NAS support NFS exporting? This is the most important. If it is a Synology or a QNAP, the answer is yes. Who is the manufacturer?

Once that is known, how to make this work is trivial.

It will also help to see log file of this failure if you can capture it promptly.

I have a QNAP

excellent,.

This will be trivial. :slight_smile:

My fstab entry for the QNAP is:

# Animated
vienna:/animated   /vie/animated   nfs sec=sys,intr,rw,vers=4,timeo=15,auto,async,nofail,bg 0 0

On the QNAP:

  1. Enable NFSv4
  2. Set permission to the share so everyone (guest) can write to it.

Back on Linux,

  1. Let plex:plex own the mount point directory
  2. Mount as I show above