Plex media server does not start if db volume in megerfs pool

  • Hi,



    I'm running OMV 3.0.59 with snapraid and mergerfs.



    I'm trying to setup Plex Media Server. If I put the Plex database volume into the mergerfs pool, Plex does not start:



    Jan 31, 2017 10:38:54.600 [0x7f3929bfe700] INFO - Plex Media Server v1.3.3.3148-b38628e - ubuntu PC x86_64 - build: linux-ubuntu-x86_64 ubuntu - GMT 02:00
    Jan 31, 2017 10:38:54.601 [0x7f3929bfe700] INFO - Linux version: 4.8.0-0.bpo.2-amd64 (#1 SMP Debian 4.8.15-2~bpo8+2 (2017-01-17)), language: en-US
    Jan 31, 2017 10:38:54.601 [0x7f3929bfe700] INFO - Processor Intel(R) Xeon(R) CPU E3-1225 v3 @ 3.20GHz
    Jan 31, 2017 10:38:54.601 [0x7f3929bfe700] INFO - /usr/lib/plexmediaserver/Plex Media Server
    Jan 31, 2017 10:38:54.600 [0x7f3935633800] DEBUG - BPQ: [Idle] -> [Starting]
    Jan 31, 2017 10:38:54.600 [0x7f3935633800] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.13.0, threadsafe=1
    Jan 31, 2017 10:38:54.601 [0x7f3935633800] ERROR - SQLITE3:0x10, 5386, os_unix.c:33579: (19) mmap(/media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-shm) - No such devi
    Jan 31, 2017 10:38:54.601 [0x7f3935633800] ERROR - SQLITE3:0x10, 5386, disk I/O error
    Jan 31, 2017 10:38:54.601 [0x7f3935633800] ERROR - Database corruption: sqlite3_statement_backend::prepare: disk I/O error for SQL: PRAGMA cache_size=2000
    Jan 31, 2017 10:38:54.601 [0x7f3935633800] ERROR - Error: Unable to set up server: sqlite3_statement_backend::prepare: disk I/O error for SQL: PRAGMA cache_size=2000 (N4soci10soci_errorE)



    This is the results of stat of plexmediaserver folder in the mergerfs pool:



    root@openmediavault:/media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7# stat plexmediaserver/
    File: ‘plexmediaserver/’
    Size: 4096 Blocks: 8 IO Block: 4096 directory
    Device: 27h/39d Inode: 8800436748289 Links: 3
    Access: (0755/drwxr-xr-x) Uid: ( 114/ plex) Gid: (65534/ nogroup)
    Access: 2017-01-30 22:03:19.236082084 +0200
    Modify: 2017-01-30 22:01:36.274522596 +0200
    Change: 2017-01-30 22:02:49.211626294 +0200
    Birth: -



    The file com.plexapp.plugins.library.db-shm exists:
    cd "/media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases"
    root@openmediavault:/media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases#
    ls -al
    drwxr-xr-x 2 plex nogroup 4096 Jan 31 12:51 .
    drwxr-xr-x 7 plex nogroup 4096 Jan 31 12:50 ..
    -rw-r--r-- 1 plex nogroup 69632 Jan 31 12:50 com.plexapp.dlna.db
    -rw-r--r-- 1 plex nogroup 32768 Jan 31 12:50 com.plexapp.dlna.db-shm
    -rw-r--r-- 1 plex nogroup 292552 Jan 31 12:50 com.plexapp.dlna.db-wal
    -rw-r--r-- 1 plex nogroup 251904 Jan 31 12:51 com.plexapp.plugins.library.db
    -rw-r--r-- 1 plex plex 32768 Jan 31 12:51 com.plexapp.plugins.library.db-shm
    -rw-r--r-- 1 plex plex 0 Jan 31 12:51 com.plexapp.plugins.library.db-wal



    root@openmediavault:/media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases#
    stat com.plexapp.plugins.library.db-shm
    File: ‘com.plexapp.plugins.library.db-shm’
    Size: 32768 Blocks: 64 IO Block: 4096 regular file
    Device: 27h/39d Inode: 8800436748566 Links: 1
    Access: (0644/-rw-r--r--) Uid: ( 114/ plex) Gid: ( 119/ plex)
    Access: 2017-01-31 12:51:06.754625955 +0200
    Modify: 2017-01-31 12:51:22.579113489 +0200
    Change: 2017-01-31 12:51:22.579113489 +0200
    Birth: -



    When I put the Plex database volume into a data drive, Plex starts.



    I've made a symbolic link to /dev/sda.
    This is the results of stat of the plexmediaserver folder in /dev/sda:



    root@openmediavault:/sda# stat plexmediaserver/
    File: ‘plexmediaserver/’
    Size: 4096 Blocks: 8 IO Block: 4096 directory
    Device: 801h/2049d Inode: 48758785 Links: 3
    Access: (0755/drwxr-xr-x) Uid: ( 114/ plex) Gid: (65534/ nogroup)
    Access: 2017-01-31 12:35:04.440333009 +0200
    Modify: 2017-01-31 12:34:31.744059495 +0200
    Change: 2017-01-31 12:35:04.504333593 +0200
    Birth: -



    This is my fstab:
    root@openmediavault:/# cat /etc/fstab
    # /etc/fstab: static file system information.
    #
    # Use 'blkid' to print the universally unique identifier for a
    # device; this may be used with UUID= as a more robust way to name devices
    # that works even if disks are added and removed. See fstab(5).
    #
    # <file system> <mount point> <type> <options> <dump> <pass>
    # / was on /dev/sde1 during installation
    UUID=480db687-e334-449c-94b2-45a3c2aa3d72 / ext4 errors=remount-ro 0 1
    # swap was on /dev/sde5 during installation
    UUID=ead554ff-3524-441b-a9f6-b72ce7e406ac none swap sw 0 0
    tmpfs /tmp tmpfs defaults 0 0
    # >>> [openmediavault]
    UUID=eae920f8-3de0-494a-974c-d42444545f45 /media/eae920f8-3de0-494a-974c-d42444545f45 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    UUID=f874b07a-5622-4299-865b-92fb609585a3 /media/f874b07a-5622-4299-865b-92fb609585a3 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    UUID=37520572-718e-43f6-8ec7-d7300074681a /media/37520572-718e-43f6-8ec7-d7300074681a ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    UUID=704f1e66-c3bc-415f-b594-5afa69bdba62 /media/704f1e66-c3bc-415f-b594-5afa69bdba62 ext4 defaults,nofail,user_xattr,noexec,usrjquota=aquota.user,grpjquota=aquota.group,jqfmt=vfsv0,acl 0 2
    /media/eae920f8-3de0-494a-974c-d42444545f45:/media/f874b07a-5622-4299-865b-92fb609585a3:/media/37520572-718e-43f6-8ec7-d7300074681a /media/44bd3a31-33dc-4b69-a88d-2cbcadf3b3b7 fuse.mergerfs defaults,allow_other,direct_io,use_ino,category.create=epmfs,minfreespace=4G 0 0
    # <<< [openmediavault]



    Thanks

  • Thanks,


    you were right.


    I removed direct_io from mergerfs options and rebooted as suggested. Now Plex starts.


    Should I continue with this setup or should I put Plex db to a data drive and put direct_io back to mergerfs? Any suggestions?


    I couldn't find any Plex related options for sqlite and mmap when Googling.


    Thanks again.

  • It'd be better to run with direct_io enabled. If you need to place Plex's db in the pool you could create a second mount without direct_io disabled. Otherwise just leave it pointed to a raw drive.

  • Do you mean a second pool on same drives? This seems to be impossible with OMV unionfilesystems 3.1.10 plugin.
    I have snapraid and mergerfs. Three data disks in the pool and one parity disk outside the pool.

    • Offizieller Beitrag

    The plugin doesn't currently allow drives to be used in more than one pool. I guess that wouldn't be hard to change.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • Thanks!
    I've got a few more questions. Please be patient.


    1. So, I guess it's no use to modify OMV config.xml <unionfilesystems> and run omv-mkconf fstab?
    2. If not, I guess a new fstab entry should be outside
    # >>> [openmediavault]
    <<< [openmediavault]
    3. If I modify fstab, do OMV plugins/gui see the new pool?

    • Offizieller Beitrag

    1. So, I guess it's no use to modify OMV config.xml <unionfilesystems> and run omv-mkconf fstab?

    You could if you know the config.xml well. I wouldn't though.


    2. If not, I guess a new fstab entry should be outside

    Yes. Then OMV won't change it.


    If I modify fstab, do OMV plugins/gui see the new pool?

    Nope. I will change the plugin but we have a bunch of commits that require OMV 3.0.60 that hasn't been released yet. So, you will have to wait for that. Until then, I would just put the database on a single drive instead of a pool.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

    • Offizieller Beitrag

    Still one thing: it would be nice to have mergerfs-tools installed with the unionfilesystems plugin.

    I've not properly packaged the tools. Probably best to install them ad-hoc for now.

    I will add them when trapexit packages them.

    omv 7.0-32 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.9 | compose 7.0.9 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!