Issue Copying Configuration Files

@KerriK

Good Morning. ( I’m on duty now ) :slight_smile:

Primary rules of the Automounter:

  1. It will place it somewhere under /media
  2. It will create a structure with your username
  3. It will be mounted such that ONLY YOU can access the files.
  4. No amount of setting permissions will allow Plex to see them.

To circumvent this:

The entire Linux Tips, which will help you use Plex on Linux, is here:

1 Like

You’re not willing to teach but then get pissed off that we keep asking questions.

If you tell a person how to pronounce a word, of course they will keep coming back asking for more pronunciations. If you teach the basics of reading, they don’t need to keep coming back.

We’re not expecting a full course on Linux, just the tiny part that relates to Plex.

Please read Linux Tips.

And to further illustrate I am not here to learn Linux and answer why I installed it, we are running to other PCs with Linux with no issues. It works, even running some Windows apps and games in Wine.

The ONLY issue we’re having is getting Plex to work. If I went to a Linux forum and started asking about Plex, they would send me back here because they have no idea what permissions Plex needs.

May I ask a few quetions? Is Plex running? If so, are you accessing it via the web interface?

If Plex is running and you can access via the web interface, is your Movies library pointing where you expect it to point?

what are the owner, group and permissions on your test files? Plex Media Server will be running as user plex, group plex. Normally any new files you copy into the media library will be owned by user KerriK, group KerriK or whatever your user is on the linux box. Hence the permission problems you are running into.

It’s running, I claimed it, and logged in. Using the web interface, when I try to point to my test media drive/folder (Movies) it sees the drive but not the folder.

When I set the permission as instructed, it locked me out of the Movies folder and Plex still can’t see it when I try to add that folder to Movies.

The only way I can get back access to the folder and files is with sudo chmod -R 777, but as I understand permissions the third 7 is for World. Root and User are the first and second, but neither has permission with 775 or 755, and only I have permission with 777.

using ls -l in the main partition directory I get drwxrwxr-x 5 plex plex 4096 Nov 11 08:04 Movies

As I said, I am not here to learn Linux. I installed the OS and apps, transferred my personalizations and files with no issue for every other app, and even added Windows apps and games with no issue.

Plex is the only thing I am unable to get working, so I am in the Plex help forum seeing help for PLEX.

You’re right about the permissions, there is something going on there.

Lets make sure your Movies is pointing where you expect/want it to be. In the web console, click on settings (the wrench looking icon), go down to Manage, then click on “Libraries”. Sounds like you should at least have a Movies library listed. Click “Edit Library”, then “Add Folder”. Then the dialog should say “Add folders to you library” and show the path to your Movie library. In my case, its /plexmedia/plex/Movies. It will be different for you. Does it display the library path you expect it to show for your movies library?

I know how to add libraries. Now suddenly it worked and I was able to add the ‘Movies’ folder inside the ‘Media0’ partition. I was able to run a scan and install my three sample movies.

I am still baffled that it’s acting like I am not a group.

Definitely an ownership/permissions conflict someplace. From reading through this post, I know you’ve made the folders owned by plex & group plex. Who owns the test media files? What are the permissions?

-rwxrwxrwx 1 plex plex 846317413 Jul 1 15:37 ‘Nemesis (1992).mkv’

Ok, now that plex owns it and it’s 777, it would of course see it.

You say it acts like you are not a group and I think I know what you mean and you are most likely not a member of the plex group. You can check with the command “groups”. This will list what group your linux user is a member of. Since you can use the sudo cmd, it will probably have at least the “wheel” group.

mediaserver adm cdrom sudo dip plugdev users lpadmin sambashare

ok, so your user is not a member of group plex. if you just copy a test file into the library, what are the ownership and permissions before you change anything?

-rw-r–r-- 1 mediaserver mediaserver 1794438394 Sep 30 2023 ‘Star Trek The Motion Picture (1979) - Theatrical Edition.mkv’

ok, they makes sense. Plex should still be able to see that I believe since “world” has read permisssion (the last r– ). You wouldn’t be able to delete this file from the Plex web console or client since plex has no write permissions to that file.

I have nothing. Plex can’t add it, I am not Group for some reason, and only World can do anything

I’ve read at least a dozen how-tos on different sites including this one and all are different and none work

Chuck clearly doesn’t know how to fix it so acts like Im the problem and sends me to his post that doesn’t cover file and folder permissions

You could add yourself to the plex group with “sudo usermod -aG plex $USER” Log out, then log back in and run that groups command. You should see that you are now a member of group plex. The plex install does not add your user to the plex group by default.

This still doesn’t really help you much since any files you add will still be owned as mediaserver:mediaserver. You could write a little script that always change the group and write permissions for group and run that when you add files.

chgrp plex *.mp4

chmod g+w *.mp4

A different option would be to add plex to your mediaserver group and adjust your umask so that any files you create have group write permission

sudo usermod -aG mediaserver plex”
then stop and start plexmediaserver

edit your $HOME/.bashrc file and add or modify your umask setting to look like

umask 002

log out, log back in. Now any file you create will be create with rwxrwxr-x permissions.

with Plex being a member of the mediaserver group and now having read, write and execute permissions, it would be able add and delete media to your library.

All these things will have varying security implications. Hopefully you are not storing nuclear launch codes on your server. :smiley:

The instructions Chuck posted do give a more long term fix. They tell you how to run Plex media server as your login user and using the sticky bit to enable recursive ownership. That may be more than you want to bite off for now.

It doesn’t make sense to log out, log in, and THEN run the command. What is the exact syntax? You posted it as normal dialog

Run this command:

sudo usermod -aG plex $USER

That will add you to the plex group. At this point, I don’t think you’ll see a difference when you run the “groups” command. Log out, login, then run:

groups

in a terminal window, you should now see that you are a member of the plex group.