MergerFS & Sqlite3 (Plex, Homessistant) : Disk I/O error

  • Hello,


    Some unforeseen event has accelerated my migration to OMV 5 (the thumb drive with the install of OMV 4 failed:)). I was previously using mergerFS without problem. I managed to successfully restore my shared folders on OMV 5.

    The problem happens when I use the mergerFS volume as bind in Portainer (/srv/...). Plex refuses to startup and the logs show the following:

    Code
    Jun 05, 2020 09:05:54.998 [0x7fb5ec726740] ERROR - SQLITE3:(nil), 5386, os_unix.c:37072: (19) mmap(/config/Library/Application Support/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-shm) - No such device
    Jun 05, 2020 09:05:54.998 [0x7fb5ec726740] ERROR - SQLITE3:(nil), 5386, disk I/O error in "PRAGMA cache_size=2000"
    Jun 05, 2020 09:05:54.998 [0x7fb5ec726740] ERROR - Database corruption: sqlite3_statement_backend::prepare: disk I/O error for SQL: PRAGMA cache_size=2000

    However, this does not happen if I use the direct path to one of the drive used with mergerFS. I thought my Plex database may be corrupted, so I tried to run a new Plex instance with a fresh config folder in my mergerfs volume and it made no difference.

    Same kind of errors pop up with Homeassistant :

    Code
    2020-06-04 23:01:16 ERROR (Recorder) [homeassistant.components.recorder] Error during connection setup: (sqlite3.OperationalError) disk I/O error
    (Background on this error at: http://sqlalche.me/e/e3q8) (retrying in 3 seconds)

    I have tried resetting the permissions with the resetperm plugin but to no avail.


    Edit; here is my fstab :


    Any help much appreciated,


    Thanks !

  • Ok so I found a fix, in case someone encounters the same issue.


    From the GitHub page of mergerfs

    Quote

    Plex doesn't work with mergerfs


    It does. If you're trying to put Plex's config / metadata on mergerfs you have to leave direct_io off because Plex is using sqlite3 which apparently needs mmap. mmap doesn't work with direct_io. To fix this place the data elsewhere or disable direct_io (with dropcacheonclose=true). Sqlite3 does not need mmap but the developer needs to fall back to standard IO if mmap fails.

    direct_io is deprecated and has been replaced by cache.files. The solution was to remove cache.files=off from the mergerfs options in the OMV GUI.


    I hope it helps someone !

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!