Why the BTRFS Information gap?

  • OMV7 has promoted BTRFS over MD RAID for mulitple device data arrays and consolidates the features in OMV6 for BTRFS support. Perhaps votdev has it on a features backlog list, but compared to MD RAID there seems to be an information gap for BTRFS.


    With MD RAID there is a separate "details" page in the WebUI and "details" are also included in the "Diagnostic | Report". With BTRFS, unless a user "tags" a BTRFS filesystem, there is no "at-a-glance" indication of the BTRFS profile in use on the "Storage | Filesystems" page, no separate "details" page you can go to and no BTRFS filesystem details in the diagnostic report. The output of either "btrfs fi show ..." and/or "brtfs fi us -T ... " and/or "brtfs dev stats ... " is not included.


    But, I'd hope votdev would consider it a very useful enhancement to have the same level of detail as MD RAID on a dedicated WebUI page for BTRFS systems and in the diagnostic report. For example, something like this:



    There is a second serious information gap that relates to drive failures in BTRFS RAID arrays.


    With MD RAID, if a drive drops out of an array a "Fail event on /dev/md.." notification rapidly follows and the MD RAID "details" in the WebUI will show the device as "removed". There is no equivalent for BTRFS as it has no in-built daemon or utility to report such events. So there is nothing in OMV to monitor & notify for a "missing device" and catch such an event on a BTRFS RAID filesystem, no separate "BTRFS " box to tick on the WebUI "System | Notification | Events" page.


    What OMV does include is a cron job, scheduled to run daily which checks for and notifies any non-zero btrfs device counts, before by default resetting those cumulative counts to zero. But 24hrs is a long time to wait for any feedback about a failed drive on a BTRFS RAID. If and when the notification prompts you to check your system, then there are no details to view via the WebUI. BTRFS filesystems with "missing devices" may not mount rw on system reboots, this will amongst other things generate a generic mount failure notification and any subsequent hourly snapshot cleanup jobs also generate notifications of errors while the BTRFS filesystems remains unmounted (and probably should be disabled). All of which could be too late if the BTRFS suffers more than a single drive failure.


    So, should OMV check for and notify "missing devices", and other errors, in BTRFS filesystems and how would it achieve this?


    Reacting to logged BTRFS kernel messages seems an obvious choice and one way of doing this might be to use the lightweight "simple event correlator" (https://tracker.debian.org/pkg/sec) which runs as a systemd service (See for example https://marc.merlins.org/perso…fs-Filesystem-Repair.html and https://github.com/simple-evco…ts/blob/master/systemd.md and https://simple-evcorr.github.io/man.html).


    The sec program works with traditional logs as inputs, i.e. syslog, messages, kern.log, etc., as per debian versions prior to debian 12. As OMV7 has retained rsyslog for its remote login function all that is needed is to restore the /etc/rsyslog.conf to debian 11 format. Superficially at least, using sec appears to be a way of creating BTRFS error/warning messages without relying on cron or systemd timers, generating notifications in near real-time. Thus it may be a way to add BTRFS monitoring to the existing OMV "System Notifications Events".


    I can't claim to be conversant with the power of perl regex pattern matching, but using grep -P on /var/log/kern.log to test some simple regex, led to this simple sec rule as a brief test:


    Code
    type=SingleWithThreshold
    ptype=RegExp
    pattern=(?i)kernel.*btrfs.error
    window=60
    thresh=3
    desc=Btrfs unexpected log
    action=pipe '%t: $0' /usr/bin/mail -s "sec: %s" root

    Which generated this email alert for logged BTRFS errors:



    Is this idea viable and worth pursuing? Maybe votdev would like to comment.

  • Please open a issue at GitHub. I've often told that i do not process feature request coming from the forum because this is not meant to be a feature/issue tracker,

    I posted on the forum as I thought it stimulate some discussion and I don't have a github account. Nor was I sure if the idea was a dead duck or not. But I see you've added a self-raised sec issue for other purposes.

    • Offizieller Beitrag

    don't have a github account.

    I'm not sure why you don't but if the issue tracker was on something like codeberg (run by not for profit), would you sign up for an account?


    But I see you've added a self-raised sec issue for other purposes.

    That doesn't cover your request for more info in the web interface for btfs.

    omv 7.0.5-1 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.1.6 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.4


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


    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

    Good news if it does. How do you specify the input in DAEMON_ARGS in the /etc/default/sec file for use with journald?

    You can check this here, but i've rejected the feature because rsyslog is required for syslog forwarding. But sending emails when a regex is matching a syslog message is also possible with rsyslog. OMV is using that for looking out for pam_faillock messages.

Jetzt mitmachen!

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