PlexData share for QNAP systems

Introduction

We’ve made a change which will make administering PMS easier on QNAP systems without interfering with QNAP’s philosophy and functionality in any way.

This functionality is available as of PMS 1.19.5 and higher versions.

Primary goals were:

  1. Ability to backup and restore your Plex installation (metadata) without use of the command line.

  2. Allow easy access to log files and plug-ins when PMS isn’t operating.

  3. Improve feedback to you (the admin) about PMS’s operational state as well as improving package management feedback in both the Event Notifications window and the system log.

  4. Incorporate the functionality of PMSLibShare and have it track through “migrate to” relocation of the volume PMS is installed on to facilitate access to Plug-ins & Logs from File Station at all times. (PMSLibShare functionality)

How it works:

  1. If the PlexData share exists then PMS uses it to link FileStation to where the actual package data (your metadata) is stored inside QTS/QuTS. This PlexData shared folder only uses 4K bytes of disk space. (it is only a placeholder)

  2. It creates a linkage named “Plex Media Server” , in the PlexData share, which directly connects to the directory in /share/_installation_volume/.qpkg/PlexMediaServer/Library

  3. Whenever you use QNAP’s “Migrate To” function, the link will be updated the next time PMS is started.

  4. You access via File Station, just as you would for any shared folder on QNAP.
    a. This is how you make backups of your installation / metadata or restore.
    b. You have direct access to your Preferences.xml for those special cases as they might arise.

  5. Should you decide to remove PMS from the NAS, you can freely delete the shared folder as well.

This feature will deprecate the need for PMSLibShare. PMSLibShare would break if you moved PMS to another volume. I’ve worked closely with Dane22 (author of PMSLibShare during the development of this update)

UPDATE: 27-Jun-2020

After working through a few issues, we’ve resolved and settled on:

  1. When the PlexData share is created, it will not have any sharing permissions
    a. It will not be visible to any user except an administrator in Control Panel.
    b. It will not be shared to the LAN

  2. To make the share accessible in File Station, grant permission in Control Panel - Shared Folders for the selected user(s)

  3. To make the share accessible over the LAN, enable SMB access in Control Panel - Shared Folders - SMB/CIFS

11 Likes

Go to Shared Folders and set the permissions.

I set the share as readable and writable by username admin.

You will have to enable sharing of the folder as you do for any shared folder.

In the screenshot below, you will see where I’ve compromised my shared folder permissions. Ignore the first one.

Please do notice, the default permissions are to deny anyone not listed.

On my screen, I can’t change the permission for the shared folder.

Do I have to do it from stopped plex server ?.

You can do it another way too:

  1. Stop Plex
  2. Delete the PlexData share
  3. Now create the PlexData share the way you want it created.
  4. Start Plex.

I don’t understand why QTS is not allowing you to change the permissions but I can.

My default is to make it so only user admin has access because of the personal information (Email address) and Plex Token in the share.

When PMS starts, all I care is that the share exists. I will use it wherever I find it.

2 Likes

@ChuckPa thanks for your continued contributions for a great Plex experience on QNAP

Does this change mean that installing a NVMe and using “migrate to” on the Plex app is now basically a one-step operation?

Keith,
Yes. You no longer need worry about where you’ve migrated PMS to. I handle it.
Your common access point is PlexData/Plex Media Server in FileStation or /share/PlexData/Plex Media Server in the shell.

The only action which must occur is; After migrating, PMS must start / attempt to start one time. This is because I update the linkage every time QTS tells it to start.

I only somewhat follow this, but very soon I’m getting a QNAP to move my PMS off my primary (linux mint) desktop. Where can I get info on the recommended setup for PMS on QNAP (specifically, the TS-453d)? I figured I would have to copy over all of the files, setup the QNAP PMS as a completely new PMS on our network, then “delete” the old one. This would re-index everything and all of my custom artwork and metadata would have to be rebuilt. It’s a pain; but I expected to do it for the long-term benefit. Does this change for QNAP mean I could somehow avoid this hassle?

@thompsondc

This “feature” gives access to the metadata storage via File Station.
Specifically, you now have access to the “Plex Media Server” directory and everything below it.

What you can do with this is:

  1. Backup your existing PMS system without using the command line
  2. Restore a backup copy
  3. Transport a PMS installation (created elsewhere) to QNAP.

If transporting a PMS installation from another installation, the only special consideration to address is the disparity of where media is stored (different directory names).

The process of moving PMS from one system with a particular directory structure to another (Linux - Linux) involves two tasks:

  1. Move install to another system (which “Library” settings to turn off before the move)
  2. Move content to a new location (How to add the new location where the media is before removing the old location – to preserve existing metadata & watch history).

Unfortunately I continue to have problems accessing the PlexData folder, it just doesn’t make me change anything. i also tried to stop plex media server. I don’t understand why the folder isn’t in Vol1

what are you trying to do with it?

When I create the shared folder (which really doesn’t hold any data), I create it on the same volume as PMS is installed on. I do this because QNAP can install on a wide variety of volume naming rules (not everyone is DataVol1 / CACHEDEV1_DATA). I allow QNAP to tell me what it has done. I use that information to create the share.

As I stated above, if the PlexData share already exists (you delete what I’ve created and then create as you wish), I will use it.

Thanks, everything works now. (stopped plex, deleted the folder PlexData, created a folder PlexData started plex and inside it automatically came out the folder plex media server. top!

I’m not sure if this is expected behaviour, but after the first start when Plex creates the PlexData share, on subsequent restarts I get an error: ‘ERROR: Could not create PlexData share. Further assistance is available in our Support Forums. Continuing without.’
If I delete the PlexData share and restart Plex the error doesn’t appear, so Plex doesn’t appear to check if the PlexData share exists before trying to create it. What’s wrong? Is anything wrong? What can I do to prevent this error from being logged?

I had the same problem, and the same solution. I wonder if it’s because the PlexData share apparently doesn’t have a “Volume” at all. (see your screenshot, Volume column)

James

Sorry I didn’t see this until now.

  1. I do check for the existence of a PlexData share anywhere on the system by looking in /share in both the installation script and the PMS start script.
  2. If I do not find one, I attempt to create one on the same volume (pool) PMS is installed on.
  3. If that fails, which it never should, I report it and proceed without it. The only case it might fail, which I’m not sure how, is if there is a shared folder exists but QTS hasn’t listed it in /share (QTS inconsistency)
  4. I then create the linkage between the QPKG directory and that PlexData share. All of this is independent of the volume it’s on and does track as you “Migrate” the Plex app to a new volume.
  5. If, at any point, you don’t like the default permissions I assign to the share or where I placed it, you’re free to make your own. I will use whatever you’ve created.

Since this is the launch of this feature, Please do tell me if I’ve overlooked something.

It appears that sometimes when you (a script on Plex stsrtup?) make the share, you do not successfully create it with the correct volume (see screen shot above, which also reflects what happened to me). I’m not sure how or why, or what actually happens, but see screen shot for some anecdotal evidence.

For me, the share was listed as above but could not be edited, or browsed. I only sorted this by deleting the share, and recreating.

James,
I don’t see how that’s possible but do see what you have there.

I do set the share so only user admin has access. If QTS isn’t allowing you to edit it for looser permissions, that is on QTS. You have personal info in Plex. I am taking the position of ensuring I don’t expose any data you don’t want exposed to others.

I expressly keep security tight because I do not know if other users are using the NAS and the QTS interface (qcli_storage) is very awkward to use and would require the scripts have your admin password (which would require a pop-up window) to operate like the web gui.

    # Verify PlexData share exists. Quick recreate if not.
    PlexDataDir="$(find /share -maxdepth 1 -print | sort | grep '/PlexData$' | head -1)"

    # Add if not found
    if [ "$PlexDataDir" = "" ]; then

      # It does not,  Create it
      PlexPkgVolume="$(echo ${QPKG_DIR} | cut -d/ -f 1-3)"
      PlexDataDir="$PlexPkgVolume/PlexData"

      addshare "PlexData" "$PlexDataDir" -ur:admin -uw:admin

      # Creation error? (should not happen)
      if [ $? -ne 0 ]; then

        logMsg="ERROR:  Could not create PlexData share.  Further assistance is available in our Support Forums. Continuing without."
        echo $logMsg ; /sbin/log_tool -t 2 -a "$logMsg"

        # We can't use this location
        PlexData=""
      fi
    fi

    # If PlexData still valid, use and update link for File Station.
    if [ "$PlexDataDir" != "" ]; then
      rm -f "$PlexDataDir/Plex Media Server"
      ln -s "${QPKG_DIR}/Library/Plex Media Server" "$PlexDataDir/Plex Media Server"
    fi
  1. Search for “PlexData” in /share
  2. If it’s not there,
    a. set PlexPkgVolume to the volume PMS is installed on
    b. set PlexDataDir to $PlexPkgVolume/PlexData
    c. addshare PlexData $PlexPkgVolume/PlexData (this way)
[~] # addshare  PD2 /share/CACHEDEV2_DATA/PD2
[~] # ls -la /share/CACHEDEV2_DATA/PD2
total 8
drwxrwxrwx  2 admin administrators 4096 2020-07-19 01:29 ./
drwxrwxrwx 85 admin administrators 4096 2020-07-19 01:29 ../
[~] # 
  1. Test again to see if $PlexDataDir is present.
    a. If so, remove the old linkage
    b. Create the new linkage.

What are your volume names. I developed and tested using /share/CACHEDEVx_DATA structures with volumes exported via NFS.

What do you have ? /share/MD0_DATA ?

Interesting - this might be because i do not use the “admin” user, I have another user name with admin permissions (admin group). I invariably log in with the other user (and admin account is often, but not always disabled*), so I probably couldn’t see the share “properly” with the “other” user.

James

*sometimes I have to use the admin account for certain things so I re-enable it, do something, and then disable it again.

James,
Being in the ‘admin’ group doesn’t carry enough privilege in how I’ve configured it and how QTS allows me to specify permissions.

QTS doesn’t really implement GID (or even UID for that matter) in everything internally.

Specifically, I must state which user(s) have read and which have read/write.
The only way I could setup the share permission as you do in the UI is to have a “session token” . To obtain one would require an interactive password session (popup) each time – which isn’t practical.