Tackling the PhotoTranscoder cache problem

Server Version#: 1.30.1.6562
Player Version#: N/A
Using Debian 11
Not using any ‘video thumbnails’ option.

So we all know that the PhotoTranscoder folder can get big and Plex empties it every week I believe but… to save wear and tear on my SSD, I decided to create a symlink for it on a platter drive. I have a 2TB platter drive mounted at /mnt/2tbspare. So I created /mnt/2tbspare/PhotoTransCoder and gave the ‘plex’ user account full control of that folder. Then, I issued this command:

sudo ln -s /mnt/2tbspare/PhotoTranscoder/ /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Cache/PhotoTranscoder/

I went into the /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/PhotoTranscoder folder and typed:

find . -type l -ls
  4331600      0 lrwxrwxrwx   1 root     root           30 Jan 13 18:05 ./PhotoTranscoder -> /mnt/2tbspare/PhotoTranscoder/

… the symlink was created.

I restarted the Plex service:

sudo systemctl restart plexmediaserver

…but the symlinked /mnt/2tbspare/PhotoTransCoder folder remains empty. Did I do something wrong?

Poking around on reddit, somebody went nuclear and chmod 000’d their …/Library/Application Support/Plex Media Server/Cache/PhotoTranscoder/ folder.

Before I attempt that, is there some horrible consequences for doing so?

Bump.

Plex devs, I guess a simple answer will suffice… will chmod’ing that folder break Plex? If the only drawback is end users having to wait a few seconds for cover art to download if I chmod 000 that folder, I’m willing to do it.

chmod 000 will result in errors streaming into the logs.

Since PMS will regenerate the image if not found in cache,
a safer check is to symlink to /dev/null

To try this:

  1. stop pms
  2. Rename the directory
  3. create the symlink
  4. start & test

Thanks for the reply :slight_smile:

I stopped PMS and renamed the dir but when I went to create the symlink, it complained because the /PhotoTransCoder directory no longer existed. I put the old name back, created the symlink to /dev/null this time and started Plex back up but the PhotoTranscoder folder is still being populated with data. :frowning:

I think I’m just going to chmod 000 that folder. If I never need to upload logs, I’ll try and remember to switch it back to 755.

If the only problem this creates is filling up the log file with errors -and- PMS needing to regenerate images (so long as it doesn’t take forever) every time my friends or I browse a library, I can live with that.

After chmod’ing that folder to 000, I noticed something different. All my movie collections now just have a grey box. If I go into a collection, everything displays perfectly… just the main box for the entire collection is grey. Going to see if I can re-create it and make it ‘sticks’ but I’m guessing it won’t.

If you’re done playing around :smiling_imp:

  1. Create directory on HDD somewhere, entire plex:plex has privileges
  2. stop PMS
  3. make a tar ball of the contents of Cache somewhere
  4. In /etc/fstab, add

/var/lib/plexmediaserver/Library/Application\040Support/Plex\040Media\040Server/Cache /HDD/PATH/HERE  none bind 0 0
  1. Mount it.
  2. Extract the tarball contents into the new HDD-based Cache dir.

It looks like this in use:

[chuck@lizum script.2022]$ cd /mnt2
[chuck@lizum mnt2.2023]$ ls -la
total 64
drwxr-xr-x  6 plex plex  4096 Oct 18 20:08 ./
drwxr-xr-x 32 root root  4096 Nov 12 21:30 ../
-rw-r--r--  1 plex plex  9142 Oct 18 20:05 autotag_wordlist.json
-rw-r--r--  1 plex plex  5753 Oct 18 20:08 cert-v2.p12
drwxr-xr-x  2 plex plex    21 Oct 18 20:05 CL-ICDs/
-rw-r--r--  1 plex plex  2736 Oct 18 20:07 CloudAccessV2.dat
-rw-r--r--  1 plex plex    64 Oct 18 20:07 CloudUsersSubscriptionsV2.dat
-rw-r--r--  1 plex plex    64 Oct 18 20:07 CloudUsersV2.dat
-rw-r--r--  1 plex plex 11952 Oct 18 20:07 Flags.dat
drwxr-xr-x  2 plex plex    22 Oct 18 20:08 OCSP/
drwxr-xr-x  2 plex plex     6 Oct 18 20:05 PhotoTranscoder/
-rw-r--r--  1 plex plex  7696 Oct 18 20:07 Privacy.dat
drwxr-xr-x  3 plex plex    22 Oct 18 20:05 Transcode/
-rw-r--r--  1 plex plex   576 Oct 18 20:07 UpdateChannels.dat
[chuck@lizum mnt2.2024]$

Now you have a legitimate mount,
All permissions maintained.
All isdir() tests result in true.

Only a bind mount (e.g. mount --bind) works in these cases.
Bind mounts are how countainers and snaps map themselves to the base filesystem.

see man mount, search for ‘bind’ , for details.

Thank you very much for the detailed info! I’ll give this a shot tomorrow night or this weekend.

Bonus question: You can specify a temp transcoder directory from within PMS… is being able to -easily- :slight_smile: specify a PhotoTransCoder folder on the roadmap for a future server update?

Use TMPDIR in a systemd override.conf file ( BIG HAMMER :smiley: )

The only other user-facing is transcoder temp dir (I have 256GB so don’t get any ideas haha)

No idea about Roadmap. They don’t tell me such things.
I can only suggest up-voting a Feature Suggestion

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