Plexmediaserver has filled my root partition

I’ve had Plex Media Server running on Fedora 22 for quite awhile now, and update it frequently when new versions are available. I can no longer update though because my root partition is about 100% full. From what I can tell Plex is now using /var/lib/plexmediaserver is using around 25GB of space.
Transcode is a separate disk.
Media is stored on a NAS mounted as NFS.

Why is Plex using so much space? Is there a way I can reduce the usage? Or am I stuck creating a new VM with more space (and recreating all my libraries again)?

[root@plex /]# du -m /var | sort -nr | head -30
29442 /var
25878 /var/lib
25657 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server
25657 /var/lib/plexmediaserver/Library/Application Support
25657 /var/lib/plexmediaserver/Library
25657 /var/lib/plexmediaserver
21462 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost
21462 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media
3021 /var/log
2961 /var/log/journal/2b183e7150804d51ac69ac149f5f4bcb
2961 /var/log/journal
1936 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache
1883 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache/PhotoTranscoder
1857 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Metadata
1795 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Metadata/Movies
1672 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/1
1590 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/9
1569 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/0
1510 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/b
1441 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/a
1434 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/4
1344 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/e
1332 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/2
1288 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/d
1270 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/5
1246 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/6
1224 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/f
1215 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/3
1152 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/c
1131 /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Media/localhost/7

[root@plex /]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 184K 3.9G 1% /dev/shm
tmpfs 3.9G 1.4M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 36G 34G 308M 100% /
tmpfs 3.9G 160K 3.9G 1% /tmp
/dev/sdb1 118G 2.6G 110G 3% /mnt/transcode
/dev/sda1 477M 133M 315M 30% /boot
//192.168.1.35/temp 7.0T 22G 6.9T 1% /nas/temp
192.168.1.35:mnt/VOL0/Videos 9.5T 2.6T 6.9T 27% /nas/video

Depending on whether you allowed fedora to do the default allocation or not, you got a reasonable root.
To add further insult to their frugality, if you have BIF file (chapter images) turned on, you’ve now a LOT of space in use.

It’s very easy to move all this out of /var for good and be done.

I also use Fedora. In spite of the 128 GB I allocated for root, I don’t want PMS there. It’s on /home because it’s data, not OS software.

I recommend moving it:

(as root)

systemctl stop plexmediaserver
mkdir /home/plexdir
chown plex:plex /home/plexdir
cd /var/lib/plexmediaserver
tar cf - . | (cd /home/plexdir ; tar xf -)    # This will take a while so be patient while it copies the whole thing

mkdir /etc/systemd/system/plexmediaserver.service.d    # Create an override for the service which will persist 

Using your favorite text editor (gedit is good), create /etc/systemd/system/plexmediaserver.service.d/override.conf with the following contents

[chuck@lizum /etc.109]$ cat /etc/systemd/system/plexmediaserver.service.d/override.conf 
#
#
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdir/Library/Application Support"
#
#
[chuck@lizum /etc.110]$

With the tarball copy now complete, enable the new override

systemctl daemon-reload
systemctl start plexmediaserver

Presuming no errors above (in the copy and with PMS starting), you’re now free to delete /var/lib/plexmediaserver/Library and recover the space.

2 Likes

Thanks for the help. The tar operation can’t complete though because there is not enough space. Repeated message for every folder:

tar: ./Library/Application Support/Plex Media Server/Media: Cannot mkdir: No space left on device

Can I do a mv or cp of the directory instead?

OK got things working. It appears that /home isn’t mounted as its own partition, so it doesn’t really matter if the library is in /var or /home. Maybe I should fix this in the future.

Since this is on a VM, I ended up adding another 24GB space to the disk and extending the LVM with this space. It allowed me to complete the move of the data to /home.

Restarting the service, plexmediaserver.service was stuck in an “activating” state. I then did the upgrade to the latest version and then it loaded correctly again.

The end result for disk space:
[root@plex /]# df -h
Filesystem Size Used Avail Use% Mounted on
devtmpfs 3.9G 0 3.9G 0% /dev
tmpfs 3.9G 96K 3.9G 1% /dev/shm
tmpfs 3.9G 1.2M 3.9G 1% /run
tmpfs 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/mapper/fedora-root 60G 34G 24G 60% /
tmpfs 3.9G 156K 3.9G 1% /tmp
/dev/sdb1 118G 60M 112G 1% /mnt/transcode
/dev/sda1 477M 133M 315M 30% /boot
192.168.1.35:mnt/VOL0/Videos 9.5T 2.6T 6.9T 27% /nas/video
//192.168.1.35/temp 7.0T 22G 6.9T 1% /nas/temp
tmpfs 799M 20K 799M 1% /run/user/42
tmpfs 799M 0 799M 0% /run/user/1000

@Plocmstart said:
Thanks for the help. The tar operation can’t complete though because there is not enough space. Repeated message for every folder:

tar: ./Library/Application Support/Plex Media Server/Media: Cannot mkdir: No space left on device

Can I do a mv or cp of the directory instead?

Sorry I didn’t see this until late.

Had I known you were in a VM, I’d have given different instructions.

If I may suggest; in the future build with standard partitions (/boot is 500 MB, /, and swap 4GB (?) ) and give yourself at 64-128 GB max size. It will only take what it needs when it needs it.

You can always mount the Network share on /mnt and save to it. recreate the VM with bigger space, and then pull back. This is the alternative instructions I would have given had I known.

No problem, I hadn’t mentioned it in the original post. Now that I see how I can move the library, I might end up just moving it to a NFS share in the future and create a new VM with the latest version of Fedora. Thanks again for the help.

Just want to thank you both for this thread as I ran into the same issue ChuckPA ran into. Still learning Linux so the guidance on how easy it is to move the PMS Application Support directory out of the root /var directory was key.
I found the following command useful to confirm what device it was really in, that others might find useful:
df -h /lib/plexmediaserver

Which in my default installation had landed in the “/” root directory on /dev/mapper/fedora-root (that is only 54 Gb and system complained about being full after full media library build out and TV services activation). Moved to the /dev/mapper/fedora-home device by using the exact syntax of the tar xf command Plocmstart provided (which has 190 Gb), ie /home.
Before deleting the /var/plexmediaserver directory and files off of root (after the process to migrate) I used
mv /var/plexmediaserver /var/plexmediaserver-old
then restarted pms to make sure it was not relying on this old directory for anything before deleting the files (to have an easy fallback path).
Thanks.

I tried this with a simple mv to an SSD that had some space. I did the chown -R plex:plex and chmod -R o+rwx for good measure. I was able to play tv and movies again after a reboot and sleeping on it. For a while I got a generic “transcoder error” message but could play on my android device.

Plex 1.15.1.710
Ubuntu 18.04

I have a How-To which shows how to move your Plex metadata off the root (/var/lib/plexmediaserver) directory to a space which historically is larger (/home/plexdata)

Works in conjunction with this (Allows further customizations)