[OpenWrt-Devel] How to track IO usage of internal flash mtd partitions?

Sergey Zakharchenko doublef.mobile at gmail.com
Mon Jun 1 04:03:37 EDT 2015


2015-05-30 0:50 GMT+03:00 valent.turkovic at gmail.com <valent.turkovic at gmail.com>:
> Awesome news Sergey,
> will this patch be applied to latest trunk anytime soon so that I can test it?

I'm not aware of any plans like that, I wouldn't hold my breath. I'm
afraid you'll need to apply the patch yourself for the time being. The
number of downloads showed some interest in the matter though.

> Can you just briefly explain how will it be possible to track erase
> block count once this patch is applied?

Special files named "erasecount" appear in the sysfs directories
corresponding to mtd devices, and contain (surprise) the erase count
(since reboot of course). E.g.

# find /sys/ -name erasecount | xargs -n 1 grep [0-9] /dev/null

/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd0/erasecount:0
/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd1/erasecount:0
/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd2/erasecount:0
/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd3/erasecount:6
/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd4/erasecount:0
/sys/devices/platform/ath79-spi/spi_master/spi0/spi0.0/mtd/mtd5/erasecount:0

Best regards,

-- 
DoubleF
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list