`

mtd-utils工具的使用

 
阅读更多

mtd_debug

 

[root@xmos /root]# mtd_debug
usage: mtd_debug info <device>
       mtd_debug read <device> <offset> <len> <dest-filename>
       mtd_debug write <device> <offset> <len> <source-filename>
       mtd_debug erase <device> <offset> <len>

 

mtd_debug info

可以查看flash类型,块大小,mtd分区总大小,大小以10进制显示,分区大小就是len

mtd_debug write

把文件写入mtd,offset和len可以用十进制也可以用16进制,16进制要以0x作前缀

len要小于等于文件长度和mtd分区大小

写入之前要erase mtd分区

mtd_debug read

把文件写入mtd,offset和len可以用十进制也可以用16进制,16进制要以0x作前缀

len要小于等于mtd分区大小

mtd_debug erase

擦除mtd分区

offset和len可以用十进制也可以用16进制,16进制要以0x作前缀

len要小于等于mtd分区大小

 

例如

mtd_debug read /dev/mtd2 0x0 0x00900000 config.img

flashcp

用来把flash镜像写入mtd分区

flashcp -v rootfs.image /dev/mtd1

该命令把erase,write,校验一块完成了

 

mtd_debug和flashcp执行的时候cpu占用比较高,会导致系统响应缓慢甚至死机,执行完就好了

dd的时候不要使用mtdblock作为设备名,mtdblock是ftl层,ftl转换的效率很低,而且不安全,操作ftl不需要erase操作,完全像block设备一样

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics