Ben NanoNote

Sign in or create your account | Project List | Help

Issue 31: ubiformat runs into i/o error at EOF after encountering bad block

Reported by Wolfgang Spraul, Jan 25, 2010

tested with 20100113 image, ubi-utils 1.2.0 from openwrt-packages.

reproduction steps:

1. boot from microSD

2. run 'ubiformat /dev/mtd2 -f openwrt-xburst-rootfs.ubi'

3. On devices with bad blocks in the first 50 MB of NAND, ubiformat 
will first run into a bad block saying:
cannot write 524288 bytes to mtd2 (eraseblock XX, offset 0)
error 5 (Input/output error)
libmtd: run torture test for PEB XX
libmtd: PEB XX passed torture test, do not mark it bad
ubiformat: mark it as bad? (Continue (yes/no)

4. say "y"

5. you see "ubiformat: marking block 17 bad"

6. ubiformat continues flashing, but at the end it will say
ubiformat: flashing eraseblock 78 - 101% complete
ubiformat: error!: eof reached; 524288 bytes remaining
ubiformat: error!: failed to read eraseblock 77 from 
error 5 (Input/output error)

(note the 101%)
Looks like a problem with ubiformat getting confused about offsets 
after the bad block. Also it's not clear whether the bad block 
should have been marked or not, seems libmtd and ubiformat disagree? 
Probably unrelated to the offset problem in ubiformat, and 101%.

Comment 1 by Wolfgang Spraul, Jan 25, 2010

devices with bad blocks in first 40 MB:

ID: ry, PEB 17 bad
ID: er, PEB 20 bad
ID: at, PEB 34 bad 
ID: on, PEB 42 bad

ID: we, PEB 12 bad (sometimes)
ID: in, PEB 13 bad (sometimes)
ID: io, PEB 12 bad (sometimes)

Comment 2 by Wolfgang Spraul, Jan 25, 2010

ID: in, PEB 14 is bad sometimes, not PEB 13

Comment 3 by Wolfgang Spraul, Jan 28, 2010

added screenshot

Comment 4 by Wolfgang Spraul, Oct 2, 2010

newer versions of mtd-utils fixed this bug
Status: Verified

Comment 5 by palakave palakave, Jan 25, 2019

Basically this projects.qi-hardware blog has been giving us about 
encountering bad block for for torture and continuing the tips. The 
flashing blog for error and 
computer remaining errors always.

Comment 6 by Dikha nishi, Jun 28, 2019

I am searching for this solution for a long while and i found it 
here. Thanks for the solution. I am going to fix my blog with the help of this solution.

Comment 7 by Kristy mskristymurphy, Aug 23, 2019

This is great advice! Very honest and practical.I really enjoyed 
this post.Nice post!! these tips may help Great post,

Created: 9 years 7 months ago by Wolfgang Spraul

Updated: 28 days 7 hours ago

Status: Verified

Followed by: 3 persons