Question on moving Metadata/Video Previews (and Transcode) folder from default to separate folder

Hey all,

Running into an issue here. Running Plex server on ubuntu. I went ahead and followed instructions to create an override.conf file in the /etc/systemd/system/plexmediaserver.service.d and populated it with:

Environment=“TMPDIR=/TranscoderCache”

Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/MetaData”

restarted the daemon and server and noticed that I get this error for both arguments:

/etc/systemd/system/plexmediaserver.service.d/override.conf:1: Assignment outside of section. Ignoring.

So with this, the server is running but just ignores the override.conf.

Full Status here -------------------------------------------

● plexmediaserver.service - Plex Media Server

Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; preset: enabled)

Drop-In: /etc/systemd/system/plexmediaserver.service.d

└─override.conf

Active: active (running) since Tue 2023-05-09 01:44:45 UTC; 17min ago

Process: 27765 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: 27767 (Plex Media Serv)

Tasks: 74 (limit: 9341)

Memory: 95.2M

CPU: 8.955s

CGroup: /system.slice/plexmediaserver.service

├─27767 “/usr/lib/plexmediaserver/Plex Media Server”

├─27792 “Plex Plug-in [com.plexapp.system]” /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.32.1.6999-91e1e2e2c /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/System.bundle

├─27847 “/usr/lib/plexmediaserver/Plex DLNA Server”

├─27848 “/usr/lib/plexmediaserver/Plex Tuner Service” /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tuner/Shared 1.32.1.6999-91e1e2e2c 32600

└─27897 “Plex Plug-in [com.plexapp.agents.imdb]” /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/Framework.bundle/Contents/Resources/Versions/2/Python/bootstrap.py --server-version 1.32.1.6999-91e1e2e2c /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/PlexMovie.bundle

May 09 01:44:45 plex systemd[1]: Starting plexmediaserver.service - Plex Media Server…

May 09 01:44:45 plex systemd[1]: Started plexmediaserver.service - Plex Media Server.

May 09 01:44:49 plex systemd[1]: /etc/systemd/system/plexmediaserver.service.d/override.conf:1: Assignment outside of section. Ignoring.

May 09 01:44:49 plex systemd[1]: /etc/systemd/system/plexmediaserver.service.d/override.conf:2: Assignment outside of section. Ignoring.

End -----------------------------------------------------

I also read I should add “[Service]” at the beginning of the file but when I do that, the server does not boot up, just errors until I edit the override.conf w/o it.

How do I resolve the “Assignment outside of section.” error?

Cheers,

-Marc

Please show the exact contents of override.cong
Paste it inside
```
paste here
```

It will look like:

paste here

whcih is super easy to read

Environment=“TMPDIR=/home/plex/TranscoderCache”
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plex/MetaData”

That is the entire contents of the override.conf file

You forgot

[Service]

As line 1

Then do systemctl daemon-reload

Hey ChuckPa,

I did try this before, unfortunately when adding that line to the override.conf the server refuses to start back up.

See Below----------------------------

● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: activating (auto-restart) (Result: exit-code) since Wed 2023-05-10 14:58:48 UTC; 3s ago
Process: 435193 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)
Process: 435195 ExecStart=/bin/sh -c export PLEX_MEDIA_SERVER_INFO_VENDOR=“$(grep ^NAME= /etc/os-release | awk -F= “{print $2}” | tr -d " )”; export PLEX_MEDIA_SERVER_INFO_DEVICE=“PC”; export PLEX_MEDIA_SERVER_INFO_MODEL=“$(uname -m)”; export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=“$(grep ^VERSION= /etc/os-release | awk -F= “{print $2}” | tr -d " )”; exec “/usr/lib/plexmediaserver/Plex Media Server” (code=exited, status=1/FAILURE)
Main PID: 435195 (code=exited, status=1/FAILURE)
CPU: 14ms


This is the override.conf with the changes:

[Service]
Environment=“TMPDIR=/home/plex/TranscoderCache”
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plex/MetaData”

After you moved the data, did you remember to make user plex:plex the chown -R ?

I use TMP environment variable and not TMPDIR but that shouldn’t matter.

Thank you, that seems to fix the issue with the server failing to start. now it is starting and there is no error given about the override.conf file.


● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: active (running) since Wed 2023-05-10 19:49:42 UTC; 36min ago
Process: 473291 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATI>
Main PID: 473293 (Plex Media Serv)
Tasks: 84 (limit: 9341)
Memory: 6.1G
CPU: 16min 6.475s
CGroup: /system.slice/plexmediaserver.service
├─473293 “/usr/lib/plexmediaserver/Plex Media Server”
├─473315 “Plex Plug-in [com.plexapp.system]” /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/Framework.bundle/Contents/Resources/Version>
├─473360 “/usr/lib/plexmediaserver/Plex Tuner Service” /usr/lib/plexmediaserver/Resources/Tuner/Private /usr/lib/plexmediaserver/Resources/Tun>
├─473387 “Plex Plug-in [tv.plex.agents.music]” /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/Framework.bundle/Contents/Resources/Versi>
├─474116 “Plex Plug-in [com.plexapp.agents.none]” /usr/lib/plexmediaserver/Resources/Plug-ins-91e1e2e2c/Framework.bundle/Contents/Resources/Ve>
└─474565 “/usr/lib/plexmediaserver/Plex DLNA Server”


The issue I see now is that I put in some test videos into the library and I see that the metadata and thumbnails are not showing up in the new /MetaData folder and /TranscoderCache (did separate test for this)

Where are these files being stored if it is not using the override.conf correctly?

May I have the logs ZIP file please ?

Also, are you wanting to move the entire temp dir or just the transcoder temp dir (which you set in settings → server - Transcoder → show advanced)

Plex Media Server Logs_2023-05-10_21-16-40.zip (624.9 KB)

Here you go. The goal of both these settings is to have my ubuntu image (VM hosted on TrueNas Scale) to be lean and not blow up. Having these directories outside of the VM will make it easier to manage when more and more videos are added to the platform.

These two directories are located on my NAS and are mounted to the ubuntu server at startup.

Here are the mounted directories showing up on the server as well

I’ve been thinking about how to do this.

The conclusion I’ve come to: “Sometimes we just have to cheat” :slight_smile:
Read through twice to understand the process. Draw it out if you need to.
Ask if still not clear.

  1. With the directories mounted and PMS stopped
  2. Get into the command line
  3. Delete /home/plex/TranscoderCache and /home/plex/Metadata
sudo bash
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server"

# Now we're were we need to be

# Move the contents of "Metadata" to the mounted directory  (might take time)
mv  Metadata /home/plex

# Create the first cheat  (symlink the Metadata directory -- whole thing -- back here)
ln -s /home/plex/Metadata .


# Next move the transcoder cache  (should be empty)
cd Cache

# Move the entire Transcode directory  (it will create the directory)
mv Transcode /home/plex

# Create the symlink
ln -s /home/plex/Transcode  .

# Move the entire PhotoTranscoder directory
mv PhotoTranscoder /home/plex

# Create the symlink
ln -s /home/plex/PhotoTranscoder .

What this does is move those 3 directories out to /home/plex and then creates a link for each back from under the Plex directory to where they exist in the default directory tree.

I understand, I just completed this:

But the server does not wish to start back up again.


× plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; preset: enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: failed (Result: core-dump) since Wed 2023-05-10 23:18:08 UTC; 4min 11s ago
Duration: 90ms
Process: 1125 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUP>
Process: 1127 ExecStart=/bin/sh -c export PLEX_MEDIA_SERVER_INFO_VENDOR=”$(grep ^NAME= /etc/os-release | awk -F= “{print $2}” | tr -d " )"; export PLEX>
Main PID: 1127 (code=dumped, signal=ABRT)
CPU: 48ms

May 10 23:18:08 plex systemd[1]: plexmediaserver.service: Scheduled restart job, restart counter is at 3.
May 10 23:18:08 plex systemd[1]: Stopped plexmediaserver.service - Plex Media Server.
May 10 23:18:08 plex systemd[1]: plexmediaserver.service: Start request repeated too quickly.
May 10 23:18:08 plex systemd[1]: plexmediaserver.service: Failed with result ‘core-dump’.
May 10 23:18:08 plex systemd[1]: Failed to start plexmediaserver.service - Plex Media Server.


Also, PMS seems to be recreating the “MetaData” folder again in the home/plex directory when it is trying to spool up.

This folder only seems to appear after trying to start the server. Did some tests and it keeps showing up after it’s trying/failing to come back up.

For directories you created, are they owned by plex:plex ?
does /home have 755 permission ?
Is /home/plex owned by plex:plex ?

Yes, I also made sure and ran: sudo chown -R plex:plex on all the new directories as well as /home/plex.

Also made sure and ran: sudo chmod 755 /home. Same issue occurs after these tests.

Now… outside the VM, when you look at the UID/GID, do they map correctly ?
did you take care of the permissions on the base file system (perms and ACLs) ?

Yes, I do think so.

permissions should be in line with plex being the owner, unless I am missing something

Can’t help with TrueNAS. I don’t know it (more than I have time for)

I see, but from what you gather from the error, you see that this is a permission issue somewhere in the file directory?

Yes, with PMS not able to start, the fundamental access to the PMS directories is blocked.

If it can’t open what exists (if it can even see it)
and it can’t create new

– game over