1

How to use dd command to download mtd block from embedded Linux-based device?

# cat /proc/mtd
dev:    size   erasesize  name
...
mtd3: 003a0000 00010000 "DRTI2"

I need download mtd3 block, so

dd if=/dev/mtdblock3 bs=BYTES count=BLOCKS | nc 192.168.1.30 5555

What should be correct bs and count values and how to calculate it? Size is '003a0000' and erasesize (erase block size) is '00010000' in hex values.

  • Do you want full mtdblock3? If so, just do cat /dev/mtdblock3 | nc 192.168.1.30 5555. – user140866 Dec 23 '15 at 3:10
  • @siblynx Yes, I need full mtdblock3. But is it possible do this with dd command? – minto Dec 23 '15 at 10:39
  • dd and cat are equal if you want to read full mtdblock3. With dd it will be: dd if=/dev/mtdblock3 | nc 192.168.1.30 5555. Just omit optional bs= and count=. – user140866 Dec 23 '15 at 11:49
  • @siblynx, if to use dd with bs and count operands, is this correct code: dd if=/dev/mtdblock3 bs=65536 count=58 | nc 192.168.1.30 5555 I have converted hexadecimal values to bytes. – minto Dec 23 '15 at 21:27
  • yes, that's correct. – user140866 Dec 24 '15 at 4:53
0

dd and cat are equal if you want to read full mtdblock3. With dd it will be: dd if=/dev/mtdblock3 | nc 192.168.1.30 5555. Just omit optional bs= and count=.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.