Moving Plex's metadata (Library) directory on
systemd based systems
This information is intended for those systems where
cat /proc/1/comm returns
systemd. If your system returns
init, please see the next post in this thread.
While you may change
/lib/systemd/system/plexmediaserver.service, it is under the control of the package manager and subject to replacement without warning at any time during an update. To provide stability, systemd allows creation of an
override.conf file to customize and create enduring local adjustments to a distributed default package.
You can change a number of parameters about how PMS runs on your Linux system including where the metadata (Library) resides.
One of the more common needs is to relocate
/var/lib/plexmediaserver from it's default location to a SSD or where there is more space.
On systems which use Systemd (Ubuntu 16+, Fedora, Centos 7, Debian 8,) you create a customization file which SystemD reads prior to launching PMS. This file is independent of the default configuration and service control mechanisms in
/lib/systemd/system/plexmediaserver.service. The Plex-supplied service definition should not be modified as any changes are subject to overwriting at every update.
The task, with PMS stopped, is:
1. Create the 'override' file
2. Move the files to their new location
3. Change ownership if needed
4. Inform systemd of the changes
5. Start PMS
In the example below, the following will be shown. Tailor to your environment as needed
a) Run as user chuck:spacecadet
b) Move the metadata (Library) to /home/plex for the extra space
c) Relax the default file-creation permissions (for plug-ins, etc)
The following steps must be done as root, elevate first and get a full shell to work in
/etc/systemd/system/plexmediaserver.service.d/override.conf containing the following
# # Customize Plex's config [Service] Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdata/Library/Application Support" # # These values are only needed if you wish to change user & group User=chuck Group=chuck # # This is needed to change the default umask UMask=0002 # this must be 4 digits of octal
INFO: It appears some systems want Umask while others want UMask. Please be cautious of this until fully resolved and noted here.
B. Now copy the existing library. (Resolve errors before deleting the original copy of your library)
mkdir /home/plexdata cd /var/lib/plexmediaserver tar cf - ./Library | (cd /home/plexdata ; tar xf -) # this will take some time cd /home/plexdata # now change ownership cd /home/plexdata chown -R chuck:chuck.
C. Inform SystemD of the changes and test the related & reconfigured PMS
systemctl daemon-reload systemctl start plexmediaserver
D. Test your system. Verify everything is exactly as it was. If not, resolve before proceeding
E. Delete the old library in
rm -rf /var/lib/plexmediaserver/Library & # this can safely go into the background
Once you have created the override file, you can later edit it with
systemctl edit plexmediaserver
I have been attempting to use the Manual Connections feature in the Plex app and have been unsuccessful for over a month. Just the other day I logged the server out of my Plex account suddenly the App worked.
Originally the setup went: App (not logged into Plex) -> Manual Connection -> (X) NO SERVER FOUND <- PMS (logged into Plex)
The current working setup goes: App (not logged into Plex) -> Manual Connection -> PMS (Not logged into Plex)
Can any one here explain why PMS needs to be signed out of Plex in order for the app to work? Is this happening with any other users? Is this a prerequisite of Manual Connections? Or is this just me?
PMS (Win 7)
Plex (Android CM13 (L) running on HTC M8)