Hey ChuckPA, thanks for this. However, this would have possibly been helpful if it were easier to find. Without your post above I would have never stumbled on these tips.
Also, even though I have followed every step in this thread and in some of those tips, I still am seeing failed recordings because of permissions. I’m at my wits end.
Rick,
On the old forum, all these were at the top of the Linux forum in their own sub-forum where much more easily found.
We’ve been on this provider a little over a month and still finding optimal ways of doing things.
If you’ll share what you’re trying to do, I can probably help you figure it out easily enough.
The ’ Using Inheritance ’ tip is probably the best one for DVR recording.
I will look at that tutorial, but in the meantime, can you tell me why this is something that I should or need to do? I don’t understand what it’s for or why I need this. I have set my permissions, created an fstab entry to mount the drive in /mnt rather than /media, etc. I want to learn why so I can understand what I’m doing and also either check my frustration or have an intelligent and informed argument against all of these steps.
EDIT: I guess I missed the other part of the previous post. I am simply trying to set up a working DVR. I can see files that are already in my library everywhere I would expect, but permissions for the drive I’m trying to record to are not allowing recordings. I just tried something but I get different results if I set something to record from the server vs recordings that are already scheduled. That shouldn’t make a difference, yet it does.
Gnome (Session Manager) runs as root. That’s where you log in. It starts Gnome Display Manager (GDM) as your username and sets up the desktop session (Gnome Session) which is also under your username.
Gnome Session watches for things to be inserted in USB slots or DVD/CD drive slots (anything not already mounted).
When it finds something not previously defined, it examines it and then creates mount point directories under /media, mounts the media with exclusive access permission to your username. It has this privilege as root
Default Linux security prevents a user from seeing another user’s files without expressly granted permission. Since Gnome didn’t create it as readable by everyone, user plex can’t read it.
It has claimed, through how it operates, ownership of /media. When you sign out, anything which has been automounted under /media is unmounted. (Remember, the top level runs as root and has that privilege).
The reason it fails, even when you set the permissions as wide open, is because of the exclusivity at the mount point itself (invisible and enforced by the kernel)
This is why we mount it anywhere else it doesn’t cause a conflict.
I opted to show /disk but it can be any name, eg /mnt that’s totally up to you.
I’m old school so /mnt to me is reserved for temporary mounts.
Permanent mounts deserve a formal & dedicated name.
My NAS mounts are under /nas for that reason.
I moved the mount point out of /media because you mentioned earlier in this thread that I should:
As you suggested, I set up an entry in fstab to mount the drive under /mnt, as mentioned in a few other threads. I honestly couldn’t think of another/better mount point. This works as expected. As mentioned in multiple threads, I set owner and group to be plex:plex. After checking to see what user runs plex (which is me, for some reason) I tried changing owner and group back to me. The plex user is already part of my group. I have the mode set to 777 for this drive (recursively, and checked to be sure it actually did apply to all folders and files) so there should be no conflict with anyone trying to read or write to this drive.
I manually started a recording just now and see no error, however, I did this multiple times yesterday, all newly scheduled recordings completed as they should, then everything that was set up to record previously (when I first set up the server) all failed with an error about permissions.
I feel like there is so much conflicting info on these forums and elsewhere on the internet and no single “this is every step to take to set up an Ubuntu-based PMS for success” document. I know that there are always going to be special use cases that fall outside of “standards” but the setup instructions provided on this site are about what commands to use to download and install PMS, but there are no definitive instructions about all the other things you need to do, know, etc. Not calling anyone out, just trying to provide a suggestion.
I guess I just have to wait until the next scheduled recording this afternoon to know if these changes had any positive effect or if I’ve just made a bigger mess.
My question: “Why do you need to move them from /media ?” was rhetorical
IF I may make a suggestion concerning your mounts, permissions, and ownership?
If user plex doesn’t need to write into all those subdirectories, why give it 777?
You could accidentally delete media (if media deletion is enabled – which it is by default)
To prevent this, but allow you to freely administer your media, as I’ve also shown in the How-To:
With the disk(s) umounted, give your username ownership of the directory itself (sudo chown rick:rick /mnt/MountDirName) and give your username permission to write there (chmod 755 /mnt/MountDirName)
Mount the media
Now take ownership of all of it: sudo chown -R rick:rick /mnt/MountDirName
Give user plex (or any other username) permission to read it:
4a. find /mnt/MountDirName -type -d -exec chmod 755 {} \;
4b. find /mnt/MountDirName -type f -exec chmod 644 {} \;
Now you have full read/write permissions under your Linux username and everybody else has read-only.
When it comes time to let DVR record into a specific directly, we will unlock that specific target (make it writeable )
All we need do for DVR is ‘chmod 777’ on the directory DVR is writing to -OR- employ the automatic permission control technique I show in the other how-to
For my use case, I don’t actually see the strategy. This machine is only used as a fileserver and PMS, and I stay logged into it at all times. There are only two of us ever using this PMS, so I do want media deletion enabled. There are few things that we will be recording that we want to keep for any length of time and the delete option is hidden enough to not worry me.
I appreciate you walking me through some of these scenarios, but frankly most people should never HAVE to do anything like this, hence my personal frustration. It’s amazing that we have the ability to do these things, but folks need a simple, easy-to-find set of standard instructions. Most of this could be/should be programmed INTO Plex itself. Just my two cents after a couple of weeks of frustration.
Lastly, once I got things set up and did a couple of test recordings that were successful, I thought my issues were solved. But of course not…from what I can glean with some testing, any recordings set up BEFORE mounting the media drive via fstab and correctly setting permissions STILL fails with a message about permissions. As a test I deleted and recreated a couple of recordings and THOSE were successful. This makes no sense. If there’s something amiss, we should be able to see this and Plex should warn us BEFORE recordings fail. Now the task before me is to delete every single recording schedule and recreate. Hopefully this is the last of these issues.
Again, thank you for your help. I vent here in hopes that this may be helpful to others.
Something that I already stated but I guess I have to repeat:
If one does not know how to use/administer/configure a certain OS than don’t use it. Permissions are a fundamental concept of Linux (and the other Unix OSes I guess) and have to be applied correctly. If one does not know how to apply this, than (s)he should stick with their favourite OS (windows/mac os).
And also again: this is not a fault of plex but merely a feature of linux.
I have to disagree. I have successfully used Ubuntu since 2006 and had few issues that I couldn’t resolve myself simply relying on others via forum posts, how-to guides, google in general. These are computers. A purpose of a computer is to make some things easier, automated, etc. And a community of folks helping each other learn is what grows a community. Simply saying “go away if you don’t know how thing X works” is far from helpful to a community.
Besides, Ubuntu IS my favorite OS. I was (again) lazy and tried to do this with Win10 and had nothing but issues with the system locking up, hard reboots, etc. This is why I made some time to put Ubuntu on this server.
I’ve been using Unix/Linux for 35+ years now (my career).
I did my best to boil down what must be done to automatically handle permissions for files shared between multiple users (your namename and user plex) in a form which is most readily understood by those who’ve not worked in such scenarios independent of their level of Linux mastery.
As stated above, UID/GID and file permissions are fundamental to Linux and must be adequately mastered at some point in order to achieve the desired result.
If this is not obtainable for whatever reason, other operating system choices are readily available.
I followed all of your instructions except for the inheritance part, as I don’t understand why or even if I need to do this. Seemingly, the only issue still outstanding is why old recordings (pre fstab setup and permissions correction) are failing while newly created recordings are not. I assume – since no one as mentioned this – that this is behavior not likely seen before or often. I’m resigned to going through the list, deleting each recording and recreating. I’ve already done with with about 1/4 of my recordings, which is how I know it NOW works.
I do sincerely appreciate your help with all of this. I mention any or all of this in order to share my own experience in hopes that someone else can then connect their issues with your recommended fixes, and also so that the Plex team can see specific issues (like “older” recordings failing).
My last note: as I said, I have been using Ubuntu (and other Linux distros) for more than 10 years. I am a user, not a professional, which is likely something that a vast majority of Plex users can say. I know how to look up answers I need, however, it’s been quite a few years since I have dealt with certain things, such as permissions. And even the guides I found were not working as expected and very often contradictory. Most Linux users don’t do things, such as setting permissions, on a regular basis and need to refer to a manual of sorts when they need to make a change. I’m not trying to be argumentative, but explaining why I believe there’s a need to make some of this easier.
Again, I appreciate your help not only with my issues but for the community at large. Have a good night.
That’s correct. The old path was to the USB drive mounted at /media, however, I deleted that path from the library, now only the new/correct path mounted at /mnt remains. I don’t see a way to view a specific path in the recordings or how to adjust, so as they fail, I am deleting and re-adding which works most of the time.
If a library has more than one folder as source, you can select the folder where the recording should go in by just clicking on the scheduled recording. The old ones might have that old folder in them. So you might add a dummy folder to the respective library and then edit the old scheduled recordings and set the correct path. Dunno if that helps.
That helps to at least ensure that I’m choosing the correct folder when fixing the old/bad recordings, but the folder option doesn’t show up when adjusting current recordings. But, at least I am CERTAIN that the correct folder is being chosen.
Obviously. But there is no option of which folder to choose when adjusting a currently scheduled recording. The folder drop-down only shows up when adding a new recording.
Could be, I only checked with an item that I wanted to record, which does not seen any airings currently. This is probably the same as a new recording.
I have a similar setup, however, when I moved the drive that holds those folders to a different mount point (even though the library name remained the same) I continued to have recordings fail except those I would set up to test the permissions and mode changes. I tried deleting a previously set up recording and setting the same show to record again and it did not fail. Not sure where/if/how the absolute path is kept as part of the recording but this scenario seems to say that may be the case.