Does this entire SPI DUMP method work on OpenWrt?

Hi!, i have a device with MX25L25645G 32MB SPI FLASH
i want to take whole SPI dump. When i apply this method image is also 32MB exactly
Is this method shown below correct or bullshit?
thanks.

root@OpenWrt:/# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00080000 00010000 "u-boot"
mtd1: 00040000 00010000 "u-boot-env"
mtd2: 00040000 00010000 "u-boot-env2"
mtd3: 00d80000 00010000 "firmware"
mtd4: 00180000 00010000 "kernel2"
mtd5: 00040000 00010000 "sysinfo"
mtd6: 00c00000 00010000 "rootfs2"
mtd7: 003c0000 00010000 "jffs2"
root@OpenWrt:/# cat /dev/mtd0 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd1 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd2 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd3 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd4 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd5 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd6 >> spi_dump_orj.bin
root@OpenWrt:/# cat /dev/mtd7 >> spi_dump_orj.bin
root@OpenWrt:/# du -sh spi_dump_orj.bin 
32.0M   spi_dump_orj.bin
root@OpenWrt:/# scp spi_dump_orj.bin topcu@192.168.20.107:/home/topcu/Desktop/.

Host '192.168.20.107' is not in the trusted hosts file.
(ssh-ed25519 fingerprint sha1!! )
Do you want to continue connecting? (y/n) y
topcu@192.168.20.107's password: 
spi_dump_orj.bin                              100%   32MB   2.3MB/s   00:14    
root@OpenWrt:/# 

dd or cat should work

I would probably make one per mtd, then it'll be easier to restore them independently, and still easy to combine, if required.

1 Like

i want to backup entire spi flash so i could program that dump with ch341a programmer to a new spi flash

you're missing the point, but if it's only for a one time use, then yes.

1 Like