November 25, 20241 yr Forgive me if this has been asked, but I did a pretty extensive search and couldn't find this specific answer. Backstory, Unraid is my first NAS and certainly my first run in with Linux file systems so I am still very green behind the ears. Prior to this my Plex Server was running on a Windows system and on a striped configuration too. A ticking timebomb if you will. My setup before was very simple. I had a Movie Directory, a Temp Movie directory and a TV Shows Directory. With those last two, I often would use the delete option within Plex to remove media I no longer wanted. This action could be performed from anywhere I was using Plex, my phone, one of my two FireTV's or the official Plex windows app. This would then delete the files from my HDD's on my Windows Server. Now with my Unraid NAS setup, Plex is the only Docker I have up and running. I have the same 3 media folders and 2 temp/cache directories mainly for Radarr/Sonarr (may need help with those in another topic). I only recently noticed after 5 months of running my new Unraid server that the files I delete from within Plex, are removing them only from the app, but my NAS file system stills holds them. What is even more confusing (to me) is even when I run a library sync it won't re-read those files that still live on the server. So I assume Plex takes my original delete media option and just doesn't allow it to be readded to the Plex server. So, how can I set up Plex Docker to actually remove the files off my HDD pool when I select delete from the app(s)? Thank you in advance for any assistance you can lend me.
November 25, 20241 yr Community Expert the resync is because you told the database within plex to remove the file. there are other options to enable plex remove form disk. to remove and set up a resync you may need to use a smb share and delete the physical file. which plex docker? unraid official ? binhex ? linux io? Please post a diag file. FYI Fighting plex database issues is a pain it is often easier to rerun a plex new setup with a different cliam id key.. I know of them but don't use them a separate post would be best for issues and integration with Radarr/Sonarr I personally use linuxIO version. so let go over some basisc and troubleshooitng: The behavior you're experiencing is a common scenario for users who are new to running Plex in a Docker container on Unraid. By default, the Plex Docker container might not have sufficient permissions to delete media files from the host system. Here's a step-by-step guide to resolve this issue and allow Plex to delete files from your Unraid NAS: Check Plex Container Permissions Docker containers operate in isolated environments, and Plex's ability to interact with your file system depends on the PUID (user ID) and PGID (group ID) set for the container. Go to the Docker tab in the Unraid web UI. Click Edit on your Plex container. Locate the fields for PUID and PGID. Match these values to a user on your Unraid server who has write permissions for your media shares: Default Unraid root user: PUID=0 and PGID=0 (not recommended for security reasons). For better practice, create a dedicated user with appropriate permissions for managing Plex and media. add theses or update them to use these docker variable: Ensure Proper Permissions on Media Folders The Plex container must have the correct permissions to delete files from your media shares. Navigate to the Shares tab in Unraid. Select the share where your media files are stored. Set "Export" to Yes and "Security" to Private. Assign read/write permissions for the user account Plex is using. Alternatively, you can reset permissions for the entire share using the "New Permissions" tool: Go to the Tools tab in Unraid. Select New Permissions. Choose the share where your media files are stored. Run the tool to ensure files are accessible. *Tool > docker safe permission cd /mnt/user/path to pled media chmod 777 -R * chown -R nobody:users * Verify Media Folder Bind Mounts in Plex Docker The way media folders are mounted into the Plex container affects whether Plex can delete files. Go to the Docker tab in Unraid. Edit your Plex container. Check the volume mappings for your media folders:Example: Host Path: /mnt/user/Movies Container Path: /movies Ensure the Plex container has rw (read/write) permissions, not just ro (read-only). docker >console: cd /path inside docker #test read write touch test.txt echo hi >> test.txt cat test.txt rm test.txt *this can help confim when in the container that you have ready write access *As said earlier you may not have the option fully enabled: Enable "Allow Media Deletion" in Plex By default, Plex disables media deletion to prevent accidental file loss. Open the Plex Web App. Go to Settings → Library. Enable the option "Allow media deletion". Save the changes. Test Media Deletion from Plex Open Plex on your preferred device. Locate a media item you want to delete. Use the delete option in Plex and confirm. Check your Unraid share to ensure the file is removed. Deleting form database not plex couil;d be in the trashcan: Bonus: Why Deleted Files Don't Reappear After Sync When you delete files from Plex, it adds them to an "ignored items" list. This prevents Plex from re-scanning and adding the same files back, even if they still exist in your storage. To force Plex to re-scan: In the Plex Web UI, go to the relevant library. Select Manage → Advanced → Empty Trash. Run a full library scan.
November 26, 20241 yr Author 16 hours ago, bmartino1 said: the resync is because you told the database within plex to remove the file. there are other options to enable plex remove form disk. to remove and set up a resync you may need to use a smb share and delete the physical file. which plex docker? unraid official ? binhex ? linux io? Please post a diag file. FYI Fighting plex database issues is a pain it is often easier to rerun a plex new setup with a different cliam id key.. I know of them but don't use them a separate post would be best for issues and integration with Radarr/Sonarr I personally use linuxIO version. so let go over some basisc and troubleshooitng: The behavior you're experiencing is a common scenario for users who are new to running Plex in a Docker container on Unraid. By default, the Plex Docker container might not have sufficient permissions to delete media files from the host system. Here's a step-by-step guide to resolve this issue and allow Plex to delete files from your Unraid NAS: Check Plex Container Permissions Docker containers operate in isolated environments, and Plex's ability to interact with your file system depends on the PUID (user ID) and PGID (group ID) set for the container. Go to the Docker tab in the Unraid web UI. Click Edit on your Plex container. Locate the fields for PUID and PGID. Match these values to a user on your Unraid server who has write permissions for your media shares: Default Unraid root user: PUID=0 and PGID=0 (not recommended for security reasons). For better practice, create a dedicated user with appropriate permissions for managing Plex and media. add theses or update them to use these docker variable: Ensure Proper Permissions on Media Folders The Plex container must have the correct permissions to delete files from your media shares. Navigate to the Shares tab in Unraid. Select the share where your media files are stored. Set "Export" to Yes and "Security" to Private. Assign read/write permissions for the user account Plex is using. Alternatively, you can reset permissions for the entire share using the "New Permissions" tool: Go to the Tools tab in Unraid. Select New Permissions. Choose the share where your media files are stored. Run the tool to ensure files are accessible. *Tool > docker safe permission cd /mnt/user/path to pled media chmod 777 -R * chown -R nobody:users * Verify Media Folder Bind Mounts in Plex Docker The way media folders are mounted into the Plex container affects whether Plex can delete files. Go to the Docker tab in Unraid. Edit your Plex container. Check the volume mappings for your media folders:Example: Host Path: /mnt/user/Movies Container Path: /movies Ensure the Plex container has rw (read/write) permissions, not just ro (read-only). docker >console: cd /path inside docker #test read write touch test.txt echo hi >> test.txt cat test.txt rm test.txt *this can help confim when in the container that you have ready write access *As said earlier you may not have the option fully enabled: Enable "Allow Media Deletion" in Plex By default, Plex disables media deletion to prevent accidental file loss. Open the Plex Web App. Go to Settings → Library. Enable the option "Allow media deletion". Save the changes. Test Media Deletion from Plex Open Plex on your preferred device. Locate a media item you want to delete. Use the delete option in Plex and confirm. Check your Unraid share to ensure the file is removed. Deleting form database not plex couil;d be in the trashcan: Bonus: Why Deleted Files Don't Reappear After Sync When you delete files from Plex, it adds them to an "ignored items" list. This prevents Plex from re-scanning and adding the same files back, even if they still exist in your storage. To force Plex to re-scan: In the Plex Web UI, go to the relevant library. Select Manage → Advanced → Empty Trash. Run a full library scan. Wow, great info. I will hopefully be able to check all this tonight. As for which Plex docker I am running, I am running the lscr.io/linuxserver/plex version.
November 26, 20241 yr Author I gave up. One thing I have learned when it comes to the world of Linux, is I feel there is some secret society that existed somewhere that I was never a part of and when I do research on stuff and detail I have no background on Linux file systems the help I get is written as if I should know what that person is talking about. Unfortunately for me, this is one of those moments. I will keep searching and hope I can figure it out. Maybe I'll just forgo the Unraid NAS and just go back to a Windows file system. Easy-peasy.
November 26, 20241 yr Community Expert review: Yes, this is what happens when an open community is left unchecked with open-source software. LOL! Many conspiracy theories about the Linux kernel. I use the lscr.io/linuxserver/plex one as well. As mentioned earlier, you may need to restart the entire Plex Docker due to database issues. You lose disk security and ease of management by going with Windows. Plex is not as robust with features as it is on Linux, and Sonarr/Radarr are actually easier to set up on Linux than on Windows. https://dev.to/rafaelmagalhaes/home-media-server-with-plex-sonarr-radarr-qbitorrent-and-overseerr-2a84 Kidding—I'd recommend Arch! Maybe Debian... LOL! If you decide to continue using Unraid, to move forward, I would recommend deleting the image (this will not delete any current media on the disks). but this will restart any current plex media library.... Web UI > Dockers: click add container: template drop down: hit the x: this removes unraid side stuff... now we need to delete the appdata folder to reinstall and start over: so we open terminal #you can typ mc and use mc to as well cd /mnt/user/appdata #list file in folder ls #delete folder with files in it: rm -rf /mnt/user/appdata/plex with this gone we are ready for a default install: install: unraid template: *My unraid usise macvlan unriad new default is ipvlan. I have heavily edited my template... advance togle: Extra parmerter: -p 32410:32410/udp -p 32412:32412/udp -p 32413:32413/udp -p 32414:32414/udp --mac-address 02:42:c0:a8:02:05 --hostname PLEX-DOCKER --device=/dev/dvb/ *These are the ports plex uses and needs, macvlan static asign a mac. a host name and aditional usb tuner device. next give it a static ip! set a path: in this case in plex /data is my unriads /mnt/user path *You can keep your old plex claim its best to start fresh to not get any metadata: Container Variable: PLEX_CLAIM Optionally you can obtain a claim token from https://plex.tv/claim and input here. Keep in mind that the claim tokens expire within 4 minutes. if you show more setting you wil see that linux IO has already addded the puid/pguid/umask: Edited November 26, 20241 yr by bmartino1 data
November 26, 20241 yr Community Expert IMO with unraid, you really don't have to worry about much linux stuff unless you want to really get into it for some super custom stuff. Linux is really optional when in comes to setting up and using Unraid. With that said, try this: Go to the "Tools" page on your unraid dashboard, there should be an option called "Docker Safe New Perms," click on it, click the checkbox, and run it. This will set the correct permissions for all files and directories. Hopefully this fixes your plex media deletion issue. You should be able to delete the media off your NAS through the plex docker. Im honestly surprised it isn't deleting. The only other thing I can think of is the mountpoint for your media is set to "read only" instead of "read/write." To check this, click on plex docker, hit the edit button to open the docker configuration page and make sure the Access Mode is set to read/write Edited November 26, 20241 yr by MowMdown
November 26, 20241 yr Author 57 minutes ago, bmartino1 said: review: Yes, this is what happens when an open community is left unchecked with open-source software. LOL! Many conspiracy theories about the Linux kernel. I use the lscr.io/linuxserver/plex one as well. As mentioned earlier, you may need to restart the entire Plex Docker due to database issues. You lose disk security and ease of management by going with Windows. Plex is not as robust with features as it is on Linux, and Sonarr/Radarr are actually easier to set up on Linux than on Windows. https://dev.to/rafaelmagalhaes/home-media-server-with-plex-sonarr-radarr-qbitorrent-and-overseerr-2a84 Kidding—I'd recommend Arch! Maybe Debian... LOL! If you decide to continue using Unraid, to move forward, I would recommend deleting the image (this will not delete any current media on the disks). but this will restart any current plex media library.... Web UI > Dockers: click add container: template drop down: hit the x: this removes unraid side stuff... now we need to delete the appdata folder to reinstall and start over: so we open terminal #you can typ mc and use mc to as well cd /mnt/user/appdata #list file in folder ls #delete folder with files in it: rm -rf /mnt/user/appdata/plex with this gone we are ready for a default install: install: unraid template: *My unraid usise macvlan unriad new default is ipvlan. I have heavily edited my template... advance togle: Extra parmerter: -p 32410:32410/udp -p 32412:32412/udp -p 32413:32413/udp -p 32414:32414/udp --mac-address 02:42:c0:a8:02:05 --hostname PLEX-DOCKER --device=/dev/dvb/ *These are the ports plex uses and needs, macvlan static asign a mac. a host name and aditional usb tuner device. next give it a static ip! set a path: in this case in plex /data is my unriads /mnt/user path *You can keep your old plex claim its best to start fresh to not get any metadata: Container Variable: PLEX_CLAIM Optionally you can obtain a claim token from https://plex.tv/claim and input here. Keep in mind that the claim tokens expire within 4 minutes. if you show more setting you wil see that linux IO has already addded the puid/pguid/umask: I appreciate the response. I had a rough night and struggling at the office. If I feel motivated I will review your response when I get home.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.