]> git.ipfire.org Git - thirdparty/collectd.git/commit
ubi: add percent evaluation for the bad blocks
authorFlorian Eckert <fe@dev.tdt.de>
Fri, 12 Mar 2021 10:07:45 +0000 (11:07 +0100)
committerMatthias Runge <mrunge@matthias-runge.de>
Thu, 9 Sep 2021 05:41:41 +0000 (07:41 +0200)
commit8c56291be070d7fcb99158157e1d42256dc4930e
tree9456de73c543d34c2cc5ed9f10a1a1c00b1365f1
parentd4e3332fc5198504483c0eac2b83b6cc48feb01a
ubi: add percent evaluation for the bad blocks

So far the plugin contains the evaluation of the maximum erase count
from `/sys/class/ubi/ubi<x>/max_ec` and the evaluation of bad physical
erase block count from `/sys/class/ubi/ubi<x>/bad_peb_count`.

For each ubi device, the reserved physical erase blocks are also displayed.
The value is shown in `/sys/class/ubi/ubi<x>/reserved_for_bad`.

If the defekt erase blocks are now used with the reserved erase blocks,
we can calculate who many percent of the flash is defekt.

With this information we can now create a notify that is triggered at a
certain percentage.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
src/ubi.c