Fix Plex - JohnnyFoulds/firstrepo GitHub Wiki

Fix Plex Media Server Database

Install SQLite3 tools

apt-get install sqlite3 libsqlite3-dev

Change to Database folder

cd /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/

Backup the current database

cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.original

Check for corruption

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"
sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"	

Run a Repair

sqlite3 com.plexapp.plugins.library.db .dump > dump.sql
rm com.plexapp.plugins.library.db
sqlite3 com.plexapp.plugins.library.db < dump.sql
chown plex:plex com.plexapp.plugins.library.db

What I Did

cp com.plexapp.plugins.library.db-2019-08-15 com.plexapp.plugins.library.db

sqlite3 com.plexapp.plugins.library.db "DROP index 'index_title_sort_naturalsort'"
sqlite3 com.plexapp.plugins.library.db "DELETE from schema_migrations where version='20180501000000'"
sqlite3 com.plexapp.plugins.library.db "PRAGMA integrity_check"	

chown plex:plex com.plexapp.plugins.library.db
systemctl start plexmediaserver

Noexec

This is an option in the /etc/fstab that is extremely annoying and always causing playback to fail.

OMV Version

dpkg -l | grep openmediavault

OMV_FSTAB_MNTOPS_EXT4

Add the following to /etc/default/openmediavault:

OMV_FSTAB_MNTOPS_EXT4="defaults,nofail,user_xattr,exec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2"

Existing Mounts

Edit /etc/openmediavault/config.xml to update the existing mounted drives.

omv-mkconf fstab

Also just do sed -i 's/noexec/exec/g' /etc/fstab if the above command fails and reboot.

Web References