Getting an error after my weekend organizing of photos - to speed it up. I am cleaning up all my pictures so there are only JPGs - I made up a nice Windows Powershell script to clean up the JPGs, then a post script manual clean up… And I have the files - but in the meanwhile Plex DIES!! Cant even log into it. Says “Server is Unreachable” _ Log on the NAS attached below… Says something about out of SPACE… and truth is that I have 1.23TB available.
I need you to manually retrieve the logs.
- Control Panel - Shared Folders - Edit the
Plexshare - Add your username toR/Wpermission - File Station - Plex - Library - Application Support - Plex Media Server - Right click
LogsandCompress to Logs.zip - Attach that ZIP file here. We’ll see what’s happening
Did you install PMS on volume1 or on another volume? (that option is available depending on how many volumes you configure in the NAS
Doing it right now, will PM you the logs.zip file. Thanks appreciate it!! I only have a volume1
Thanks for the logs.
You threw thousands of photos at Plex, all at once, and expected that old, tiny, Synology to take it, without knowing its limitation?
Synology is (in)famous for having grossly under powered boxes when it comes to doing anything other than being the NAS they were designed as.
I see you have a ton of photos, very well organised. So well organized you blew out of the 8192 directory limit default in the Linux kernel all at once.
There are multiple ways to handle this, none will be easy or quick. In all cases, to use as many photos are you have with Plex, and have it automatically scan when you add content, will require you get your hands dirty with the command line. I’ll tell you what to do but you’ll have to do it.
How would you like to proceed?
Oh wow! Sorry :(… Here is some background: 1. I have a good library for Movies and Music that I have cleaned out and created playlists etc. I would like to preserve that if possible. 2. I dont mind deleting and recreating the photo libraries. I am one by one moving out all files except JPG I have been working all the week and only now I have reached 2009
But I have a clean set of JPG’s which are surprisingly small - once I took out the NEF’s, Videos, and other junk that was in there. Cleared out duplicates blah blah…
So I am ready for you! Tell me the steps and if I can preserve movies, music, playlists… I am good. There is a play list of photos, that can go as well. I did that because photos would not just load! Whats the 8192 limit? Not a per directory limit for files I hope
As you can tell I have a LOT of them!
Thanks for looking at the logs.
- If I can pull my usual “rabbit out of thin air” trick, all will be fine
- We’ll get PMS running just enough so you can drop the Photo library for now. Then add it later, slowly (smaller blocks)
- In the process, we’ll increase your kernel defaults
- We’ll also, if you consent, to keep Synology’s
@eaDirfrom clogging up PMS and creating havoc.
Presuming you’re ok with the above, here’s the procedure. If you don’t understand, don’t proceed until you do.
Everything I write in Step C → F can be copy/pasted and used as-is. I’ve included the full log so you have a reference. If you encounter errors, stop immediately. Copy/paste the screen text in your reply to me
A. Make certain PMS isn’t running
- Stop PMS in Package Center We can’t do anything with it running
- Enable SSH (control panel - terminal & snmp - ssh)
- Sign into the Syno and get it done
B. Enable SSH access to the commandline
- Open a terminal or putty SSH session to the IP address of your Syno
- Sign in as user
admin - Use the administrator password.
- Elevate to
rootlevel (above admin) starting with the commands below
C. Command line works begins here. Observe where I ssh (as user admin, which is critical) into the Synology
[chuck@lizum ~.101]$ ssh -l admin 192.168.0.23
admin@192.168.0.23's password:
admin@moesern:~$ uname -a
Linux moesern 3.10.102 #15254 SMP Fri Jan 26 06:43:30 CST 2018 x86_64 GNU/Linux synology_avoton_1815+
admin@moesern:~$ sudo -su root
sh-4.3# whoami
root
sh-4.3#
D. Adjust the kernel (This will need repeating after every major DSM upgrade)
sh-4.3# echo fs.inotify.max_user_watches=262144 >> /etc/sysctl.conf
sh-4.3# sysctl -p
E. Clean up Plex (manual optimization)
sh-4.3# cd "/volume1/Plex/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
sh-4.3# rm -f *-shm
sh-4.3# rm -f *.wal
sh-4.3# echo .dump | sqlite3 com.plexapp.plugins.library.db > plex.sql
sh-4.3# mv com.plexapp.plugins.library.db plex-orig.db
sh-4.3# sqlite3 com.plexapp.plugins.library.db <plex.sql
sh-4.3# chown plex:100 com.plexapp.plugins.library.db
F: Clean up what Synology has created (for now)
This will print out some not-found errors. This is expected and normal
find /volume1 -name @eaDir -exec rm -rf {} \;
G: Operational recovery
- Start Plex
- Open your normal session to Plex on your Synology
- Immediately Cancel all scanning
- Delete the photo library section(s) you defined
Evaluate where you’re at. Please let me know
Ok starting now
Pray for me!
DONE Stop PMS in Package Center We can’t do anything with it running
DONE Enable SSH (control panel - terminal & snmp - ssh)
DONE Sign into the Syno and get it done
DONE Enable SSH access to the commandline
DONE Open a terminal or putty SSH session to the IP address of your Syno
DONE Sign in as user admin
DONE Use the administrator password.
DONE Command line works begins here. Observe where I ssh (as user admin, which is critical) into the Synology
I am root “with great power comes great responsibility”
and I am LOVING IT!! BTW… been so long… thanks @ChuckPA …
Going on…
sh-4.3# echo fs.inotify.max_user_watches=262144 >> /etc/sysctl.conf
sh-4.3# sysctl -p
kernel.panic = 3
fs.inotify.max_user_watches = 262144
…
blocked on…
echo .dump | sqlite3 com.plexapp.plugins.library.db > plex.sql
<HOW LONG is this supposed to take?>
Best I can do here is “Adjust for maximum smoke” >:)
@photusic said:
sh-4.3# echo fs.inotify.max_user_watches=262144 >> /etc/sysctl.conf
sh-4.3# sysctl -p
kernel.panic = 3
fs.inotify.max_user_watches = 262144
…
blocked on…
echo .dump | sqlite3 com.plexapp.plugins.library.db > plex.sql
<HOW LONG is this supposed to take?>
It is dumping out your database from SQLite3 format to text SQL
My database isn’t fragmented and is only 22 MB. It takes about 3 seconds
Supplement. Your database is a) grossly fragmented (why PMS won’t start) and b) has a ton of photo records to correlate as it dumps out the ascii.
You should be seeing a lot of disk activity (Resource monitor - Transfer Rate- Real Time) should show this… but you should be almost done. Remember, it’s a D2701 CPU. It’s not the speed of my Atom C2538 Quad Core
As long as you don’t see errors, let it continue.
weird for some reason it did not complete plex.sql file is 0 so suspecting something did not work well… i will run it again…
sh-4.3# time echo .dump | sqlite3 com.plexapp.plugins.library.db > plex.sql
real 0m1.561s
user 0m1.438s
sys 0m0.112s
sh-4.3# ls -la *.sql
----------+ 1 root root 22469838 Feb 18 19:55 plex.sql
sh-4.3#
Waiting…

Are you showing 50% CPU?
1.4 GB database? And you wondered why it was taking so long? 
The import will also take a long time. You have a huge amount of data to pull back in. It will be considerably longer because instead of ‘walking down’ the table. It is actually building a new database as it reads each of the ascii commands.
When it’s done, more plex.sql and look at it. You’ll see why


