flashcp failed (bad block)?

Arno Steffen arno.steffen at googlemail.com
Tue Mar 9 03:23:31 EST 2010


2010/3/9 Vimal Singh <vimal.newwork at gmail.com>:
> On Mon, Mar 8, 2010 at 9:05 PM, Arno Steffen
> <arno.steffen at googlemail.com> wrote:
>> I used the mtd-utils to flash a partition on my system on a running
>> linux. This time I get an error:
>>
>> flashcp -v /tmp/mtd5 /dev/mtd5
>> Erasing blocks: 24/320 (7%)
>> While erasing blocks 0x002e0000-0x00300000 on /dev/mtd5: Input/output error
>>
>> So I tried to erase the partition:
>>
>> flash_eraseall -j /dev/mtd5
>> Erasing 128 Kibyte @ 2c0000 --  6 % complete.
>> Skipping bad block at 0x002e0000
>> Erasing 128 Kibyte @ 27e0000 -- 99 % complete.
>>
>> Until now I have been sure that flashcp can handle bad blocks? Am I wrong?
>> What can I do?
>
> Yes, you are wrong. 'flashcp' does not handle bad blocks. Ideally you
> should use:
> 'flash_eraseall' and 'nandwrite' mtd-utils to flash a image to NAND.
>
>> flashcp works with same image file on other partition /dev/mtd6 which
>> have the same size.
>
> Perhaps partition '/dev/mtd6' did not have any bad block.
>
> --
> Regards,
> Vimal Singh
>

Thanks. That's true, mtd6 doesn't have bad blocks
I did a
"flash_eraseall -j /dev/mtd5"    and
"nandwrite -amp /dev/mtd5 /tmp/rootfs.jffs2"

( I tried the  some options but get
nandwrite -ajmp /dev/mtd5 /tmp/rootfs.jffs2
Autoplacement is not possible for legacy -j/-y options
[root at SPV ]# nandwrite -jmp /dev/mtd5 /tmp/rootfs.jffs2
MEMSETOOBSEL: Inappropriate ioctl for device )

I am not sure about the options, at least I could boot the system.
But again I get empty flash message after change in filesystem
(although set size to 2048 in jffs2 and I did a clean halt on the
system).

Regards
 Arno



More information about the linux-mtd mailing list