Yes, in Synology, the result is:
music: 494376 files, 34290 folders
music2: 519260 file, 38338 folders
Total: 1013636 files, 72628 folders
Thank you
Yes, in Synology, the result is:
music: 494376 files, 34290 folders
music2: 519260 file, 38338 folders
Total: 1013636 files, 72628 folders
Thank you
How can we proceed to evaluate whether the number of directories is sufficient or needs to be increased?
It is explained in the HowTo that @ChuckPa has posted above: Linux Tips - #9 by ChuckPa
Please I need further step by step explanations, I can’t follow these explanations by myself, thanks
To add to Otto,
Here is the Synology version (with screenshots)
You already have the total number of folders used.
Doing the math, you’ll want to allocate 98304 folders
Hi, following all the steps didn’t work. I tried increasing the number to 458752 (I have other folders on the NAS that aren’t monitored by Plex), but that didn’t work. What could be the cause? Thanks
I first tried the number that came up according to my calculations, which was 98304. This number is the result of the calculations applied to only one of the two folders monitored by PMS on the NAS (“music” + “music2”), even if it applies to both folders. It didn’t work. Since I also have other folders on the NAS that aren’t monitored by PMS, I tried calculating the total folders on the NAS, and the multiple came up with 458752, but it didn’t work. I followed the entire procedure, then pressed Run and Restart, but it didn’t work, in the sense that the PMS installed on Ubuntu-server didn’t automatically detect the new folder, and the scan always restarted from scratch. I should point out that in the last few days I also installed PMS on Synology to see how it installs, and I’m slowly adding the contents: in this version, the automatic scan has worked very well so far. I repeat that I would prefer to see PMS work on Ubuntu-server. Why doesn’t the script work on Synology? Thanks
You have 72,628 folders for Music.
What about the number of folders for your other medias ?
Don’t count anything in the PlexMediaServer shared folder
(That’s PMS internal ONLY)
If you’ve placed anything in there – MOVE IT OUT IMMEDIATELY
I say this because 458752 sounds a lot like PMS internals.
Also, most Synology NAS systems , with their limited memory, can’t handle that many slots being allocated (about 2KB / slot on average)
There’s nothing in the Plexmediaserver folder. The PMS installed in Ubuntu only reads two folders on the NAS: “music” and “music2,” which only contain music (I double-checked). The other folders on the NAS have nothing to do with the Ubuntu PMS, so if I understand correctly, they’re not related to the Inotify issue. In the meantime, I’ve granted additional permissions to the two folders, following another FAQ on permissions in Synology. It seems that the script inserted in Synology’s scheduled tasks isn’t working or isn’t being received by the NAS. Is there a way to check if the permissions are correct and if the script that increases Inotify is working?
I am sorry, Somehow I thought you were running PMS on the Syno.
For my machine, I have 1,048,576 slots by default
I do the calculation
then I check
[chuck@lizum glock.2009]$ pwd
/glock
[chuck@lizum glock.2010]$ find ./qa ./media -type d -print | wc -l
114181
[chuck@lizum glock.2011]$ expr 114181 / 32768
3
[chuck@lizum glock.2012]$ expr 3 + 1
4
[chuck@lizum glock.2013]$ expr 32768 \* 4
131072
[chuck@lizum glock.2014]$
[chuck@lizum glock.2014]$ # 131072 folder slots are needed for linux.
[chuck@lizum glock.2015]$ sudo bash
root@lizum:/glock# sysctl -a | grep max_user_watches
fs.epoll.max_user_watches = 14539776
fs.inotify.max_user_watches = 1048576
root@lizum:/glock#
If I need more than I currently have,
sudo bash (must be done as root)echo fs.inotify.max_user_watches=131072 >> /etc/sysctl.confsysctl -p # reread and resize the table.sysctl -a | grep max_user_watches # will now show the number you enteredmx@ubuntu-server:~$ pwd
/home/mx
mx@ubuntu-server:~$ find ./qa ./media -type d -print | wc -l
find: ‘./qa’: No such file or directory
find: ‘./media’: No such file or directory
0
the script doesn’t work
No help here…
I’d like to try the Plex NFS Watchdog application; the project is located at GitHub - LightDestory/PlexNFSWatchdog: A utility to trigger Plex partial-scans on NFS configurations, on which inotify is not supported . I’ve done almost everything, assuming it works, but I get a Bind Mount Failed “/path/to/volume2/music” message. I configured an .env file as follows:
PLEX_SERVER=http:http://192.168.1.50/32400
PLEX_TOKEN= Deleted by Moderator
WATCH_PATHS=/path/to/volume2/music
SCAN_INTERVAL=150
LISTENERS=move modify create delete
and a compose.yml file
services:
plexnfswatchdog:
build: .
image: plexnfswatchdog
container_name: plexnfswatchdog
restart: unless-stopped
env_file: ./.env
environment:
In the NAS the folders with music are:
/volume2/music (I only tried with this one)
/volume2/music2
Where did I go wrong? Can anyone help me?
Is the problem:
a) Plex Media Server does not ever discover new media, even on manual scans.
or
b) Plex Media Server discovers media on manual or timed scans, but not automatically when added.
If the first, then you’ve an issue with how NFS is configured, file permissions, or possibly file naming and organization. NFS Watchdog will not help.
If the second, then, as mentioned on the NFS Watchdog page, that is a limitation of the NFS protocol. You’ll need to use that tool or something like it. If you need help with that tool, then contact its developer.
This is the problem. At the same time, I tried installing PMS on the NAS, and automatic scanning worked. However, after adding about half of my (very large) library, I noticed the NAS 916+ was having trouble maintaining speed; it actually slowed down, and Plexamp loads slowly. So, I have these PMS solutions:
The preferred option would be option 3; otherwise, I’ll have to resort to option 2. I appreciate alternative suggestions and help, including regarding NFS Watchdog.
This is the problem and with my library I can’t give up the automatic scan, otherwise the scanning system always starts from zero (manually) with each added content and the scanning is too slow.
NEVER post the Plex token for your server on this forum or anywhere else. It can be used to gain access to your server.
I just noticed it in your earlier post and deleted it.
Thanks for the important correction!
Update: after several tests, I’ve found that automatic scanning works on a Samba share between Windows 11 and the Synology NAS. Therefore, I’ll install Windows 11 on the NUC and continue with the Synology NAS without any further updates. The problem is evidently with both Linux and the NFS share. Note that much of the information circulating, including that in this thread, was incorrect on the part of the administrators.
Also note that when you add a new album, the scan starts about 30-60 seconds later. But it always starts.
This is because Windows does period scanning of the filesystem (built into Windows itself). Linux uses Interrupts but Windows uses polling.