measuring the flash usage

Brian Norris computersforpeace at gmail.com
Wed Sep 21 15:04:19 EDT 2011


On Tue, Sep 20, 2011 at 11:47 PM, Folkert van Heusden
<folkert.van.heusden at gmail.com> wrote:
>>> 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?
>
> They're there, they just won't get updated.

As Artem said: "That will only account I/O via mtdblock, but not via
mtd devices". I'll assume that you are not doing I/O via mtdblock. In
that case, they shouldn't get updated.

>> 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.
>
> Are these values retained accross power off/reboots?

No, ECC stats are only kept in memory.

> And will this work for NOR flash?

I doubt it! For one, I didn't think NOR flash used ECC, so there are
no such stats to track. Also, nanddump isn't intended for NOR flash.

Brian



More information about the linux-mtd mailing list