Moving PMS 'Library'

Moving Plex’s metadata (Library) directory on init based systems

This procedure is intended for those whose systems are init based (cat /proc/1/comm returns init).

Perform the following sequence in a root shell and with PMS stopped

sudo sh

A. Create the new location to hold the Plex Library

In this example, I show you how to use /home/plexdata. It can be any valid filesystem on your computer. The only restriction is it may not be a network file system (remote mount). This is because the database requires file locking. File locking is not supported by most network share protocols.

mkdir  /home/plexdata

B. Now copy the existing library. (Resolve errors before deleting the original copy of your library)

cd /var/lib/plexmediaserver
tar cf - ./Library | (cd /home/plexdata ; tar xf -)   # this will take some time
cd /home/plexdata

C. Change ownership to plex

chown plex:plex /home/plexdata

D. Add the following entry to /etc/fstab which will ‘bind’ (overlay) the new location on top of /var/lib/plexmediaserver/Library

/home/plexdata/Library    /var/lib/plexmediaserver/Library         none  bind 0 0

E. Test the mount

mount /var/lib/plexmediaserver/Library
touch /var/lib/plexmediaserver/Library/dummy
umount /home/plexdata

F. Verify the dummy file only exists in the new location (/home/plexdata/Library)

ls /home/plexdata/Library
ls /var/lib/plexmediaserver/Library

G. Verify normal PMS operation with the mount active

mount /var/lib/plexmediaserver/Library

Start PMS

H. With Verification complete

  1. Stop PMS
  2. umount /home/plexdata
  3. rm -rf /var/lib/plexmediaserver/Library/* (Library must remain but remove all below it)
  4. mount /home/plexdata
  5. Start PMS

I. All metadata will now be stored in /home/plexdata

5 Likes