How to change location of Plex Media Server data files on CentOS

I installed latest PMS on my CentOS 7 server. Now need to know how can I change storage location of the Plex Media Server data files? They are filling up my drive very fast that I must change the directory. I have plenty of space on other drives to store these files - I just do not want them on my OS drive. Normally something like this would be in settings and I can not find it, nor does searching produce any answers. Storing all this data on the main OS drive just does not work for me.

Your help is much appreciated.

Thanks

Server Version#:
Player Version#:

Had you searched that next step, in server-linux-tips, you’d have found your answer

I’ve edited your tag for you to bring you back here.

Hey there,

Thanks for the reply.

I followed the instruction but when I start PMS
(systemctl daemon-reload
systemctl start plexmediaserver)

it doesn’t start and I don’t get any error as well.

However, I see that it created everything again under /var/lib/plexmediaserver

** I moved the file to another location(target Location) before running PMS. (systemctl start plexmediaserver)

Can you please tell me whats wrong here or what I’m doing wrong here?

** I stopped PMS (systemctl stop plexmediaserver) before doing the instruction.

Thanks

Show me your customization override file and the pathname you used?

(this will be a :man_facepalming: moment)

Here it is

#
# Customize Plex's config
[Service]
#Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdata/Library/Application Support"
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/www/html/fs1/data/plex/plexmediaserver/Library/Application Support"
#
#  These values are only needed if you wish to change user & group
#User=chuck
#Group=strange
User=plex
Group=plex
#
# This is needed to change the default umask 
UMask=0002    # this must be 4 digits of octal

when i installed plex first, as you know it was default location which is

**/var/lib/plexmediaserver/**

and I moved it to

**/var/www/html/fs1/data/plex/plexmediaserver**

Please lemme know if you need any more info

Thanks

To save you all the troubles.

  1. The /etc/systemd/system/plexmediaserver.service.d/override.conf file only needs to have this in it
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/www/html/fs1/data/plex/plexmediaserver"

You only need to list those things you want to change. Comments # are always helpful

  1. Given it didn’t pick up your change, lets repeat the steps to activate
sudo systemctl daemon-reload
sudo systemctl status plexmediaserver
#
# Verify you see the override listed as **Loaded** status in the systemctl output
#
sudo systemctl start plexmediaserver
1 Like

Now, the plexmediaserver is running and this is what i get when I type
systemctl status plexmediaserver

https://pastebin.com/r8nXJL47

[root@localhost ~]# systemctl status  plexmediaserver
â—Ź plexmediaserver.service - Plex Media Server for Linux
   Loaded: loaded (/usr/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/plexmediaserver.service.d
           └─override.conf
   Active: active (running) since Wed 2019-02-27 14:24:42 EST; 13min ago
  Process: 18201 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=0/SUCCESS)
 Main PID: 18205 (Plex Media Serv)
   CGroup: /system.slice/plexmediaserver.service
           └─18205 /usr/lib/plexmediaserver/Plex Media Server

Feb 27 14:24:42 localhost.localdomain systemd[1]: Starting Plex Media Server for Linux...
Feb 27 14:24:42 localhost.localdomain systemd[1]: Started Plex Media Server for Linux.
[root@localhost ~]#

But still i can’t access the server when i go to ip:32400/web/index.html

Any clue whats going on now?

Thanks

Future reference: You can use back-ticks (grave characters) to include text inline… It saves the trouble of pastebin.

```
<text>
```

Looks like this when posted (which is perfect)

<text>

run through the list of standard debug:

  1. ps -ef | grep -i plex
  2. netstat -an | grep 32400

see what we have

Here is the result

[root@localhost ~]# ps -ef | grep -i plex
plex      7071     1  0 02:17 ?        00:00:00 /usr/lib/plexmediaserver/Plex Media Server
root     20885 17324  0 02:21 pts/0    00:00:00 grep --color=auto -i plex
[root@localhost ~]# netstat -an | grep 32400
[root@localhost ~]#

Looks like nothing on 32400
and I donno why :frowning:

one thing which sill stop Plex cold is a lack of permissions:

Make certain user plex:plex sees at least r-x down to the directory plexmediaserver

From that directory on down, it must be the owner (chown -R)

sudo chown -R plex:plex /var/www/html/fs1/data/plex/plexmediaserver

Hi,

All my folders and files permission is set to root. is that a problem? Last night it was set to plex:plex, but as it wasn’t working and last working permission was root:root, I set that back to root. now I cannot even access my portal. do you think it is wise to use other user than root?

Thanks

** I donno if I should have mentioned this but when I installed PMS very first time, it was under root.

  1. All of Plex’s data files (metadata) in /var/lib/plexmediaserver are plex:plex
  2. If you change this location, they still must be plex:plex unless you change the default username Plex runs as.

Hi,

So, after changing the permission, now i tried

  1. ps -ef | grep -i plex
  2. netstat -an | grep 32400

and here is the result

[root@localhost ~]# ps -ef | grep -i plex
plex      7078     1  0 14:24 ?        00:00:02 /usr/lib/plexmediaserver/Plex Media Server
plex      7584  7078  0 14:24 ?        00:00:06 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-cc260c476/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.14.1.5488-cc260c476 /usr/lib/plexmediaserver/Resources/Plug-ins-cc260c476/System.bundle
plex      7781  7078  0 14:24 ?        00:00:00 /usr/lib/plexmediaserver/Plex DLNA Server
plex      7784  7078  0 14:24 ?        00:00:00 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.14.1.5488-cc260c476 32600 /waitmutex
plex      7828  7078  0 14:24 ?        00:00:03 Plex Plug-in [com.plexapp.agents.imdb] /usr/lib/plexmediaserver/Resources/Plug-ins-cc260c476/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.14.1.5488-cc260c476 /usr/lib/plexmediaserver/Resources/Plug-ins-cc260c476/PlexMovie.bundle
root     14833 11845  0 14:39 pts/1    00:00:00 grep --color=auto -i plex
[root@localhost ~]# netstat -an | grep 32400
tcp        0      0 0.0.0.0:32400           0.0.0.0:*               LISTEN
tcp        0      0 103.76.152.62:32400      45.56.153.246:51062     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51057     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51052     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51060     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51051     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51056     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51059     TIME_WAIT
tcp        0      0 103.76.152.62:32400      45.56.153.246:51061     TIME_WAIT
[root@localhost ~]#

Now, I can access ip:32400/web/index.html

but when I login, it says

The server "BossBD" is unreachable. Make sure it's running, double check your network, and try again.

**My Server friendly name was set to BossBD.
I should also add that my plex server is not in same network,it is in remote network

Thanks

Hi Again,

So, this is what I Just did,

I did SSH tunneling and access PMS through localhost:8888

And I could see the server.

I then went to “Remote Access”
and checked the box “Manually specify public port” with 32400 in it.

Voila, Now I can access the PMS from my PC using ip:324000

But I’m facing another issue now. All my library is gone. Its asking me to scan again for movies and tv shows.

How Do i get back my library here without scanning all over again?

I did make a backup of preferences.xml before moving the PMS

Thanks

Without knowing the exact state of your metadata and where everything is, I can’t give “copy/paste” instructions. It would require I make some time and see if we can work something out during my off hours. Might this be possible?

Sure,

Let me know your convenient time and we will try to sort it out.

Thanks a lot

@ChuckPa I’m pretty good with CentOS 7, I think I’m just missing something stupid, but when I try to create a new override file in the location of the service file, it won’t let, please tell me what I’m missing, I’m pulling my hair out, lol

Show me the override as you have it?
Then please tell me what you’re trying to achieve.

I will be happy to help.

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