measuring the flash usage

Brian Norris computersforpeace at gmail.com
Tue Sep 20 17:02:59 EDT 2011


Hi,

On Tue, Sep 20, 2011 at 4:22 AM, Folkert van Heusden
<folkert.van.heusden at gmail.com> wrote:
> For an embedded system I'm working on I'd like to monitor the health
> of the flash memory.
> On regular Linux systems one can look at /proc/diskstats to see how
> often the system writes to a disk. It seems though that (at least
> kernel 2.6.19) for flash these counters are not updated.

I don't have much experience with the /proc/diskstats but for me, it
at least lists the mtdblockX devices I have on my system (which I
don't use). If you use those (for instance, for JFFS2?), then I would
imagine that Linux will track stats as with other block devices. Is
this not your experience?

> So I was wondering: are there any other ways?
> E.g. will the kernel log a message when it has problems writing
> to/reading from the flash memory? Are there any other counters
> anywhere?

Generally, MTD is pretty good at printing important messages, which
should get logged by your system. Also, bitflips/ECC errors can be
tracked with ioctl(ECCGETSTATS). This info is retrieved, for example,
by nanddump.

Others can probably comment better on other methods for tracking
health. Hope this helps.

Brian



More information about the linux-mtd mailing list