Understanding nanddump /nandwrite

Hello,

I'm a little bit confused with the utilities nanddump and nandwrite and their various options. If I have understood well, NAND flash memory is divided in blocks, then pages and those are composed of three parts : the data, the oob and ecc bits. The data being generally a specific filesystem (jffs2, yaffs, ubifs). Right ?

So, when using dd or cat on a mtd device, the whole flash memory is copied, including the oob and ECC. Which is bad because of bad blocks and / or having ECC / oob data which can be specific a NAND chip. Right ?

So, if I want to use nanddump to get data the same way dd does for block devices / files, which options should I choose ? --noecc --omitoob ? Which bb method should I choose ?

Now assuming that I have my dump and that I want to restore it. As I understand, I should use nandwrite for the very same reasons to choose nanddump. Then which options should I use to:

  • restore it to the same mtd partition ?
  • restore it to another mtd partition on the same flash ?
  • restore it to another mtd partition on another flash ?

Than you in advance for your answers. I've been digging on the web for a while without finding a precise answer.

DO NOT USE CAT!!!

There are multiple threads on this forum where someone had a corrupt copy/image - or completely bricked their device using CAT.

The data, once copied will be an image of the partition - so yes.


  • On you're other questions, I'm not sure; because I use dd for these needs, even on a NAND device.

I directly connected to my ea8100 Linksys router using serial port after I connected wrongly and without knowing the dangers of two commands (never test these two)
nand erase ubifs
nand erase syscfg
I wrote, after turning the router off and on again, the router did not boot, and even its lights did not turn on, and serial communication was not established, and nothing booted at all!!!!

Is there a way to fix the router?
How can I check if the bootloader is damaged or not?
Should I use CFE files if I want to rewrite the bootloader or ubifs? Where should I find the file for this router?

I don't know much about electronics and the destructive effects of these two commands on NAND.