Synology Server (only running Plex) has filled up TBs of space and I can't figure out how to fix

Craig,

Now it’s time to cheat. :slight_smile:

Using Windows,

get into PlexMediaServer/AppData/tmp

Highlight (select) everything in tmp and delete it all.

That should be quicker than waiting for FileStation to get the list of files

If you still need something more high-powered, I will craft it for you to run in Task Scheduler.

I like hammers. I call it “percussive maintenance”.

Doing this.

I’m up to 11GB free with a lot of folders to go. At this rate it won’t be done by morning.

Even so, it’s still far off from the 3TB i’m missing, but we’ll jump off that bridge when we get to it.

Thanks and good night.

Craig.

May I introduce you to Percussive Maintenance 101 :hammer: lol

General tab

  1. Control Panel - Task Scheduler - User-script
  2. Runs as username ‘root’ (select it in the dropdown)
  3. Not enabled (you don’t want it running all the time

Task Settings tab

  1. Send run details to your email address
  2. Paste the text below into the box

#!/bin/bash

# Go to the PlexMediaServer shared folder
cd /var/packages/PlexMediaServer/shares/PlexMediaServer

# Go down further into AppData
cd AppData

# Make certain Plex is stopped
/usr/syno/bin/synopkg stop PlexMediaServer

# Remove the tmp directory then recreate it
rm -rf tmp
mkdir tmp
chown PlexMediaServer:PlexMediaServer tmp

# Now into "Plex Media Server" for more
cd "Plex Media Server"

# Let's clean up the Cache
cd Cache
rm -rf PhotoTranscoder
mkdir PhotoTranscoder
chown PlexMediaServer:PlexMediaServer PhotoTranscoder

To use:

  1. Save the task after you’ve defined it
  2. Highlight it but do not Enable (the checkbox)
  3. Click “Run” and confirm to run it
  4. Watch your email for completion report.

If you’re still missing space, We’ll make arrangements to figure it out.
Something nasty is afoot in there.

1 Like

Sorry to be late getting to this, but it was too late to try to do it last night and I had stuff to take care of this morning.

In the meantime I was still running the delete effort from File Manager. It got up to almost 500,000 files and had freed up 18GB when I stopped it.

Having never done anything with user scripts before, your instructions were very well written and easy to follow and the script makes sense (I’ll assume it’s “right”).

It is now running and I will let you know what comes from it.

Any idea how long this will take? I don’t really care, but I want to be able to manage my own expectations.

Thanks.

Craig

@craig_camelio_gmail_com

26 minutes into it now and you should be (almost) done.

What does free space look like?

Up to almost 32GB. Always better, but still a long way off.

honestly curious what happened here. did you have a 3tb plexmediaserver folder?

Sorry. I wanted to wait until it was “done”, but I’d say we’re going in the right direction.

Started using Chuck’s script around 2pm Friday. Four days later it is still running, but I now show 2.1TB free. Yay!

Thank you again for all the help. Not done yet, but I’m hoping another couple of days will have things cleaned up (it’s the tmp folder in PMS).

Craig.

thats a little crazy its taking that long to delete data but interesting none the less.

On Synology, with its software RAID, file deletion can be very slow especially when there are TB of tiny files. 1TB / 1KB each would be 1 billion files.

The btrfs support blocks and structure to track 1 billion files alone is substantial.

Add to this – Synology physical disk i/o is not the fastest on a 2 bay NAS.

This WILL take time.

@craig_camelio_gmail_com

Good to hear it’s still cleaning up and going well for you.

@craig_camelio_gmail_com

How you making out there?

Has it finished cleaning up?

Still chugging along. 2.4TB free. I’m just letting it run.

Thanks,

Craig.

Wanted to provide a (hopefully) final update on this topic.

It finally finished. Took 9.5 days and I went from 0 free space, to almost 4TB (3.96 to be exact).

I’ve restarted Plex and it seems to be working (will probably take a while to replace the true files from the tmp directory (which were deleted along with the tens of millions of unneeded files). Hopefully this version of Plex will stop when done and then clean up after itself - I’ll be watching closely.

Again, thank you to Chuck, DJ and everyone else who provided input. Very appreciated. Would not have been able to do it without the support.

Craig.

you may want to ask @ChuckPa if there is anything else you should do. i’d assume you may need to repair your database or something. Whatever was causing it to write to that directory constantly may not have been fixed just by deleting the directory.

This was a problem in the software not cleaning up after itself.

It’s purportedly fixed.

If ANYONE Is finding it not cleaning up after itself, I will take my :gun: and talk to folks

:slight_smile:

Is there anything we can look for to be able to tell if things haven’t been cleaned up as they should have been?

I am looking through the work history.

Unfortunately, the Credit Detection work hasn’t been completed yet.
(due to our recent reorg)

It is being worked on; just not release status yet.

The only quasi-viable workaround I can offer is a Scheduled Task job to delete the JPG/JPEG files from TMP nightly.

1 Like

Apologies for looping back onto this old post/topic - I checked the /tmp folder before and its was tiny (40MB?), but I never looked at the Transcode or PhotoTranscoder folders in Cache - I must have skimmed over this post previously.

Right now, for me, Transcode is empty (0 files, 2 folders), however PhotoTranscoder is somewhat large at 2.42GB (11933 files, 265 folders). Certainly when compared to the entire PlexMediaServer/AppData folder which stands at 7.64GB (39,337 files, 30259 folders), PhotoTranscoder is a hefty proportion.

Is that ‘OK’?

I also note that the files within the PhotoTranscoder sub-folders all seem to have modified dates within the last month.

That’s ok but keep an eye on it…

phototranscoder is what holds the posters for the apps.
(main poster is downloaded then resized as needed for each app / display)

Great - thanks!